diff --git a/shared/package-files/00/0007dc4d06135a1f341557fa9125fb2528931f9152a4b824d7d92ace16bf7b8b/report-agg1.json b/shared/package-files/00/0007dc4d06135a1f341557fa9125fb2528931f9152a4b824d7d92ace16bf7b8b/report-agg1.json new file mode 100644 index 0000000000000000000000000000000000000000..d9940b313f33b96ac109e10b40e2a441b921ae39 --- /dev/null +++ b/shared/package-files/00/0007dc4d06135a1f341557fa9125fb2528931f9152a4b824d7d92ace16bf7b8b/report-agg1.json @@ -0,0 +1,107 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.5957149510945505, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.2243187351174611, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.5957149510945505, + "hit_rate_at_20": 0.7671169073125291, + "hit_rate_at_5": 0.7303213786679087 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.6942098914354644, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.261758691206544, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.5957149510945505, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.837890625, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.807909604519774, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.609271523178808, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.8563218390804598, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.3305526590198123, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6857142857142857, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.6010695187165775, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.5413223140495868, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.3329969727547931, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.8209342560553633, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.5957149510945505, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.4980890813298613, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.7066121519810412 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/00/00942e27fa6419d7b9b8c05fc7eec739b767b7ebebdaab0f9ad53b0c9bea3c21/scorelab-v7-B45a-51k-full.log b/shared/package-files/00/00942e27fa6419d7b9b8c05fc7eec739b767b7ebebdaab0f9ad53b0c9bea3c21/scorelab-v7-B45a-51k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..68fb1a66040cbf8771f7980439e94b10803ed726 --- /dev/null +++ b/shared/package-files/00/00942e27fa6419d7b9b8c05fc7eec739b767b7ebebdaab0f9ad53b0c9bea3c21/scorelab-v7-B45a-51k-full.log @@ -0,0 +1,4 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 87.32361314199807} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 91.96512267900107} +ind noprec_pp0.75 all=0.4768 dom=0.7174 non=0.2353 h5=0.6300 h20=0.7103 | diff=+0.0000 [+0.0000,+0.0000] +agg noprec_pp0.75 all=0.6117 dom=0.8023 non=0.4203 h5=0.8144 h20=0.8791 | diff=+0.0000 [+0.0000,+0.0000] diff --git a/shared/package-files/00/00aa1989c8b3c8cfe4d5ec88a45823abae9a43e76885a951804217804c10cf49/inv-strata-N5.log b/shared/package-files/00/00aa1989c8b3c8cfe4d5ec88a45823abae9a43e76885a951804217804c10cf49/inv-strata-N5.log new file mode 100644 index 0000000000000000000000000000000000000000..286ea2a82f61ad52652ca09d1dd8ba229cf15159 --- /dev/null +++ b/shared/package-files/00/00aa1989c8b3c8cfe4d5ec88a45823abae9a43e76885a951804217804c10cf49/inv-strata-N5.log @@ -0,0 +1,22 @@ +stratum | queries | I9b+I13 | I16 | I18 | N5 +[M+H]+ Orbitrap energy | 8211 | 0.8465 | 0.8592 | 0.8646 | 0.8658 + m/z [0, 500) | 6474 | 0.8513 | 0.8655 | 0.8676 | 0.8746 + m/z [500, 850) | 1583 | 0.8591 | 0.8604 | 0.8831 | 0.8629 + m/z [850, 5000) | 154 | 0.5195 | 0.5844 | 0.5455 | 0.5260 +[M+Na]+ Orbitrap none | 4082 | 0.2562 | 0.2829 | 0.3861 | 0.2859 + m/z [0, 500) | 526 | 0.3365 | 0.4163 | 0.4259 | 0.4259 + m/z [500, 850) | 1705 | 0.2850 | 0.2956 | 0.2927 | 0.3114 + m/z [850, 5000) | 1851 | 0.2069 | 0.2334 | 0.4608 | 0.2226 +[M+H]+ Orbitrap none | 3987 | 0.3725 | 0.3995 | 0.4146 | 0.3915 + m/z [0, 500) | 1036 | 0.4884 | 0.5685 | 0.5714 | 0.5560 + m/z [500, 850) | 1790 | 0.3480 | 0.3419 | 0.3190 | 0.3503 + m/z [850, 5000) | 1161 | 0.3066 | 0.3376 | 0.4220 | 0.3084 +[M+H]+ QTOF energy | 1523 | 0.7498 | 0.7708 | 0.7754 | 0.7840 +[M+H]+ QTOF none | 672 | 0.6622 | 0.6682 | 0.6830 | 0.6890 +[M+H]+ none | 299 | 0.5418 | 0.5585 | 0.5819 | 0.5619 +[M+Na]+ QTOF none | 227 | 0.4185 | 0.5066 | 0.4934 | 0.4846 +[M+Na]+ none | 187 | 0.3850 | 0.4866 | 0.4439 | 0.4439 +[M+Na]+ Orbitrap energy | 159 | 0.5849 | 0.5912 | 0.6478 | 0.6101 + m/z [0, 500) | 41 | 0.4878 | 0.6098 | 0.6341 | 0.6341 + m/z [500, 850) | 100 | 0.7000 | 0.6600 | 0.7400 | 0.6800 + m/z [850, 5000) | 18 | 0.1667 | 0.1667 | 0.1667 | 0.1667 diff --git a/shared/package-files/00/00abce79b919b8cc4c7a57b3a73b76add18ba8d7700752242c88f76708b0eb6c/eval-score-N5-recur-merged-10-max.log b/shared/package-files/00/00abce79b919b8cc4c7a57b3a73b76add18ba8d7700752242c88f76708b0eb6c/eval-score-N5-recur-merged-10-max.log new file mode 100644 index 0000000000000000000000000000000000000000..d589b497d5e70559f69dde6e0108714389af8138 --- /dev/null +++ b/shared/package-files/00/00abce79b919b8cc4c7a57b3a73b76add18ba8d7700752242c88f76708b0eb6c/eval-score-N5-recur-merged-10-max.log @@ -0,0 +1,41 @@ +19429 queries, 5 members, 108.7 s +cos pool rule all=0.6197 dom=0.8321 non=0.4065 h5=0.7435 macro=0.7307 +cen pool rule all=0.6088 dom=0.8045 non=0.4124 h5=0.7442 macro=0.7047 +cos_pm pool rule all=0.6306 dom=0.8380 non=0.4223 h5=0.7491 macro=0.7315 +dot pool rule all=0.6447 dom=0.8140 non=0.4748 h5=0.7704 macro=0.7230 +geo pool rule all=0.6172 dom=0.8257 non=0.4078 h5=0.7442 macro=0.7203 +idf05 pool rule all=0.6344 dom=0.8393 non=0.4286 h5=0.7552 macro=0.7307 +idf1 pool rule all=0.6399 dom=0.8384 non=0.4406 h5=0.7612 macro=0.7324 +lin pool rule all=0.5995 dom=0.7942 non=0.4039 h5=0.7119 macro=0.6967 +log01 pool rule all=0.6518 dom=0.8513 non=0.4514 h5=0.7840 macro=0.7312 +log05 pool rule all=0.6327 dom=0.8531 non=0.4114 h5=0.7514 macro=0.7386 +log20 pool rule all=0.6428 dom=0.8514 non=0.4332 h5=0.7536 macro=0.7392 +nll02 pool rule all=0.5004 dom=0.7329 non=0.2669 h5=0.6377 macro=0.6072 +nll10 pool rule all=0.4467 dom=0.6827 non=0.2097 h5=0.6048 macro=0.5538 +poolcen pool rule all=0.6109 dom=0.8033 non=0.4178 h5=0.7500 macro=0.7056 +pow020 pool rule all=0.6031 dom=0.8235 non=0.3818 h5=0.7788 macro=0.7109 +pow030 pool rule all=0.6158 dom=0.8413 non=0.3895 h5=0.7790 macro=0.7185 +pow040 pool rule all=0.6216 dom=0.8459 non=0.3964 h5=0.7527 macro=0.7289 +pow05 pool rule all=0.6397 dom=0.8510 non=0.4275 h5=0.7650 macro=0.7354 +pow05idf025 pool rule all=0.6419 dom=0.8518 non=0.4313 h5=0.7678 macro=0.7377 +pow05idf05 pool rule all=0.6337 dom=0.8518 non=0.4149 h5=0.7633 macro=0.7383 +pow05m pool rule all=0.6351 dom=0.8498 non=0.4195 h5=0.7673 macro=0.7333 +pow05s pool rule all=0.6387 dom=0.8497 non=0.4268 h5=0.7634 macro=0.7339 +pow060 pool rule all=0.6378 dom=0.8492 non=0.4255 h5=0.7595 macro=0.7389 +pow060idf025 pool rule all=0.6426 dom=0.8489 non=0.4355 h5=0.7621 macro=0.7372 +pow060idf050 pool rule all=0.6457 dom=0.8502 non=0.4403 h5=0.7644 macro=0.7395 +pow060m pool rule all=0.6301 dom=0.8491 non=0.4102 h5=0.7611 macro=0.7360 +pow065 pool rule all=0.6382 dom=0.8490 non=0.4265 h5=0.7603 macro=0.7386 +pow070 pool rule all=0.6402 dom=0.8487 non=0.4309 h5=0.7549 macro=0.7392 +pow070idf025 pool rule all=0.6419 dom=0.8488 non=0.4342 h5=0.7596 macro=0.7392 +pow070idf050 pool rule all=0.6412 dom=0.8491 non=0.4324 h5=0.7627 macro=0.7383 +pow070m pool rule all=0.6316 dom=0.8457 non=0.4166 h5=0.7549 macro=0.7354 +pow075 pool rule all=0.6393 dom=0.8457 non=0.4321 h5=0.7537 macro=0.7369 +pow080 pool rule all=0.6350 dom=0.8442 non=0.4251 h5=0.7526 macro=0.7345 +pow080m pool rule all=0.6296 dom=0.8439 non=0.4144 h5=0.7503 macro=0.7351 +pow085 pool rule all=0.6349 dom=0.8404 non=0.4286 h5=0.7513 macro=0.7342 +pow085idf025 pool rule all=0.6367 dom=0.8435 non=0.4290 h5=0.7544 macro=0.7354 +pow085idf050 pool rule all=0.6368 dom=0.8438 non=0.4289 h5=0.7580 macro=0.7345 +pow090 pool rule all=0.6325 dom=0.8378 non=0.4264 h5=0.7498 macro=0.7336 +pow2 pool rule all=0.5858 dom=0.7927 non=0.3780 h5=0.7277 macro=0.7020 +tani pool rule all=0.6011 dom=0.8184 non=0.3830 h5=0.7446 macro=0.7174 diff --git a/shared/package-files/02/02b499f2665372b2e76385beb8a177ea43a1e98d92972af11db2f74fba6f472e/train3.manifest.json b/shared/package-files/02/02b499f2665372b2e76385beb8a177ea43a1e98d92972af11db2f74fba6f472e/train3.manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..8ff0a82284cc366e80aee836851205fd14724a00 --- /dev/null +++ b/shared/package-files/02/02b499f2665372b2e76385beb8a177ea43a1e98d92972af11db2f74fba6f472e/train3.manifest.json @@ -0,0 +1,22 @@ +{ + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 +} diff --git a/shared/package-files/02/02cd6da9cce20fbcc88e057aae69f214f441203f35af263bb3a39276b8f65bc1/README.md b/shared/package-files/02/02cd6da9cce20fbcc88e057aae69f214f441203f35af263bb3a39276b8f65bc1/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8f3c83067c3bb42c6563fd3e1f5963c02651dac0 --- /dev/null +++ b/shared/package-files/02/02cd6da9cce20fbcc88e057aae69f214f441203f35af263bb3a39276b8f65bc1/README.md @@ -0,0 +1,794 @@ +# MassSpecGym v1.5 retrieval package: five scratch-trained GLACIER simulators (tolerance-matched distance of their mean prediction) + formula-transformer inverse branch (two networks) + train-fold library-neighbour branch + measured intact-ion term + cross-pool consensus term + pool aggregation + +Interim release (the research loop continues; see `EXPERIMENTS.md` at the package root). + +## What it does + +`bash infer.sh INPUT_ROOT OUTPUT_ROOT` reads `queries.jsonl` and `candidate_pools.jsonl` and +writes `OUTPUT_ROOT/rankings.jsonl` with one complete ranking per query. Four +components score every candidate from the query spectrum, their distances are added, and a +fifth transfers evidence between related pools of the input. + +**The rankings of one input are computed jointly.** Two steps use the other queries of the +same input: the pool mean (item 7; queries naming the same candidate pool) and the +cross-pool consensus term (item 6; spectra of *other* pools that resemble the query +spectrum). The ranking of a query therefore depends on which other queries the input +holds, and a subset of an input is ranked differently from the whole input (Validation: +"It depends on the input set"; Limits). No label, no stored answer and no fitted +per-query parameter is involved in either step. + +1. **Forward branch (spectrum simulation).** Every supported candidate SMILES is simulated + with a GLACIER forward model (ms-pred commit `ed8311f2`, vendored under `vendor/ms_pred`) + under the query's adduct, instrument and rounded collision energy (missing energy -> the + model's "no energy" embedding; missing instrument -> `Unknown`). Simulations are + deduplicated across queries. Each observed spectrum (top-50 peaks, square-root + intensities) is compared with each simulated candidate spectrum (top-100 predicted + fragments) by a Jensen-Shannon distance, with three global, label-free choices selected + on validation (`views` in `model_config.json`): + - **fragment-only view**: observed and predicted peaks at or above `precursor_mz - 0.5` + are left out before normalization; a spectrum with no fragment peak falls back to the + binned full-spectrum distance; + - predicted intensities are raised to the power 0.75 before normalization; + - **tolerance-matched comparison** instead of fixed 0.01 Da bins: + every predicted peak is assigned to the nearest observed peak if it lies within + `max(ppm x m/z, floor)` of it; the divergence is taken over the observed peaks and the + predicted intensity that matches no observed peak counts as its own outcome. The + tolerance depends only on the query's `instrument_type`: max(10 ppm, 1 mDa) for + `Orbitrap`, max(20 ppm, 4 mDa) for every other or missing instrument + (`match_ppm`, `match_floor_mda`, `match_by_instrument`). + Unsupported candidates get distance 1. The package holds **five** simulators (see + Model). For every candidate the five members' matched + predictions (the predicted probability assigned to each observed peak and, with it, the + unmatched remainder) are averaged and compared once with the observed spectrum + (`"ensemble": "prediction"`). +2. **Inverse branch (fingerprint prediction;** `inverse.py`, `invrun.py`**).** For every pool and every *distinct molecular formula among its + candidates* (computed from the candidate SMILES), each spectrum of the pool is annotated + under that formula: the 50 strongest peaks are matched to heavy-atom sub-compositions of + the candidate formula (adduct-shifted, tolerance `max(20 ppm, 0.004 Da)`, RDBE >= 0) and + the 24 strongest explained peaks are kept. A 25.0 M-parameter transformer + (`FormulaFormer`: root-formula token with adduct / instrument / collision-energy context, + peak tokens with sub-formula, neutral loss and intensity, pairwise formula-difference + attention biases) predicts a 4096-bit Morgan fingerprint (radius 2). The predicted bit + probabilities are averaged over all spectra of the pool (`"pooled": true`), and the + inverse distance of a candidate is the cosine distance between that mean probability + vector **under the candidate's own formula**, raised element-wise to the power 0.7, and + the candidate's fingerprint (`"score": {"members": "probability", "power": 0.7}`). The + power lifts bits the network predicts with a low but non-zero probability; it is one + global constant selected on validation. The branch holds **two networks** of one recipe + trained from different random seeds; their pooled + probability vectors are averaged before the power is applied. Their training data + include spectra that this project's own forward models simulated for the structures + of the supplied corpus (see Model). The hypothesized formula is always + the formula of the candidate being scored; no label, no true formula and no + precursor-m/z error enters the branch (the precursor m/z is not an input of the network + or of the annotation). Candidates with elements outside the supported list or with more + than 4 M heavy-atom sub-compositions get inverse distance 1. +3. **Library-neighbour branch (**`library.py`**).** A memory-based + component: `model.pt` holds a library of the **train fold** (194,119 spectra as binned + fragment and neutral-loss vectors, and the 4096-bit Morgan fingerprints of their 25,046 + structures). A query spectrum is compared with every library spectrum, + `similarity = 0.5 x (fragment cosine + neutral-loss cosine)` (0.01 Da bins, square-root + intensities, peaks at or above `precursor_mz - 0.5` dropped, query peaks spread to the + two adjacent bins; the neutral-loss view bins `precursor_mz - m/z`); the similarity of a + library molecule is the maximum over its spectra. The 20 most similar library molecules + (plus every molecule tied with the 20th among the 32 most similar, so that the vote does + not depend on the library order) vote for the candidates that resemble them: + `score(c) = sum_j s_j^6 x Tanimoto(c, m_j) / sum_j s_j^6 - prior(c)`; the library + distance is `-score(c)`. `prior(c)` is the mean Tanimoto similarity of the candidate to a + fixed sample of 1,024 library molecules: it removes the part of the score that does not + depend on the query spectrum (how much a candidate resembles train-fold molecules in + general), so the branch carries spectrum-specific evidence only. Train-fold molecules + are not candidates' answers: the benchmark split keeps train, validation and test + molecules apart, the neighbours act as structural analogues (median Tanimoto of the best + neighbour to the validation label 0.16), and with neighbours taken from a *different* + query the branch gives nothing (control below). No query, pool, label or fold other than + train is in the library, and nothing is fitted at inference. +4. **Measured intact-ion term (**`ionterm.py`**).** An MS/MS spectrum + often still contains the unfragmented ion (53 % of the train-fold spectra have a peak + within 20 mDa of it). For every candidate the term asks whether the spectrum has a peak + at *that candidate's own* ion mass - the monoisotopic mass of the candidate's formula + (from its SMILES) plus the adduct shift - and how far the nearest observed peak is from + it. The signed distance `e` is scored with an error model fitted on the train fold (see + Model): per acquisition class - (`[M+H]+` with energy, `[M+H]+` without, `[M+Na]+`) x + (`Orbitrap`, `QTOF`, other) - a Gaussian core with a relative width and offset plus a + uniform background over the window `W` = 20 mDa, + `term = -log((1 - b) exp(-z^2 / 2) + b sqrt(2 pi) sigma / (2 W))`, + `z = (e - offset_ppm x m) / sigma`, `sigma = sigma_ppm x m`. A candidate with a peak at + its ion mass gets a term near 0, one without gets the "no peak" value (3.4 - 7.4 on + validation, depending on class and mass). The term depends on the candidate only through + its formula: it separates candidates of *different formulae* and gives isomers the same + value. On validation 40 % of the queries have at least one candidate with such a peak. + Only measured peaks are read: **the reported `precursor_mz` field is not an input of + this term** (see Limits). Queries with an adduct other than `[M+H]+` / `[M+Na]+` or + without peaks get no term; a candidate whose formula the candidate store cannot + represent gets the "no peak" value. +5. **Fusion of the four components.** `fused = forward + w x inverse + u x library + v x ion` with fixed rules on + acquisition metadata and pool structure (`inverse`, `library` and `ion` in `model_config.json`): + `w = 0.75` for `[M+H]+` spectra with a recorded collision energy, otherwise + `w = max(0.05, 0.5 / n)`, where `n` is the number of query spectra that name the same + `candidate_pool_id`; `u = 0` for `[M+H]+` spectra with a recorded collision energy, + otherwise `u = 0.4`; `v = 0.05` for `[M+H]+` spectra with a recorded collision energy, + otherwise `v = 0.01`. Global constants selected on validation; nothing is fitted per + query. +6. **Cross-pool consensus term (**`consensus.py`**; new in this release).** Spectra of + related molecules resemble each other, and an input usually holds many related unknowns. + The term transfers structure evidence between the pools of one input - the idea of + annotation propagation in molecular networks, with the package's own current first + candidates in place of known identities. It reads the input spectra, the candidate + pools and the fused distances of item 5, nothing else: + - every spectrum is compared with the spectra of all **other** pools of the input by the + similarity of the library branch (item 3: `0.5 x (fragment cosine + neutral-loss + cosine)`, 0.01 Da bins); the similarity `s_B` of a pool `B` is the maximum over its + spectra; + - every pool `B` has *current answers*: its first 10 candidates `b` under the pool mean + `D_B` of the fused distance, weighted + `P_B(b) = softmax(-(D_B(b) - min D_B) / 0.02)` (ties by candidate id); + - a candidate `c` of the query's pool receives from pool `B` the evidence + `e_B(c) = sum_b P_B(b) x Tanimoto(c, b) - prior(c)` (4096-bit Morgan fingerprints); + `prior(c)` is the mean of the first sum over **all** pools of the input - what `c` + gets from resembling the input's current answers in general. Subtracting it leaves + the evidence that depends on the query spectrum; + - the 10 most similar pools vote (plus every pool tied with the 10th among the 32 + retrieved, so that the vote does not depend on the order of the input): + `vote(c) = sum_B s_B^3 x e_B(c) / (sum_B s_B^3 + 0.5^3)`, and + `distance = fused - vote` for every query (`consensus` in `model_config.json`: + `answers`, `temperature`, `k`, `top`, `power`, `absorb`, weights 1 / 1). + The constant `0.5^3` acts as a neighbour of similarity 0.5 that carries no evidence: a + spectrum that resembles nothing else in the input gets a vanishing term, and on an + input of one pool the term is absent. Nothing is fitted or stored; no label, candidate + position or table of molecules is read; the "answers" are the fixed model's own + predictions for the same input, right or wrong. One round only: the answers come from + the fused distance of item 5, not from the output of this step. +7. **Pool aggregation (multi-spectrum evidence).** Queries that name the same + `candidate_pool_id` are spectra of the same unknown, so the final distance of a candidate + is the mean of its distances (`fused - vote`) over all scored spectra of that pool + (`pool_aggregation: 1.0`). This uses only the supplied inputs: no labels, no formulae, no + candidate positions. With weight 1 all spectra of a pool receive the same ranking. +8. Candidates are sorted by distance, ties by candidate id. + +## Model + +- **Forward members**: five GLACIER networks (15.1 M parameters each), all descending from + **random initialization**, trained under all acquisition conditions (194,119 train + spectra), batch 32, stock cosine intensity loss; EMA weights. Source checkpoint sha256: + - run B, seed 1 (`research/runs/B-all-b32`), train fold only: step 20,000 + `80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c`, step 30,000 + `0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798`; + - run B2, seed 2 (`research/runs/B2-all-b32-seed2`), train fold only: step 20,000 + `ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c`, step 30,000 + `f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1`; + - **fork S2** (`research/runs/S2-B20k-synth`): run B's own training state at step + 20,000 continued to step 30,000 with an additional auxiliary intensity loss on 32 + spectra per step of the task-supplied `synthetic_augmentation` corpus; step 30,000 + `44742fa31f337e59b543d903018780560569c2e8e50a008ba008859c8440e3a2` (E47). +- **Inverse members**: two `FormulaFormer` networks (dim 512, 6 layers, 8 heads, + 24,997,832 parameters each), **randomly initialized**, binary cross-entropy on Morgan + bits, batch 512, 50,000 steps, EMA weights; same recipe and training data, different + seeds: run I9b, seed 1 (`research/runs/I9b-ff512x6-real08-corpus2+train3`), step 50,000 + (sha256 `f2741a9676a4743fa586d3effe8753d6eade9356fb2ceac8055ff50baf34195f`), and run + I13, seed 2 (`research/runs/I13-ff512x6-real08-corpus2+train3-seed2`; E63), step 50,000 (sha256 + `bd0f9c965cf7e0101877c780d9f3592e6fc07b4b20cdfc35adb9f60e3aa295a7`). Their training + data have three sources: + - the MassSpecGym v1.5 train fold (194,119 spectra annotated under their label formula, + sampled with weight `spectra_of_molecule ** -0.5`): 8 % of every batch; + - the task-supplied `synthetic_augmentation` corpus (2,333,477 ICEBERG-simulated spectra of + 435,076 structures): 46 % of every batch. The task documents describe this corpus as + held-out-clean optional training data available to every method; our check found 0 + structures (2D InChIKey block) shared with validation labels; + - **self-simulated spectra (E60)**: 46 % of every batch. The + structures are those of the same supplied corpus and no others. They were simulated + with this package's own simulation code by two of its forward members - run B step + 30,000 and run B2 step 30,000, both trained on the train fold only; the fork member S2 + is left out because its auxiliary loss saw corpus rows - under (adduct, instrument, + collision energy) conditions copied (a) from two of the structure's own corpus rows + (868,083 spectra) and (b) from three train-fold rows of similar precursor mass + (1,163,218 spectra), which brings in `[M+Na]+` and spectra without a recorded energy, + conditions the corpus does not contain. A simulated spectrum (mean of the two members' + predictions; peaks at or above 2 % of the base peak, at most 24, annotated under the + structure's formula) is a training row like any other. 2,031,301 rows of 434,950 + structures; store manifests `research/inv/selfsim/*.manifest.json`, source + `training/inv/selfsim.py`. This is data generated from supplied structures by networks + that were themselves fitted to the train fold only: no validation or test spectrum, + label, structure or candidate pool was simulated or otherwise read for training. +- **Train-fold library** (`research/library/manifest.json`, asset sha256 + `22d1ddb216eef78d5040209ff6526371e5fcd8aac88e68a36823b6d5e73b3712`): built by + `training/build_library.py` from `train.jsonl` only (source sha256 + `de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc`): 194,119 spectra, + 25,046 molecules, 6.77 M fragment and 6.76 M neutral-loss entries, 1,024 prior-sample rows + (`numpy.random.default_rng(0)`). It is fitted data of the model in the same sense as + network weights - a nearest-neighbour model over the training fold - and is declared + here because it is not a gradient-trained tensor. It contains no validation or test + record. `model_config.json` -> `library_asset` repeats the manifest. +- **Intact-ion error model** (`research/inv/ion_error_table.json`, sha256 + `39aca3a714fd25a20cbaba4d46942764b52d730828a4b8205bf46ac5fc2a6225`; repeated in + `model_config.json` -> `ion_asset` and stored in `model.pt`): fitted by + `training/analysis/ion_fit.py` on the **train fold only**. For each of the 194,119 train + spectra: the signed distance between the ion mass of the spectrum's label formula and the + nearest observed peak, kept if within 20 mDa; per acquisition class a two-component + mixture (Gaussian core with relative width and offset + uniform background) by 200 EM + iterations. 27 fitted numbers: + + | class | train spectra | peak within 20 mDa | offset (ppm) | sigma (ppm) | background share | + |---|---|---|---|---|---| + | `[M+H]+` with energy, Orbitrap | 64,738 | 0.507 | +0.36 | 1.51 | 0.020 | + | `[M+H]+` with energy, QTOF | 34,603 | 0.511 | +0.03 | 4.35 | 0.087 | + | `[M+H]+` with energy, other instrument | 36 | - | (row of QTOF) | | | + | `[M+H]+` without energy, Orbitrap | 51,704 | 0.548 | -0.94 | 2.94 | 0.120 | + | `[M+H]+` without energy, QTOF | 11,931 | 0.626 | +0.67 | 4.58 | 0.080 | + | `[M+H]+` without energy, other instrument | 3,467 | 0.670 | +0.85 | 4.27 | 0.102 | + | `[M+Na]+`, Orbitrap | 24,454 | 0.495 | -0.87 | 2.94 | 0.183 | + | `[M+Na]+`, QTOF | 2,361 | 0.860 | +1.12 | 4.10 | 0.080 | + | `[M+Na]+`, other instrument | 825 | 0.931 | +3.00 | 2.97 | 0.032 | + + Like the library it is fitted data of the model, declared here because it is not a + gradient-trained tensor. No validation or test record entered the fit; validation chose + only the two weights `v`. + **Provenance note:** `model_manifest.json` keeps the contract's literal + `training_provenance.data` value ("MassSpecGym v1.5 train fold") because the contract fixes + the manifest fields; the additional supplied synthetic training corpus (inverse members, + forward member S2) and the self-simulated spectra of its structures (inverse members) are + declared here and in `model_config.json` (`members[].training_data`, + `inverse_members[].training_data`, `inverse_members[].self_simulated_store`), the + train-fold library and the train-fold intact-ion table in `library_asset` and + `ion_asset`. All of these are training *data* or statistics of it - supplied with the + task, or generated from supplied structures by networks of this project that were trained + from random initialization on the train fold - and not pretrained assets: no pretrained + weights, no published GLACIER / MIST / ICEBERG weights and no external model are used at + any point. +- Validation never contributed a gradient or a library entry. Validation labels selected: + the checkpoint steps and the member combinations, the matching tolerance per instrument + class, the ensemble rule, pooled scoring, the three inverse fusion constants (unchanged + since release `1yfse16j`), the inverse score (mean probability, power 0.7; about forty + scoring functions were compared on the full fold, E59), the training recipe of the inverse + members (which simulated rows enter; seven runs and their pairs compared, E60 / E61 / E63), the two weights + of the intact-ion term (twelve weight pairs, after about 230 scored variants of the term's form and weights + showed one plateau, E64), the settings of the cross-pool consensus term (10 answers, + temperature 0.02, 10 neighbours, power 3, absorbing constant 0.5, weight 1, prior on, + one round; about eighty settings were scored on the full fold, E65), and for the + library branch its similarity (fragment + + neutral-loss sum; fragment-only and loss-only were tried), `k = 20`, the power 6, the + prior correction and the two weights (`u = 0 / 0.4`) - more than a hundred fused settings + were scored on the full validation fold (E48), so the reported gain carries selection + noise. +- `model.pt` (627 MB, sha256 + `7d474babce9102814c0f5d4064f9936e8754fecf6f5bc10abc7910c5ce5f1c09`) is a single PyTorch + file holding the forward member list, the inverse member list, the library tensors and + the intact-ion table. It is **byte-identical to the file of the previous release + `qo3ligq0`**: this release adds no trained weight and no fitted number. Inference code: + `consensus.py` is new and `infer.py` gained the term (four arrays of the candidate store + are kept, one call, one log line, one fusion step); `infer.sh`, `fastfeat.py`, + `inverse.py`, `invrun.py`, `library.py`, `ionterm.py` and `vendor/` are byte-identical to + `qo3ligq0`. With `consensus` removed from `model_config.json` the package computes the + rankings of `qo3ligq0`. + +## Validation (selection evidence; not comparable to the test reference) + +Full validation fold, 19,429 queries / 3,386 pools, query-set sha256 +`7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6`. Official scorer +(`/workspace/evaluation/score.py`), report `research/logs/fullfold-5Ms-I9b+I13-L-ion-net.report.json`. + +| ranking | Hit@1 | Hit@5 | Hit@20 | 95 % CI Hit@1 (molecule-group bootstrap) | +|---|---|---|---|---| +| **released** (`qo3ligq0` + cross-pool consensus term; the whole fold as one input) | **0.8022** | 0.8719 | 0.9164 | 0.7445 - 0.8469 | +| previous release `qo3ligq0` (five forward members, two inverse networks, library branch, intact-ion term) | 0.7713 | 0.8797 | 0.9377 | 0.7153 - 0.8193 | +| release `2neva96r` (one inverse network trained with self-simulated spectra; no intact-ion term) | 0.7591 | 0.8761 | 0.9364 | 0.7022 - 0.8064 | +| release `hun9z36i` (three inverse networks; inverse score = power 0.7 of the mean probability) | 0.7525 | 0.8728 | 0.9292 | 0.6961 - 0.8005 | +| release `z3hoccsj` (five forward members + inverse + library branch) | 0.7481 | 0.8744 | 0.9313 | 0.6932 - 0.7960 | +| release `q4j2rs0g` (four forward members + inverse) | 0.7327 | 0.8565 | 0.9156 | 0.6762 - 0.7808 | +| release `ue3i0ea7` (same four members, mean of member distances) | 0.7316 | 0.8563 | 0.9152 | 0.6760 - 0.7796 | +| release `meqq___h` (forward pair of run B, 0.01 Da bins) | 0.7384 | 0.8418 | 0.9104 | 0.7015 - 0.7736 | +| release `1yfse16j` (same forward pair, inverse I1 50k only) | 0.7265 | 0.8372 | 0.9033 | 0.6895 - 0.7628 | +| release `xjj2vs5c` (forward pair only) | 0.6539 | 0.8177 | 0.8925 | 0.6164 - 0.6942 | + +Paired difference to `qo3ligq0` by the official scorer (molecule groups resampled): +**+0.0308 [+0.0095, +0.0561]** - the interval excludes zero. **Hit@5 and Hit@20 are lower** +than in `qo3ligq0` (-0.0078 and -0.0213): one pool of 542 spectra (2.8 % of the fold) moved +from rank 5 to rank 28; counted per pool both rise (below). Strata of the official report: +`[M+H]+` 0.863, `[M+Na]+` 0.612; recorded collision energy 0.840-0.952, missing energy +0.665; Orbitrap 0.797, QTOF 0.844, no instrument 0.774; stock GLACIER domain (`[M+H]+` with +energy) 0.936, other 0.667 (`qo3ligq0`: 0.931 / 0.611). These numbers hold for the fold +given to the package as **one input** of 19,429 queries; see "It depends on the input set". + +### The change against `qo3ligq0` (E65): the cross-pool consensus term + +Every weight, table and constant of `qo3ligq0` is unchanged; one step was added between the +fusion and the pool mean. Why a new source of evidence: `qo3ligq0` misses 477 of the 3,386 +validation pools, mostly among isomers of the right formula, and a diagnostic re-ranker +fitted on the four existing branch outputs (cross-validated over pools, analysis only, +never packaged) reached pool-macro +0.0044 [-0.0009, +0.0097] - the branches hold no unused +evidence. The input set does: the spectrally most similar *other* pool of a validation +spectrum has a target with a mean Tanimoto similarity of 0.339 to the query's target +(a random pool: 0.100; 0.817 where the spectral similarity is at least 0.8). The identities +of those pools are unknown at inference, but the package's first candidates for them are +right or structurally close most of the time, which is enough for a vote. + +Evidence on the full validation fold (analysis code `training/analysis/netprop.py`, which +the packaged `consensus.py` reproduces to 4e-16, see the end of this section; paired +bootstrap over pools against `qo3ligq0`; `research/logs/netprop-released.log`): + +| measure | `qo3ligq0` | **this release** | +|---|---|---| +| official Hit@1 | 0.7713 | **0.8022, +0.0308 [+0.0095, +0.0561]** (official scorer) | +| pool-macro Hit@1 (every pool counts once) | 0.8591 | **0.8739, +0.0148 [+0.0089, +0.0213]** | +| pools gained / lost | - | 83 / 33 | +| query-weighted Hit@1 without the 20 largest pools | - | +0.0245 | +| Hit@1 with pool weight min(n, 30) | - | +0.0244 [+0.0102, +0.0396] | +| fused Hit@1 per spectrum (no pool mean) | 0.6184 | 0.6807 | +| Hit@5 / Hit@20 (official) | 0.8797 / 0.9377 | 0.8719 / 0.9164 | +| pool-macro Hit@5 / Hit@20 | 0.9306 / 0.9666 | 0.9383 / 0.9687 | +| domain / other Hit@1 | 0.9314 / 0.6106 | 0.9364 / 0.6674 | +| the term alone, after the pool mean (official weighting / pool-macro) | - | 0.4493 / 0.3804 | + +**Controls that must not gain** (same settings; `research/logs/netprop-released-shuffle.log`, +`-shuffle2.log`, `-randcand.log`): +- *neighbours of a randomly chosen other spectrum* (two seeds): official -0.0005 + [-0.0074, +0.0055] and -0.0007 [-0.0122, +0.0104], pool-macro -0.0018 [-0.0053, +0.0015] + and -0.0006 [-0.0038, +0.0027], pools 14 gained / 20 lost and 14 / 16. The gain needs the + spectral match; a vote of arbitrary pools of the fold does nothing. +- *a random candidate of each neighbouring pool in place of its current answers*: official + -0.0096 [-0.0340, +0.0095], pool-macro -0.0035 [-0.0086, +0.0015], pools 36 / 48. The + gain needs the model's answers; it does not come from similar spectra having similar + candidate lists. + +**It depends on the input set.** The term can only use related pools that are in the same +input. The same package on random shares of the validation pools (each share is a complete +input of its own; base = `qo3ligq0` on the same share; `research/logs/netprop-released-sub-*.log`; +the `val-sub` and `val-tiny` rows are end-to-end replays of the package): + +| share of the pools (seed) | pools | base Hit@1 / pool-macro | Hit@1 change | pool-macro change | pools gained / lost | +|---|---|---|---|---|---| +| 100 % | 3,386 | 0.7713 / 0.8591 | +0.0308 [+0.0100, +0.0559] | +0.0148 [+0.0089, +0.0213] | 83 / 33 | +| 50 % (1) | 1,693 | 0.7629 / 0.8529 | +0.0333 [+0.0085, +0.0604] | +0.0106 [+0.0030, +0.0189] | 33 / 15 | +| 25 % (1) | 846 | 0.7410 / 0.8416 | +0.0362 [+0.0004, +0.0816] | +0.0071 [-0.0035, +0.0178] | 13 / 7 | +| 25 % (2) | 846 | 0.7629 / 0.8404 | +0.0132 [-0.0112, +0.0371] | +0.0130 [+0.0012, +0.0236] | 18 / 7 | +| 12 % (`val-sub`) | 413 | 0.7718 / 0.8862 | **-0.0126 [-0.0379, +0.0028]** (official scorer) | 0.0000 | 4 / 4 | +| 10 % (1) | 339 | 0.7684 / 0.8319 | +0.0000 [-0.0247, +0.0222] | +0.0029 [-0.0059, +0.0118] | 2 / 1 | +| 10 % (2) | 339 | 0.7644 / 0.8437 | +0.0048 [-0.0071, +0.0218] | +0.0059 [-0.0059, +0.0177] | 3 / 1 | +| 3 % (1) | 102 | 0.7995 / 0.8725 | +0.0360 [+0.0000, +0.1160] | +0.0098 [+0.0000, +0.0294] | 1 / 0 | +| 3 % (2) | 102 | 0.8165 / 0.8431 | 0 | 0 | 0 / 0 | +| 1 % (`val-tiny`) | 40 | 0.8833 / 0.8750 | 0 | 0 | 0 / 0 | + +The number of pools the term corrects falls with the size of the input, faster than the +input itself (83 - 33 = 50 net pools at 100 %, 18 at 50 %, 6 and 11 at 25 %, 0 to 2 at +10 - 12 %). On no share is the pool-macro measure lower; the per-query value follows the +size of the pools that flip, and on `val-sub` it is **lower** than without the term because +one pool of 22 spectra moves from rank 1 to rank 14 (4 pools gained, 4 lost). A verifier +that scores the test fold in several shards will therefore see a smaller gain than one +that scores it in one call, and on a small input the term is noise of either sign. + +**Where the gain is** (full fold; pools gained / lost). By number of spectra in the pool: +1: 14 / 7 (431 pools); 2 - 4: 37 / 13 (2,303); 5 - 19: 18 / 8 (452); 20 - 49: 10 / 4 +(161); 50 - 99: 3 / 1 (35); 100 and more: 1 / 0 (4) - every class gains about twice what +it loses, and two thirds of the per-query gain come from the 200 pools with at least 20 +spectra. By condition: pools of `[M+H]+` spectra with an energy 13 / 6 (2,153 pools), mixed +12 / 6 (254), pools without such spectra 58 / 21 (979) - the gain sits where the models are +weak. Of the gained pools 31 had the label at rank 2, 25 at ranks 3 - 5, 13 at ranks +6 - 10, 14 further down. 354 pools have a target whose 2D structure (first InChIKey block) +is also the target of another pool - stereoisomers and the like, which the benchmark +counts as different molecules: 32 gained / 7 lost there, 51 / 26 in the other 3,032 pools. + +**What gets worse.** 33 pools that were right are now wrong (17 of them with the label at +rank 2, 27 inside the top five). Per query, Hit@5 and Hit@20 fall: the largest pool of the +fold (542 spectra, label at rank 5 before) drops to rank 28, which alone costs 2.8 points +of Hit@5 and Hit@20; without that pool Hit@1 / Hit@5 / Hit@20 go from 0.7935 / 0.8762 / +0.9359 to 0.8252 / 0.8969 / 0.9427, and per pool 50 pools enter the top five while 24 leave +it (top twenty: 23 / 16). The term mostly reorders pools whose first candidates were nearly +tied: the margin between the first and the second candidate is 0.005 (median) in the +pools it changes and 0.34 in the pools that stay right. Neither that margin nor the +similarity of the neighbours separates the gained from the lost pools (gains outnumber +losses about two to one or better in every class of neighbour similarity and under every +margin gate tried, `research/logs/netprop-margin.log`), so no confidence gate is used. + +**Selection and plateau.** About eighty settings were scored on this fold. Pool-macro +change / pools gained and lost / official Hit@1 around the released point (10 answers, +temperature 0.02, `k` 10, power 3, absorbing constant 0.5, weight 1): answers 1 -> +0.0100, +72 / 38, 0.7747; 3 -> +0.0127, 75 / 32, 0.7854; 5 -> +0.0145, 83 / 34, 0.7878; **10 -> ++0.0148, 83 / 33, 0.8022**; 20 -> +0.0145, 82 / 33, 0.7976; 40 -> +0.0139, 81 / 34, 0.7951; +temperature 0.05 -> +0.0136; and with 5 answers: `k` 5 / 20 -> +0.0130 / +0.0142; power +2 / 6 -> +0.0139 / +0.0121; absorbing constant 0.3 / 0.7 -> +0.0139 / +0.0121; weight +0.5 / 1.5 -> +0.0109 / +0.0136. The pool-macro measure is a plateau (+0.012 to +0.015) +for 5 to 40 answers; **the official value moves between 0.788 and 0.802 on that plateau** +because a handful of very large pools flip, so the released 0.8022 is its upper end and ++0.031 is an optimistic reading - the plateau supports +0.017 to +0.031. Variants +that were not better and are not in the package: no prior (+0.0127, 87 / 44), a second and +a third round with the answers of the previous round (+0.0118, +0.0109), weighting each +neighbour by the confidence of its answers (+0.0127 to +0.0145), a cap of 0.8 on the +similarity (no gain in an early one-answer form), and plain normalization without the +absorbing constant (+0.0139 with 90 / 43 on the full fold - equal within noise - but it +flips more pools on small inputs: 6 / 5 against 2 / 1 on a 10 % share). + +**What is and is not shown.** Every pool-level interval and the official scorer's +molecule-group interval exclude zero on the full fold, the two controls behave as they +should, and the gain is present in every pool-size class. Not shown: that an input has to +be as large and as inter-related as the validation fold for the gain to appear is a +property of the method, and how many related molecules the test fold holds, and whether +the verifier scores it as one input, cannot be known here. The term adds no new knowledge +about fragmentation - it makes the package's answers for related spectra agree with each +other, and where the models are wrong about a whole family in the same way it will +reinforce the error. + +### The two changes of `qo3ligq0` against `2neva96r` (E63, E64; kept in this release): a second inverse network and the measured intact-ion term + +This section describes release `qo3ligq0`. Its forward members, library, inverse score and the inverse / library fusion constants were +those of `2neva96r`. Evidence on the full validation fold, every variant inside the release +rule, paired bootstrap over pools against `2neva96r` (`research/logs/fused-I13-vs-I9b.log`, +`research/logs/ion-term-package-I9b.log`, `research/logs/ion-term-package-I9b+I13.log`; the +last two use the packaged `ionterm.py` itself): + +| measure | `2neva96r` | + second inverse network | + intact-ion term (one network) | `qo3ligq0` (both) | +|---|---|---|---|---| +| official Hit@1 | 0.7591 | 0.7638, +0.0047 [-0.0025, +0.0121] | 0.7659, +0.0068 [+0.0021, +0.0143] | **0.7713, +0.0122 [+0.0057, +0.0206]** | +| pool-macro Hit@1 (every pool counts once) | 0.8535 | 0.8544, +0.0009 [-0.0024, +0.0038] | 0.8571, +0.0035 [+0.0012, +0.0062] | **0.8591, +0.0056 [+0.0018, +0.0095]** | +| pools gained / lost | - | 15 / 12 | 16 / 4 | 31 / 12 | +| query-weighted Hit@1 without the 20 largest pools | - | +0.0053 [-0.0031, +0.0135] | +0.0077 [+0.0023, +0.0156] | +0.0138 [+0.0062, +0.0229] | +| Hit@1 with pool weight min(n, 30) | - | +0.0060 [-0.0015, +0.0138] | +0.0071 [+0.0023, +0.0137] | +0.0134 [+0.0062, +0.0219] | +| fused Hit@1 per spectrum (no pool mean) | 0.6158 | 0.6172, +0.0013 [-0.0005, +0.0033] | 0.6168, +0.0009 [-0.0002, +0.0021] | 0.6184, +0.0025 [+0.0005, +0.0049] | +| Hit@5 / Hit@20 (official) | 0.8761 / 0.9364 | 0.8788 / 0.9377 | 0.8766 / 0.9361 | 0.8797 / 0.9377 | +| domain / other Hit@1 | 0.9227 / 0.5947 | 0.9274 / 0.5995 | 0.9268 / 0.6044 | 0.9314 / 0.6106 | + +**Second inverse network (E63).** Three further networks were trained from the recipe of +the released one, each with one factor changed: six instead of three train-like +self-simulated conditions per structure (I11), a larger self-simulated share (I12), and +seed 2 with nothing else changed (I13). None beats the released network; the seed twin +differs from it by -0.010 alone and by +0.002 official / -0.003 pool-macro in the fused +ranking with 30 pools gained and 41 lost. So a single retrained network moves the fused +Hit@1 by about +/- 0.003, and the differences between the recent recipes are inside that +spread. Averaging two networks is the only step with a consistent sign (pairs: +0.0035 and ++0.0047 official, 15 - 18 pools gained against 12 lost; a third member adds nothing). Alone +this step is **not** significant on any measure; it enters because it adds to the second +change (0.0047 + 0.0068 separately, 0.0122 together) and costs about a minute per 20,000 +queries. The pair of the two seeds was preferred over the pair with I11 (equal within +noise) because it changes nothing but the seed. + +**Measured intact-ion term (E64).** Candidates of a pool have a median of 55 distinct +formulae; when the unfragmented ion is still in the spectrum, its measured mass says which +of them are possible - evidence neither network branch is built to read at the ppm level +(the forward comparison drops the precursor region, the inverse annotation uses a 20 ppm +tolerance, the library bins are 0.01 Da). The shape of the term is fitted on the train +fold; validation chose two weights. Evidence beyond the table: +- **Form does not matter, weight plateau.** Hand-set kernels, kernels with the train-fold + widths (x 1 to x 3), normalized likelihoods and the released mixture give the same + result at the same weights: with one inverse network official +0.001 to +0.007 and + pool-macro +0.002 to +0.004, with two networks official 0.765 - 0.771 and pool-macro + 0.857 - 0.859. Released mixture, two networks, `v` domain / other: 0.02 / 0.01 -> 0.7706, + pool-macro 0.8585; **0.05 / 0.01 -> 0.7713, 0.8591**; 0.05 / 0.02 -> 0.7714, 0.8594; + 0.1 / 0.01 -> 0.7709, 0.8579; 0.05 / 0.05 -> 0.7679, 0.8582; 0.05 / 0 -> 0.7678, 0.8579. + At a domain weight of 0.5 with the kernel form the term overrides the models (11 pools + lost, pool-macro -0.005 to -0.011). The released pair is an interior point, with the + smaller non-domain weight chosen away from the downturn at 0.05. +- **Where the gain is** (`qo3ligq0` against `2neva96r`, points of the official metric): + `[M+H]+` with energy below 400 m/z +0.22, 700 - 850 m/z +0.13 (0.643 -> 0.732); without + energy, `[M+H]+` 400 - 500 m/z +0.18, 500 - 600 +0.10, `[M+Na]+` 400 - 500 +0.15, + 500 - 600 +0.09; positive in 20 of 24 stratum x mass cells, largest loss -0.01. +- **Ceiling.** If every candidate with a formula other than the label's were removed (an + oracle, analysis only), `2neva96r` would reach 0.7854: formula errors are 2.6 of its 24.1 + lost points, and the term recovers about a quarter of them. The remaining errors are + isomers of the correct formula, which this term cannot touch. + +**What is and is not shown.** For the two changes together every pool-level interval +excludes zero, and so does the official scorer's molecule-group interval; it was the +first release since `z3hoccsj` for which that held. For the term alone the intervals +exclude zero with only 4 pools lost; for the second network alone nothing is significant. +The weights were picked among twelve pairs and the member set among four ensembles, on this fold, +so part of the difference is selection; the neighbouring settings lie within 0.001 - 0.004 +of the released one. Whether test spectra contain the intact ion as often as validation +spectra do cannot be measured here; where it is absent the term is constant and changes +nothing. + +### The change of `2neva96r` against `hun9z36i` (E60, E62; kept in this release): an inverse network trained with spectra simulated by the package's own forward models + +This section describes release `2neva96r`, whose inverse branch was the single network +I9b. Forward members, library, inverse score and fusion constants were those of `hun9z36i`. Its +three inverse networks (trained on the train fold and the supplied ICEBERG corpus) are +replaced by one network of the same architecture and schedule; half of its simulated +training rows are spectra that our forward members simulated for the corpus structures +(see Model). Why it should help: E59 showed the inverse branch limited by its simulated +rows; the supplied rows come from a different simulator and cover only `[M+H]+` with an +energy, while our forward members were fitted to the train fold under all conditions, so +their output looks like the real rows the inverse network meets at inference and can be +produced under the conditions the corpus lacks. Controlled steps (E60; same recipe, seed +and schedule; member alone, Hit@1 per spectrum / after the pool mean, trainer metric): +corpus rows only 0.432 / 0.488; plus the corpus structures self-simulated under two of +their corpus conditions 0.489 / 0.537; plus three train-like conditions per structure +(network I9b) 0.511 / 0.551. A quarter of the corpus rows plus self-simulated +rows for the other three quarters of the structures (0.477 / 0.521) beats the full +corpus. Evidence on the full validation fold with the release rule +(`research/logs/eval-score-I9b.log`, `research/logs/fused-I9b-vs-hun9z36i.log`, +`research/logs/inv-strata-I9b.log`, `research/logs/fused-I9b-bins-vs-hun9z36i.log`; paired +bootstrap over pools): + +| measure | `hun9z36i` | `2neva96r` | +|---|---|---| +| inverse branch alone, Hit@1 after pooling (official weighting / pool-macro) | 0.5272 / 0.6007 | 0.5887 / 0.7011 | +| official Hit@1 of the fused ranking | 0.7525 | **0.7591, +0.0066 [-0.0013, +0.0143]** | +| pool-macro Hit@1 (every pool counts once) | 0.8414 | 0.8535, +0.0121 [+0.0068, +0.0177] | +| pools gained / lost | - | 68 / 27 | +| query-weighted Hit@1 without the 20 largest pools | - | +0.0074 [-0.0016, +0.0169] | +| Hit@1 with pool weight min(n, 30) | - | +0.0076 [-0.0016, +0.0172] | +| fused Hit@1 per spectrum (no pool mean) | 0.6053 | 0.6158, +0.0105 [+0.0065, +0.0147] | +| Hit@5 / Hit@20 (official) | 0.8728 / 0.9292 | 0.8761 / 0.9364 | +| domain / other Hit@1 | 0.9136 / 0.5907 | 0.9227 / 0.5947 | + +**What is and is not shown.** The branch alone improves by 0.06 on the official measure +and 0.10 pool-macro, one network against an ensemble of three. About a tenth of that +arrives in the fused ranking, because the forward branch already ranks most of the pools +the inverse branch gains. The pool-macro and the per-spectrum interval exclude zero; the +official interval and the two query-weighted measures that single pools cannot decide +include it narrowly. Every Hit@k is higher. Where the gain is (inverse branch alone, +`hun9z36i` -> `2neva96r`): precursor m/z below 300: 0.613 -> 0.763, 300-450: 0.690 -> +0.792, 450-700: 0.553 -> 0.652, **700-850: 0.350 -> 0.305, above 850: 0.276 -> 0.257** - +all of it lies below 700 m/z; for the 31 % of validation queries above 700 m/z the new +network is slightly worse alone (only 4 % of the corpus rows are that heavy), and the +fused ranking barely moves there (0.510 -> 0.509; below 700 m/z 0.860 -> 0.870). By condition (alone): `[M+H]+` with energy 0.729 -> +0.824, `[M+H]+` without 0.382 -> 0.418, `[M+Na]+` with 0.349 -> 0.519 (241 queries), +`[M+Na]+` without 0.260 -> 0.271. Selection on this fold: four training recipes were +compared (two smaller self-simulation stores, this one, and one with generated +structures, which was worse, E61); the fusion constants were re-scanned with the new +network and stay where they were. A caveat on independence: the self-simulated rows carry +the forward models' view of fragmentation (out of sample a simulated spectrum shares +22-32 % of the real peaks of its structure, E60), so the two branches may err together +more often than before; the fused gain is positive in both condition classes, but this +was not measured directly. + +### The change of `hun9z36i` against `z3hoccsj` (E59 c; score kept in this release): how the inverse prediction is compared with a candidate + +This section describes release `hun9z36i`, which still had three inverse networks; the +score it introduced is kept. Its networks and library were those of `z3hoccsj`. Only the comparison between the +predicted fingerprint and a candidate fingerprint changed: one cosine distance of the three +networks' mean bit probability raised to the power 0.7, instead of the mean of three plain +cosine distances. Why it should help: the networks are trained with a bit-wise +cross-entropy and spread probability mass over many bits at low values when a spectrum is +uninformative; the plain cosine is dominated by the few confident bits and nearly ignores +that low-probability evidence, a concave transform restores it. Evidence on the full +validation fold (`research/logs/fused-score.log`, `research/logs/fused-score-gamma.log`, +`research/logs/score-scan.log`, `research/logs/score-scan-idf.log`; paired bootstrap over +pools): + +| measure | `z3hoccsj` | `hun9z36i` | +|---|---|---| +| inverse branch alone, Hit@1 after pooling (official weighting / pool-macro) | 0.5139 / 0.5898 | 0.5272 / 0.6007 | +| official Hit@1 of the fused ranking | 0.7481 | **0.7525, +0.0044 [-0.0020, +0.0114]** | +| pool-macro Hit@1 (every pool counts once) | 0.8379 | 0.8414, +0.0035 [+0.0003, +0.0071] | +| pools gained / lost | - | 23 / 11 | +| query-weighted Hit@1 without the 20 largest pools | - | +0.0049 [-0.0018, +0.0127] | +| Hit@1 with pool weight min(n, 30) | - | +0.0046 [-0.0020, +0.0121] | +| fused Hit@1 per spectrum (no pool mean) | 0.6012 | 0.6053, +0.0041 [+0.0025, +0.0058] | +| Hit@5 / Hit@20 (official) | 0.8744 / 0.9313 | 0.8728 / 0.9292 | +| domain / other Hit@1 | 0.9089 / 0.5867 | 0.9136 / 0.5907 | + +The power is on a plateau: fused official difference +0.0019 / +0.0019 / +0.0015 / +0.0039 / +**+0.0044** / +0.0040 / +0.0038 for powers 0.9 / 0.85 / 0.8 / 0.75 / **0.7** / 0.65 / 0.6 +(pool-macro +0.0015 ... +0.0035, pools gained > lost for every one), -0.0013 at 0.5; the +mean probability without a power gives +0.0008. The fusion constants were re-scanned with +the new score and stay where they were. **What is and is not shown:** the gain is small. +The pool-macro and the per-spectrum interval exclude zero, the official one does not, and +Hit@5 / Hit@20 are 0.002 lower. The variant was picked among about forty scoring functions +(powers, logarithms, bit-frequency weights, centred cosines, Tanimoto, likelihoods) of +which the concave ones cluster at +0.001 to +0.005 official, so part of +0.0044 is +selection. It was released because every Hit@1 measure agrees in sign, the branch alone +improved clearly, and the change costs nothing at inference. + +### The two changes of `z3hoccsj` against `q4j2rs0g` (E47, E48; unchanged in this release) + +The official Hit@1 is query-weighted and all spectra of a pool receive one ranking, so a +few very large pools can decide it (one validation pool is 2.8 % of the fold). Every change +is therefore also read on measures that single pools cannot decide. Paired bootstrap over +pools against `q4j2rs0g` (`research/logs/knn-evaluate-inclusive.log`, +`research/logs/knn-evaluate-inclusive-5Ms.log`, `research/logs/big-pools-S2-compositions.log`): + +| measure | `q4j2rs0g` | + fifth member (S2 30k) | + library branch (four members) | `z3hoccsj` (both) | +|---|---|---|---|---| +| official Hit@1 | 0.7327 | 0.7371, +0.0044 [+0.0003, +0.0089] | 0.7465, +0.0137 [+0.0027, +0.0256] | **0.7481, +0.0154 [+0.0032, +0.0282]** | +| pool-macro Hit@1 (every pool counts once) | 0.8317 | 0.8349, +0.0032 [+0.0000, +0.0065] | 0.8361, +0.0044 [+0.0018, +0.0071] | **0.8379, +0.0062 [+0.0021, +0.0103]** | +| pools gained / lost | - | 23 / 12 | 19 / 4 | 37 / 16 | +| query-weighted Hit@1 without the 20 largest pools | 0.7681 | +0.0050 [+0.0002, +0.0102] | +0.0115 [+0.0010, +0.0225] | +0.0133 [+0.0014, +0.0250] | +| Hit@1 with pool weight min(n, 30) | - | +0.0051 [+0.0002, +0.0104] | +0.0115 [+0.0020, +0.0206] | +0.0133 [+0.0024, +0.0243] | +| fused Hit@1 per spectrum (no pool mean) | 0.5908 | 0.5939, +0.0031 [+0.0007, +0.0053] | 0.5990, +0.0082 [+0.0035, +0.0132] | 0.6012, +0.0104 [+0.0056, +0.0156] | +| Hit@5 / Hit@20 (official) | 0.8565 / 0.9156 | 0.8575 / 0.9158 | 0.8711 / 0.9260 | 0.8744 / 0.9313 | +| domain / other Hit@1 | 0.9072 / 0.5575 | 0.9072 / 0.5664 | - | 0.9089 / 0.5867 | + +**Fifth forward member (E47).** The simulator's weakness on unseen molecules is its +intensity model; the auxiliary loss on the synthetic corpus shows that model seventeen +times more structures. The fork member is the best single simulator so far (per spectrum +0.4910 against 0.4862 for its twin without the term, +0.0048 [-0.0044, +0.0142]; the gain +sits in `[M+H]+` with energy, where the corpus has data), and adding it is a small step +whose pool-level intervals all sit at or above zero. It costs 25 % more simulation time. + +**Library-neighbour branch (E48).** Alone it is a weak ranker (Hit@1 0.168 per spectrum, +0.254 after the pool mean), but it is independent of both models +and helps exactly where they are weakest: spectra without a recorded collision energy and +`[M+Na]+` spectra (other-conditions Hit@1 0.558 -> 0.587). For `[M+H]+` spectra with an +energy the forward model is strong and any library weight was neutral or negative, so its +weight there is 0. Evidence that the gain is spectrum-specific and not a "resembles the +train fold" prior (which the split construction could reward, and which this project +excludes on principle, E21): +- with the neighbours of a *randomly chosen other query* the branch alone scores 0.010 per + spectrum (0.020 after the pool mean), and fused at `u` = 0.25 / 0.5 it changes the + per-spectrum Hit@1 by -0.0013 / -0.0051, pool-macro by +0.0006 [-0.0006, +0.0018] / + +0.0000 [-0.0021, +0.0021] with 3 / 7 pools gained and 1 / 7 lost, and the official Hit@1 + by +0.0017 [-0.0001, +0.0044] / +0.0027 [-0.0071, +0.0130] + (`research/logs/knn-evaluate-shuffled-debias.log`); the real neighbours give +0.0081 per + spectrum and 12 pools gained / 4 lost at 0.25; +- the prior term removes the spectrum-free "resembles the library" component of the vote. + It also makes the branch better (alone, k = 10, power 3: 0.153 -> 0.171 per spectrum, + 0.204 -> 0.253 after the pool mean) and the control tighter (without it: official +0.0037 + [-0.0031, +0.0115] at 0.25 and -0.0116 [-0.0338, +0.0041] at 0.5). + +Weight plateau (four released members + library, `u` for other conditions): 0.25 -> 0.7416, +0.35 -> 0.7442, **0.4 -> 0.7465**, 0.45 -> 0.7466, 0.5 -> 0.7483, 0.6 -> 0.7435, 0.65 -> +0.7345, 0.8 -> 0.7302; pool-macro +0.0024 / +0.0038 / +0.0044 / +0.0038 / +0.0044 / +0.0032 +for 0.25 ... 0.6. With five members the official value falls from 0.7486 at 0.45 to 0.7445 +at 0.5 because two more pools (about 80 spectra net) become misses, while pool-macro stays +flat (0.8385 / 0.8382). 0.4 was chosen as an interior point of the plateau, not as its +maximum. + +**What is and is not shown.** Pool-macro, the trimmed and the capped measure and the +per-spectrum score all move in the same direction with intervals above zero, for each +change and for both together; the official difference (+0.0154) rests partly on large +pools and its interval nearly reaches zero. The library settings were chosen among more +than a hundred on this fold; the neighbouring settings (k 10-32, power 3-10, weight +0.25-0.5) give +0.007 to +0.016 on the official measure and +0.002 to +0.005 pool-macro, +so we expect a real but smaller gain on unseen data. Test molecules may have fewer close analogues in the +train fold than validation molecules do, or more; this was not and cannot be measured +here. + +How the numbers of this release were produced: the packaged `infer.py` of this exact build +ran the complete inverse branch (both networks), the library branch (neighbour search over +the packaged library included), the intact-ion term, the matched scoring of all five +members, the fusion and the consensus term on the full fold as one input, taking the +forward simulations of the five members from their saved full-fold prediction files +(`--load-predictions`; 275 s; `research/logs/fullfold-5Ms-I9b+I13-L-ion-net-saved-simulations.log`), +and the official scorer produced the released row and the paired difference against the +rankings of the same run of the previous build. Agreement with the analysis code on the +full fold (`research/logs/consensus-equivalence-5Ms-I9b+I13-L-ion-net.log`): forward, +inverse, library and intact-ion outputs of this run equal to those of the previous build's +run (difference 0); consensus term - 19,428 queries covered on both sides (one spectrum +has similarity 0 to every other pool), largest absolute difference 4.4e-16; rank of +the label in the package's rankings equal to the analysis value for 19,429 / 19,429 +queries (hence 0.8022 / 0.8719 / 0.9164 on both sides). +End-to-end replays of this build (forward simulation included) from a read-only copy +outside the workspace with an `env -i` environment and a free GPU, each with exit status 0, +0 unscored queries, unchanged file hashes of the copy (283 files) and no process left +behind. (Six analysis and check scripts under `training/` were added or updated after these +replays; no file that inference reads changed, and the published copy was replayed again, +see `EXPERIMENTS.md` E65.) Because the term depends on the input, a replay on a subset is compared with the +analysis code run on **the same subset** (`research/logs/consensus-subset-5Ms-I9b+I13-L-ion-net.log`), +not with the full-fold run: +- `val-tiny` (180 queries, 40 complete pools; + `research/logs/replay-5Ms-I9b+I13-L-ion-net-val-tiny.log`): 180 / 180 rankings, 83 s wall, + 2.55 GiB peak resident memory; the term scored 168 queries; label rank equal to the + analysis value for 180 / 180; top candidate equal to the previous build's replay for + 180 / 180, top five for 154 (Hit@1 / 5 / 20 unchanged: 0.8833 / 0.9111 / 0.9889). +- edge-case input (24 hand-built queries: single candidate, 256 candidates, duplicate, + unparsable, charged and unsupported candidates, missing metadata, adducts outside the + supported two, empty and one-peak spectra, added to 180 validation queries; + `research/logs/replay-5Ms-I9b+I13-L-ion-net-edge.log`): 204 / 204 complete rankings, 91 s + wall, 2.58 GiB peak resident memory; the term scored 186 queries in 44 pools and left + the rest (spectra without a fragment peak shared with another pool, unscorable queries) + as they were; top candidate equal to the previous build's replay for 202 / 204. +- `val-sub` (2,147 queries, 413 complete pools, 295,422 simulations x 5 members; + `research/logs/replay-5Ms-I9b+I13-L-ion-net-val-sub.log`): 2,147 / 2,147 rankings, 693 s + wall, 3.45 GiB peak resident memory; label rank equal to the analysis value on the same + subset for 2,147 / 2,147; official scorer on the subset: Hit@1 0.7592 (0.6585 - 0.8557), + Hit@5 0.8398, Hit@20 0.8961 (`research/logs/replay-5Ms-I9b+I13-L-ion-net-val-sub.report.json`; + previous release on the same subset: 0.7718 / 0.8407 / 0.8840, paired difference + **-0.0126 [-0.0379, +0.0028]**; pool-macro 0.8862 on both sides, 4 pools gained and 4 + lost - see "It depends on the input set"). + +**Not run:** an end-to-end replay on the full fold with all simulations recomputed (about +1.3 h of the single GPU; the simulation code and the forward weights are those of the +previous releases, whose four-member path was replayed in E45). + +## Limits + +- Non-domain conditions (`[M+Na]+`, missing collision energy; half of the validation queries) + remain much weaker than the stock GLACIER domain (0.667 vs 0.936). The largest single + class of misses is still Orbitrap pools of many `[M+H]+` / `[M+Na]+` spectra without a + recorded energy and with few peaks per spectrum (E33). On unseen molecules the simulator's + intensity model is the weak part (E42 d). +- The validation estimate depends on a few very large pools (47 % of validation queries sit + in pools with >= 16 spectra and are hit or missed as a whole; one pool is 2.8 % of the + fold); the molecule-group interval is wide (0.745 - 0.847), and member sets, the ensemble + rule, the fusion constants, the inverse score, the inverse training recipe, the + intact-ion weights, the consensus settings and the library settings were chosen inside + that noise. +- **The rankings of an input are computed jointly, and the gain of this release needs a + large input.** The consensus term uses the spectra and current answers of the other + pools of the same input. A query is ranked differently when the input is split, + reduced or extended; the validation estimate applies to an input like the validation + fold given in one call. On shares of the fold the pool-macro gain shrinks from +0.015 + to +0.011 (50 %), +0.007 / +0.013 (25 %) and +0.003 / +0.006 (10 %), and on the 12 % + subset `val-sub` the official Hit@1 is 0.013 **lower** than without the term (one pool + of 22 spectra). How many related molecules the test fold holds per input is unknown. +- The consensus term propagates the package's own guesses. It makes the answers for + related spectra agree with each other; where the models are wrong about related pools + in the same way it reinforces the error, and it turned 33 validation pools that were + right into misses (83 the other way). It reorders pools whose first candidates are + nearly tied, and no measured quantity (own margin, neighbour similarity, neighbour + confidence) tells its gains from its losses, so it has no confidence gate. Hit@5 and + Hit@20 per query are lower than in the previous release because of one very large + pool. Its official gain varies by +/- 0.015 between equivalent settings. Pools whose + targets share a 2D structure with another pool's target (354 of 3,386 on validation) + gain at about five times the rate of the others (32 of 354 against 51 of 3,032); a + fold without such pools would gain less. + The search among the input spectra is quadratic in their number (8.5 s for 19,429). +- The library branch depends on the train fold containing structural analogues of the + query molecule with similar spectra. Where it has none, its vote is diffuse and, after + the prior correction, close to uninformative; it cannot identify a molecule by itself. Its + weight is a constant; a confidence-dependent weight was not explored. +- The inverse networks are trained mostly on simulated spectra, half of them simulated by + this package's own forward members. They therefore inherit what those simulators get + wrong, and the two branches are less independent than their architectures suggest. Their + gain over the earlier networks lies entirely below 700 m/z; heavy molecules (31 % of + the validation queries, 4 % of the corpus rows) did not improve, and adding generated + heavy structures to the training data made it worse (E61). The two networks differ only + in their seed, and one retrained network moves the fused Hit@1 by about +/- 0.003 + (E63). Three of the five forward members share run B's first 20,000 steps. +- The intact-ion term can only tell formulae apart. It is silent when the spectrum does + not contain the unfragmented ion (60 % of the validation queries have no candidate + with a peak at its ion mass) and it never separates isomers, which are the bulk of the + remaining errors: with perfect formula knowledge release `2neva96r` would gain 2.6 + points, the term gains about 0.7 (E64). A fragment or noise peak that happens to lie at + a wrong candidate's ion mass counts for that candidate; the small weights bound the + damage. Its error model has one row per coarse acquisition class; instruments or + calibrations unlike the train fold's would be scored with the wrong width. +- Candidates that RDKit cannot parse, contain unsupported elements or have more than 100 + heavy atoms get forward distance 1; elements outside + `C N P O S Si I H Cl F Br B Se Fe Co As Na K` get inverse distance 1. A candidate without + a fingerprint has library distance 0 (no vote, no prior); queries with an adduct other + than `[M+H]+` / `[M+Na]+` get no inverse, no library and no intact-ion term (they do get + the consensus term when their spectrum resembles another pool's). +- The reported `precursor_mz` field is used by the forward scoring view and by the library vectors to + separate fragment peaks from the precursor region, and by the library's neutral-loss view + (`precursor_mz - m/z` of the *query's own* peaks, compared with library spectra; it is + never compared with a candidate's mass); the consensus term compares the same two + vectors between spectra of the input. A mass-error term on that field was evaluated + (E21) and deliberately **not** enabled: for a large part of the benchmark the field is + not a measurement but a value computed from the reference formula (in the train fold it + equals the label's theoretical ion mass within 0.05 mDa for 96 % of the Orbitrap + `[M+H]+` spectra with an energy). The inverse branch and the intact-ion term do not + read the field. The intact-ion term compares candidate masses with *peaks of the + spectrum*, whose errors in the same class are Gaussian with a width of 0.7 - 1.5 ppm, + as measured values are; one small class (365 train spectra, `[M+Na]+` Orbitrap with + four-decimal peak lists) looks recalibrated (0.1 ppm) and is not treated differently. +- The same fixed weights and library handle every query; acquisition metadata (adduct, + presence of a collision energy) and the number of spectra per pool select the fusion + weights; the other queries of the input enter through the pool mean and the consensus + term; candidate order, labels and popularity are never read. + +## Runtime + +`/opt/glacier/bin/python` (override with `MASSSPECGYM_GLACIER_PYTHON`), one GPU, <= 14 CPU +workers, no network, no writes inside the package. Forward branch: every candidate is +featurized once and simulated by all five members; the simulation is GPU-bound and linear +in the number of members (about 2,850 simulations / s per member on an H100, E45). +Everything else on the full validation fold with the five members' simulations loaded from +disk, 13 workers, free GPU and cores: 275 s for this build (canonicalization and planning +82 s, candidate store with fingerprints 60 s, intact-ion term 0.7 s, library branch 88 s +of which the neighbour search on the CPU 84 s, inverse branch with two networks 23 s, +scoring 40 s of which the consensus term 17 s - the search among the 19,429 input +spectra 8.5 s on the CPU, quadratic in their number, the rest on the GPU). End to end +with 13 workers on a free GPU: `val-tiny` (180 queries, 29,258 simulations x 5 members) +83 s; `val-sub` (2,147 queries, 295,422 simulations x 5 members) 693 s, the simulation +at about 570 - 610 candidates / s for the five members. +**Expected total for a fold of +the size of validation or test on a free H100: about 4,200 - 4,500 s of simulation (2.54 M +candidates x 5 members) plus about 300 s; about 8,500 s if every pool had 256 candidates; +inside the 18,000 s limit; not measured end to end on a full fold.** Host memory, measured +on the full validation fold: 11.3 GiB peak resident in the largest process (the neighbour +search holds a dense 400 x 194,119 similarity block per chunk); the annotation workers are +forks of about 1.7 GiB each (mostly shared pages). + +## Files + +`infer.sh`, `infer.py`, `fastfeat.py` (compact featurization, tensor-equal to the stock one), +`inverse.py` (formula annotation, `FormulaFormer`), `invrun.py` (inference-side candidate +store, pooled scoring and the ensemble score), `library.py` (library-neighbour branch), +`ionterm.py` (measured intact-ion term), `consensus.py` (cross-pool consensus term), `model.pt`, +`model_config.json`, `model_manifest.json`, `vendor/ms_pred` (+ `LICENSE.ms-pred`), +`training/` (training, preparation, publication and analysis source used for this release; +`training/inv/` holds the inverse-branch preparation and training code, +`training/build_library.py` builds the library, `training/analysis/ion_fit.py` fits the +intact-ion table, `training/analysis/netprop.py` is the analysis twin of `consensus.py`, +`training/checks/consensus_equivalence.py` and `training/checks/consensus_subset.py` compare the two). Experiment records: `EXPERIMENTS.md` and +`research/` at the package root. diff --git a/shared/package-files/02/02e22165c14c18c26dc4e667df6b72ae05e25e8e6d03c40a6d57bd494cdcf7be/eval-B20k-full.log b/shared/package-files/02/02e22165c14c18c26dc4e667df6b72ae05e25e8e6d03c40a6d57bd494cdcf7be/eval-B20k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..182126302f9fa945ebe83a6bf53754030febcf2b --- /dev/null +++ b/shared/package-files/02/02e22165c14c18c26dc4e667df6b72ae05e25e8e6d03c40a6d57bd494cdcf7be/eval-B20k-full.log @@ -0,0 +1,46 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 1, "workers": 10} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 48.231754455016926} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 51.98929439694621} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 2540748, "seconds": 24.158835588023067, "per_second": 2649.1342998223186} +{"event": "simulating", "finished": 128000, "total": 2540748, "seconds": 48.751134573016316, "per_second": 2625.5799197511974} +{"event": "simulating", "finished": 192000, "total": 2540748, "seconds": 73.58149613102432, "per_second": 2609.351672574195} +{"event": "simulating", "finished": 256000, "total": 2540748, "seconds": 99.0789154060185, "per_second": 2583.7989742916525} +{"event": "simulating", "finished": 320000, "total": 2540748, "seconds": 124.20486578694545, "per_second": 2576.3885977616314} +{"event": "simulating", "finished": 384000, "total": 2540748, "seconds": 150.48657677404117, "per_second": 2551.722606971014} +{"event": "simulating", "finished": 448000, "total": 2540748, "seconds": 176.97835340397432, "per_second": 2531.3830272642795} +{"event": "simulating", "finished": 512000, "total": 2540748, "seconds": 203.64012294402346, "per_second": 2514.2392992010637} +{"event": "simulating", "finished": 576000, "total": 2540748, "seconds": 230.37769684498198, "per_second": 2500.2420281490295} +{"event": "simulating", "finished": 640000, "total": 2540748, "seconds": 258.02300963702146, "per_second": 2480.398941553048} +{"event": "simulating", "finished": 704000, "total": 2540748, "seconds": 285.7100758929737, "per_second": 2464.0363060339414} +{"event": "simulating", "finished": 768000, "total": 2540748, "seconds": 313.4523886559764, "per_second": 2450.1328680028137} +{"event": "simulating", "finished": 832000, "total": 2540748, "seconds": 344.3926244720351, "per_second": 2415.847323314437} +{"event": "simulating", "finished": 896000, "total": 2540748, "seconds": 376.2079226929927, "per_second": 2381.6616981008865} +{"event": "simulating", "finished": 960000, "total": 2540748, "seconds": 409.0585126889637, "per_second": 2346.852516744851} +{"event": "simulating", "finished": 1024000, "total": 2540748, "seconds": 442.13302081800066, "per_second": 2316.0450628760404} +{"event": "simulating", "finished": 1088000, "total": 2540748, "seconds": 483.54239341197535, "per_second": 2250.0612455566647} +{"event": "simulating", "finished": 1152000, "total": 2540748, "seconds": 516.9897756719729, "per_second": 2228.283912390054} +{"event": "simulating", "finished": 1216000, "total": 2540748, "seconds": 551.7442788479384, "per_second": 2203.9195450092407} +{"event": "simulating", "finished": 1280000, "total": 2540748, "seconds": 586.4333885329543, "per_second": 2182.6860902345625} +{"event": "simulating", "finished": 1344000, "total": 2540748, "seconds": 621.3682895880193, "per_second": 2162.9684400069746} +{"event": "simulating", "finished": 1408000, "total": 2540748, "seconds": 656.7500967340311, "per_second": 2143.890053464595} +{"event": "simulating", "finished": 1472000, "total": 2540748, "seconds": 700.5790453079389, "per_second": 2101.1190812208542} +{"event": "simulating", "finished": 1536000, "total": 2540748, "seconds": 745.8193566090195, "per_second": 2059.4799349049567} +{"event": "simulating", "finished": 1600000, "total": 2540748, "seconds": 790.7821758339414, "per_second": 2023.3131814240442} +{"event": "simulating", "finished": 1664000, "total": 2540748, "seconds": 835.409213457955, "per_second": 1991.8382191552723} +{"event": "simulating", "finished": 1728000, "total": 2540748, "seconds": 879.566202841932, "per_second": 1964.6048181668723} +{"event": "simulating", "finished": 1792000, "total": 2540748, "seconds": 925.4029563890072, "per_second": 1936.4537228112179} +{"event": "simulating", "finished": 1856000, "total": 2540748, "seconds": 972.9094944569515, "per_second": 1907.680016049142} +{"event": "simulating", "finished": 1920000, "total": 2540748, "seconds": 1013.1857419300359, "per_second": 1895.0128496109285} +{"event": "simulating", "finished": 1984000, "total": 2540748, "seconds": 1050.8312781680143, "per_second": 1888.0290691944786} +{"event": "simulating", "finished": 2048000, "total": 2540748, "seconds": 1090.3098243100103, "per_second": 1878.365171382412} +{"event": "simulating", "finished": 2112000, "total": 2540748, "seconds": 1133.004313374986, "per_second": 1864.070573313872} +{"event": "simulating", "finished": 2176000, "total": 2540748, "seconds": 1177.1751603509765, "per_second": 1848.4929628919645} +{"event": "simulating", "finished": 2240000, "total": 2540748, "seconds": 1223.5975633299677, "per_second": 1830.6672611409401} +{"event": "simulating", "finished": 2304000, "total": 2540748, "seconds": 1274.7570431040367, "per_second": 1807.403232218866} +{"event": "simulating", "finished": 2368000, "total": 2540748, "seconds": 1332.9381146249361, "per_second": 1776.5265874074814} +{"event": "simulating", "finished": 2432000, "total": 2540748, "seconds": 1399.4259619029472, "per_second": 1737.8554251580076} +{"event": "simulating", "finished": 2496000, "total": 2540748, "seconds": 1474.3166161800036, "per_second": 1692.9877697961563} +{"event": "simulated", "finished": 2540748, "total": 2540748, "failed": 0, "seconds": 1534.2023890169803} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 20.097601677989587, "total_seconds": 1620.591543680057} diff --git a/shared/package-files/05/050a2c53b05a8dee5389304040637bfd0815ff592a19e11f4a34387feade887a/fwd_union.py b/shared/package-files/05/050a2c53b05a8dee5389304040637bfd0815ff592a19e11f4a34387feade887a/fwd_union.py new file mode 100644 index 0000000000000000000000000000000000000000..d81823658e0b7b272aafcea975b0b11361ed7ac0 --- /dev/null +++ b/shared/package-files/05/050a2c53b05a8dee5389304040637bfd0815ff592a19e11f4a34387feade887a/fwd_union.py @@ -0,0 +1,86 @@ +"""Forward branch scored against union spectra (lab, E74; labels evaluate only) + +fwd_union.py --variants NAME=DOMAIN/OTHER/MAXPEAKS[,NAME=...] [--sims evals/stack/5M-S2-30k] + [--base-pred evals/fullfold/5Ms-N5u48-L-ion-net2/pred] [--min-group 3] + +E72 gave the inverse branch the union of the spectra of a pool that share an adduct and a condition +class. Here the same union replaces the *observed* spectrum of the forward comparison: every query of +a merged group is scored against the simulation of its own condition, but the observed side is the +union spectrum of the group (``invrun.merged_queries``; DOMAIN / OTHER = ``none`` or ``agg:tol_mda`` +with agg in mean | sqrt | freq). MAXPEAKS = observed peaks kept (released: 50). + +Writes ``evals/fullfold/swap-fwd-NAME/pred`` (new ``distances.pkl``; inverse / library / ion linked +from ``--base-pred``) for the full-rule comparison (``netprop.py evaluate``, ``inv_swap.py compare``) +and prints the forward branch alone (pool mean) against the released forward distances. +Nothing is fitted; no label is read except by the evaluator. +""" +import argparse +import json +import os +import pickle +import sys +import time +from pathlib import Path + +import numpy as np +import torch + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import scorelab +import infer +import invrun + +ROOT = Path('/workspace/research') + + +def spec(text): + if text == 'none': + return None + agg, tol = text.split(':') + return {'agg': agg, 'tol_mda': float(tol)} + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--variants', required=True) + p.add_argument('--sims', default='evals/stack/5M-S2-30k') + p.add_argument('--base-pred', default='evals/fullfold/5Ms-N5u48-L-ion-net2/pred') + p.add_argument('--config', default='builds/5Ms-N5u48-L-ion-net2/model_config.json') + p.add_argument('--min-group', type=int, default=3) + args = p.parse_args() + config = json.load(open(ROOT / args.config)) + queries, pools, plan, masses, intens, done = scorelab.load(ROOT / 'validation-input', [ROOT / args.sims]) + ev = scorelab.Evaluator(queries, pools) + device = torch.device('cuda') + base = pickle.load(open(ROOT / args.base_pred / 'distances.pkl', 'rb')) + base_rank = ev.ranks([base[q['query_id']] for q in queries], 1.0) + first = np.array([m[0] for m in ev.by_pool.values()]) + print(ev.line('released forward distances', base_rank), f'macro={np.mean(base_rank[first] == 0):.4f}', flush=True) + for item in args.variants.split(','): + name, body = item.split('=') + dom, oth, peaks = body.split('/') + options = {'min_group': args.min_group, 'domain': spec(dom), 'other': spec(oth)} + tick = time.monotonic() + merged, count = invrun.merged_queries(queries, options) if (options['domain'] or options['other']) else (queries, 0) + plan.queries = merged + c = dict(config, max_observed_peaks=int(peaks)) + dist = infer.score_queries(plan, masses, intens, done, c, device) + plan.queries = queries + rank = ev.ranks(dist, 1.0) + d = (rank[first] == 0).astype(float) - (base_rank[first] == 0).astype(float) + macro = d[ev.boot].mean(axis=1) + print(ev.line(name, rank, base_rank), f'macro={np.mean(rank[first] == 0):.4f} ({d.mean():+.4f} [{np.percentile(macro, 2.5):+.4f}, {np.percentile(macro, 97.5):+.4f}]) ' + f'pools +{int((d > 0).sum())} -{int((d < 0).sum())} merged={count} seconds={time.monotonic() - tick:.0f}', flush=True) + target = ROOT / 'evals' / 'fullfold' / f'swap-fwd-{name}' / 'pred' + target.mkdir(parents=True, exist_ok=True) + for other in ('inverse', 'library', 'ion'): + link = target / f'{other}.pkl' + if not link.exists(): + os.symlink((ROOT / args.base_pred / f'{other}.pkl').resolve(), link) + tmp = target / 'distances.pkl.tmp' + pickle.dump({q['query_id']: x for q, x in zip(queries, dist)}, open(tmp, 'wb')) + os.replace(tmp, target / 'distances.pkl') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/05/054826ce4b15b2f623c7931654585b23a76b80659fa048be489141959a39d0f5/big-pools-B45a.log b/shared/package-files/05/054826ce4b15b2f623c7931654585b23a76b80659fa048be489141959a39d0f5/big-pools-B45a.log new file mode 100644 index 0000000000000000000000000000000000000000..9bfc6f86098b9e6e985cec7b6fd9343791dd1f84 --- /dev/null +++ b/shared/package-files/05/054826ce4b15b2f623c7931654585b23a76b80659fa048be489141959a39d0f5/big-pools-B45a.log @@ -0,0 +1,23 @@ +cumulative share of queries in the largest pools: top1=0.028 top2=0.037 top5=0.058 top10=0.077 top20=0.112 top50=0.190 top100=0.287 + size share dom orbi Na | released rel-fwd inv 4M 4M-fwd 4M+B45a 4M+B45a-fwd B45a-for-B3 B45a-for-B3 B20k+B45a B20k+B45a-f relM relM-fwd + 542 0.028 0.00 1.00 0.79 | 0 0 88 4 4 3 4 4 4 0 0 0 0 + 179 0.009 0.00 1.00 1.00 | 6 3 43 0 4 0 4 3 10 3 5 2 2 + 157 0.008 0.01 0.99 0.57 | 14 15 3 15 15 15 17 14 15 9 11 14 17 +query-weighted Hit@1 without the 5 largest pools: released=0.7408 rel-fwd=0.6511 inv=0.5321 4M=0.7534 4M-fwd=0.6722 4M+B45a=0.7526 4M+B45a-fwd=0.6737 B45a-for-B30k=0.7535 B45a-for-B30k-fwd=0.6706 B20k+B45a=0.7493 B20k+B45a-fwd=0.6654 relM=0.7446 relM-fwd=0.6683 +query-weighted Hit@1 without the 10 largest pools: released=0.7439 rel-fwd=0.6566 inv=0.5352 4M=0.7568 4M-fwd=0.6782 4M+B45a=0.7559 4M+B45a-fwd=0.6797 B45a-for-B30k=0.7569 B45a-for-B30k-fwd=0.6765 B20k+B45a=0.7526 B20k+B45a-fwd=0.6712 relM=0.7478 relM-fwd=0.6742 +query-weighted Hit@1 without the 20 largest pools: released=0.7535 rel-fwd=0.6706 inv=0.5367 4M=0.7669 4M-fwd=0.6930 4M+B45a=0.7660 4M+B45a-fwd=0.6946 B45a-for-B30k=0.7670 B45a-for-B30k-fwd=0.6913 B20k+B45a=0.7626 B20k+B45a-fwd=0.6858 relM=0.7575 relM-fwd=0.6889 +query-weighted Hit@1 without the 50 largest pools: released=0.7659 rel-fwd=0.6842 inv=0.5472 4M=0.7806 4M-fwd=0.7056 4M+B45a=0.7796 4M+B45a-fwd=0.7074 B45a-for-B30k=0.7808 B45a-for-B30k-fwd=0.7037 B20k+B45a=0.7759 B20k+B45a-fwd=0.6977 relM=0.7735 relM-fwd=0.7011 +query-weighted Hit@1 (all pools): released=0.7384 rel-fwd=0.6539 inv=0.5139 4M=0.7316 4M-fwd=0.6459 4M+B45a=0.7308 4M+B45a-fwd=0.6473 B45a-for-B30k=0.7225 B45a-for-B30k-fwd=0.6444 B20k+B45a=0.7465 B20k+B45a-fwd=0.6674 relM=0.7420 relM-fwd=0.6701 +pool-macro Hit@1: released=0.8210 rel-fwd=0.7519 inv=0.5898 4M=0.8290 4M-fwd=0.7688 4M+B45a=0.8320 4M+B45a-fwd=0.7738 B45a-for-B30k=0.8308 B45a-for-B30k-fwd=0.7723 B20k+B45a=0.8284 B20k+B45a-fwd=0.7652 relM=0.8234 relM-fwd=0.7628 + released vs 4M: pools +53 -80 | macro -0.0080 [-0.0148,-0.0012] | without top 20 -0.0134 [-0.0301,+0.0024] | pool weight min(n,30) -0.0134 [-0.0295,+0.0013] | query-weighted +0.0068 [-0.0407,+0.0683] + rel-fwd vs 4M: pools +75 -336 | macro -0.0771 [-0.0883,-0.0647] | without top 20 -0.0962 [-0.1180,-0.0740] | pool weight min(n,30) -0.0979 [-0.1192,-0.0760] | query-weighted -0.0777 [-0.1302,-0.0093] + inv vs 4M: pools +63 -873 | macro -0.2392 [-0.2552,-0.2236] | without top 20 -0.2301 [-0.2604,-0.1996] | pool weight min(n,30) -0.2265 [-0.2530,-0.2005] | query-weighted -0.2177 [-0.2528,-0.1843] + 4M-fwd vs 4M: pools +65 -269 | macro -0.0602 [-0.0706,-0.0496] | without top 20 -0.0739 [-0.0927,-0.0558] | pool weight min(n,30) -0.0779 [-0.0963,-0.0601] | query-weighted -0.0857 [-0.1122,-0.0619] + 4M+B45a vs 4M: pools +25 -15 | macro +0.0030 [-0.0006,+0.0065] | without top 20 -0.0009 [-0.0068,+0.0052] | pool weight min(n,30) -0.0009 [-0.0069,+0.0053] | query-weighted -0.0008 [-0.0060,+0.0046] +4M+B45a-fwd vs 4M: pools +69 -256 | macro -0.0552 [-0.0662,-0.0452] | without top 20 -0.0722 [-0.0922,-0.0539] | pool weight min(n,30) -0.0769 [-0.0953,-0.0598] | query-weighted -0.0843 [-0.1115,-0.0612] +B45a-for-B30k vs 4M: pools +34 -28 | macro +0.0018 [-0.0030,+0.0062] | without top 20 +0.0002 [-0.0075,+0.0076] | pool weight min(n,30) -0.0014 [-0.0100,+0.0067] | query-weighted -0.0091 [-0.0308,+0.0054] +B45a-for-B30k-fwd vs 4M: pools +72 -264 | macro -0.0567 [-0.0670,-0.0464] | without top 20 -0.0756 [-0.0951,-0.0564] | pool weight min(n,30) -0.0800 [-0.0989,-0.0615] | query-weighted -0.0872 [-0.1145,-0.0637] + B20k+B45a vs 4M: pools +54 -56 | macro -0.0006 [-0.0068,+0.0056] | without top 20 -0.0043 [-0.0161,+0.0083] | pool weight min(n,30) -0.0041 [-0.0170,+0.0090] | query-weighted +0.0149 [-0.0308,+0.0757] +B20k+B45a-fwd vs 4M: pools +77 -293 | macro -0.0638 [-0.0747,-0.0529] | without top 20 -0.0811 [-0.1016,-0.0621] | pool weight min(n,30) -0.0839 [-0.1037,-0.0658] | query-weighted -0.0642 [-0.1158,+0.0021] + relM vs 4M: pools +41 -60 | macro -0.0056 [-0.0115,+0.0003] | without top 20 -0.0093 [-0.0214,+0.0025] | pool weight min(n,30) -0.0081 [-0.0204,+0.0040] | query-weighted +0.0104 [-0.0354,+0.0711] + relM-fwd vs 4M: pools +81 -305 | macro -0.0662 [-0.0771,-0.0546] | without top 20 -0.0780 [-0.0977,-0.0586] | pool weight min(n,30) -0.0804 [-0.0994,-0.0611] | query-weighted -0.0615 [-0.1122,+0.0045] diff --git a/shared/package-files/05/0559700ae3f45d2fe8f3939bf6cdea2e50d015c80c0d704eea6e263bf7b6232e/library_hybrid.py b/shared/package-files/05/0559700ae3f45d2fe8f3939bf6cdea2e50d015c80c0d704eea6e263bf7b6232e/library_hybrid.py new file mode 100644 index 0000000000000000000000000000000000000000..590951edc91d30cc6c071997911d3075a6ed7fe6 --- /dev/null +++ b/shared/package-files/05/0559700ae3f45d2fe8f3939bf6cdea2e50d015c80c0d704eea6e263bf7b6232e/library_hybrid.py @@ -0,0 +1,113 @@ +"""Library neighbours chosen by spectrum AND by the inverse prediction (lab, E71; labels evaluate only) + +library_hybrid.py [--powers 0,1,2,4] [--k 20] + +The released library branch lets the 20 train molecules with the most similar spectra vote +(``s^6``). ``library_oracle.py``: their structures are nearly unrelated to the label. Here a +library molecule's weight is ``s(q, m)^6 * a(q, m)^r`` with ``a`` = cosine between the pool's +inverse prediction (``evals/netprop/inv-vectors.npz``: pool mean of the released E64 inverse pair) and +the molecule's fingerprint; the k heaviest molecules vote as in ``pkg/library.py`` (debiased). +r = 0 is the released branch. Reported: label Tanimoto of the voters (diagnostic), the branch alone, and +the released rule (no consensus term) with the new term in place of the library term. +""" +import argparse +import json +import pickle +import sys +from pathlib import Path + +import numpy as np +import torch + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import netprop +import scorelab + +ROOT = netprop.ROOT + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--powers', default='0,1,2,4') + p.add_argument('--k', type=int, default=20) + p.add_argument('--spower', type=float, default=6.0) + p.add_argument('--pred', default='evals/fullfold/5Ms-N5-L-ion-net2/pred') + p.add_argument('--config', default='builds/5Ms-N5-L-ion-net2/model_config.json') + p.add_argument('--weights', default='0/0.4,0/0.8,0.2/0.4') + p.add_argument('--threads', type=int, default=8) + args = p.parse_args() + torch.set_num_threads(args.threads) + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + lib = torch.load(ROOT / 'library/train-library.pt', weights_only=False) + packed_lib = lib['fingerprints'].numpy() + fps = torch.from_numpy(np.unpackbits(packed_lib, axis=1).astype(np.float32)) + fsum = fps.sum(1) + sample = fps[lib['prior_sample'].numpy()] + sim = np.load(ROOT / 'evals/library/sim-full.npy') + vec = np.load(ROOT / 'evals/netprop/inv-vectors.npz', allow_pickle=True) + vslot = {pid: n for n, pid in enumerate(vec['pool_id'])} + vectors, have = vec['vectors'].astype(np.float32), vec['have'] + store = np.load(ROOT / 'inv/pools-validation-input.npz') + sslot = {pid: n for n, pid in enumerate(store['pool_id'])} + starts, packed = store['pool_cand_start'], store['cand_fps'] + members = {} + for i, q in enumerate(queries): + members.setdefault(q['candidate_pool_id'], []).append(i) + powers = [float(x) for x in args.powers.split(',')] + terms = {r: {} for r in powers} + stat = {r: np.zeros((len(queries), 2)) for r in powers} + + def tanimoto(a, b, bsum): + inter = a @ b.T + return inter / (a.sum(1)[:, None] + bsum[None, :] - inter).clamp_min(1.0) + + for pid, rows in members.items(): + s = sslot[pid] + cand = torch.from_numpy(np.unpackbits(packed[starts[s]:starts[s + 1]], axis=1).astype(np.float32)) + v = torch.from_numpy(vectors[vslot[pid]]) + agree = (fps @ v) / (fsum.sqrt() * v.norm()).clamp_min(1e-6) if have[vslot[pid]] else torch.ones(len(fps)) + base = torch.from_numpy(np.maximum(sim[rows], 0.0).astype(np.float64)) ** args.spower # [R, M] + prior = tanimoto(cand, sample, sample.sum(1)).double().mean(1) + label = cand[int(ev.target[rows[0]])][None, :] + for r in powers: + w = base * (agree.double() ** r)[None, :] if r > 0 else base + wv, wi = torch.topk(w, args.k, dim=1) # [R, k] + used, position = np.unique(wi.numpy(), return_inverse=True) + position = torch.from_numpy(position.reshape(len(rows), -1)) + local = tanimoto(cand, fps[used], fsum[used]).double() # [C, used] + scale = wv / wv.sum(1, keepdim=True).clamp_min(1e-300) + score = torch.einsum('cqk,qk->qc', local[:, position], scale) - prior[None, :] + tl = tanimoto(label, fps[used], fsum[used]).double()[0][position] # [R, k] label Tanimoto of the voters + for n, i in enumerate(rows): + terms[r][queries[i]['query_id']] = -score[n].numpy() + stat[r][i] = (float(tl[n, 0]), float((scale[n] * tl[n]).sum())) + config = json.load(open(ROOT / args.config)) + pred = {name: pickle.load(open(ROOT / args.pred / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion')} + dom = ev.domain + first = np.array([m[0] for m in ev.by_pool.values()]) + sizes, boot = ev.sizes, ev.boot + hb = ev.ranks(netprop.released(queries, pools, pred, config), 1.0) == 0 + print(f'released rule without consensus: Hit@1 {hb.mean():.4f} domain {hb[dom].mean():.4f} other {hb[~dom].mean():.4f} macro {hb[first].mean():.4f}') + for r in powers: + term = [terms[r][q['query_id']] for q in queries] + single, pooled = ev.ranks(term, 0.0) == 0, ev.ranks(term, 1.0) == 0 + print(f'r {r:g}: label Tanimoto of the heaviest voter {stat[r][:, 0].mean():.3f} (domain {stat[r][dom, 0].mean():.3f} other {stat[r][~dom, 0].mean():.3f}), ' + f'weighted {stat[r][:, 1].mean():.3f} | alone per spectrum {single.mean():.4f} pool mean {pooled.mean():.4f} ({pooled[dom].mean():.4f} / {pooled[~dom].mean():.4f}) ' + f'macro {pooled[first].mean():.4f}', flush=True) + for w in args.weights.split(','): + wd, wo = (float(x) for x in w.split('/')) + c = json.loads(json.dumps(config)) + c['library'].update(weight_domain=wd, weight_other=wo) + h = ev.ranks(netprop.released(queries, pools, dict(pred, library=terms[r]), c), 1.0) == 0 + d = h[first].astype(float) - hb[first].astype(float) + per_query = np.sum(d[boot] * sizes[boot], axis=1) / np.sum(sizes[boot], axis=1) + macro = d[boot].mean(axis=1) + print(f' library weight {w}: Hit@1 {h.mean():.4f} ({h.mean() - hb.mean():+.4f} [{np.percentile(per_query, 2.5):+.4f}, {np.percentile(per_query, 97.5):+.4f}]) ' + f'macro {h[first].mean():.4f} ({d.mean():+.4f} [{np.percentile(macro, 2.5):+.4f}, {np.percentile(macro, 97.5):+.4f}]) pools +{int((d > 0).sum())} -{int((d < 0).sum())} ' + f'| domain {h[dom].mean():.4f} other {h[~dom].mean():.4f}', flush=True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/05/05ace3abf7b82dc643e601ef503a21d47da830b9ee4c344f308ac6edd44a9caa/swap-I16-w1.0_0.075_0.75.log b/shared/package-files/05/05ace3abf7b82dc643e601ef503a21d47da830b9ee4c344f308ac6edd44a9caa/swap-I16-w1.0_0.075_0.75.log new file mode 100644 index 0000000000000000000000000000000000000000..cfd74b6e914667972bb404e6c3779cc10b817c3d --- /dev/null +++ b/shared/package-files/05/05ace3abf7b82dc643e601ef503a21d47da830b9ee4c344f308ac6edd44a9caa/swap-I16-w1.0_0.075_0.75.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7736 pool-macro 0.8671 Hit@5 0.8776 Hit@20 0.9342 | twin pools 354 (macro 0.7797), others macro 0.8773 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4488 (domain 0.4198 / other 0.4779) macro 0.3810 + lam 1.00/1.00: Hit@1 0.8068 (+0.0332 [+0.0157, +0.0566]) macro +0.0112 [+0.0053, +0.0174] pools +76 -38 | no top 20 +0.0246 cap30 +0.0256 [+0.0131, +0.0391] | Hit@5 -0.0025 macro@5 +0.0071 cap30@5 +0.0156 +without consensus term: Hit@1 0.7736 (ref 0.7713; +0.0023 [-0.0057, +0.0100]) macro 0.8671 (+0.0080 [+0.0027, +0.0133]) pools +60 -33 cap30 +0.0034 | Hit@5 0.8776 (-0.0021) Hit@20 0.9342 (-0.0034) + domain 0.9366 (+0.0052) other 0.6100 (-0.0006) | Orbitrap no energy 0.5718 (-0.0046) | above 850 0.4292 (+0.0147) below 850 0.8521 (-0.0005) +full rule : Hit@1 0.8068 (ref 0.8022; +0.0047 [-0.0091, +0.0179]) macro 0.8783 (+0.0044 [-0.0003, +0.0095]) pools +46 -31 cap30 +0.0045 | Hit@5 0.8751 (+0.0032) Hit@20 0.9102 (-0.0061) + domain 0.9412 (+0.0048) other 0.6719 (+0.0045) | Orbitrap no energy 0.6435 (+0.0032) | above 850 0.5169 (-0.0277) below 850 0.8729 (+0.0121) diff --git a/shared/package-files/10/10b9bb13011b8797a2f52fc1c8493a1d3b2ebb5b32488b4494fdf419aa017e0f/check_contrast.py b/shared/package-files/10/10b9bb13011b8797a2f52fc1c8493a1d3b2ebb5b32488b4494fdf419aa017e0f/check_contrast.py new file mode 100644 index 0000000000000000000000000000000000000000..be8f3d71b1a64a9a5eb025619ff2b0f0cb8c4d9d --- /dev/null +++ b/shared/package-files/10/10b9bb13011b8797a2f52fc1c8493a1d3b2ebb5b32488b4494fdf419aa017e0f/check_contrast.py @@ -0,0 +1,37 @@ +"""Pipeline check of the decoy term: library groups, decoy validity, loss / gradient scale on I3 100k.""" +import sys, json +import numpy as np, torch, torch.nn.functional as F +sys.path.insert(0, '/workspace/research/allcond/pkg'); sys.path.insert(0, '/workspace/research/allcond/inv') +import inverse, invdata, train_inv +dev = torch.device('cuda') +real = invdata.load_padded('/workspace/research/inv/real-train.npz', dev) +synth = invdata.load_padded('/workspace/research/inv/synth.npz', dev) +lib = train_inv.isomer_library(real, synth) +fps, order, start, size = lib +print('library', fps.shape, 'groups ok:', bool((size >= 1).all()), 'max group', int(size.max())) +# group integrity: every member of a molecule's group has the same root +def roots(store): + mol = store['mol'].cpu().numpy(); first = np.full(store['fps'].shape[0], -1, dtype=np.int64) + first[mol[::-1]] = np.arange(len(mol))[::-1]; return store['root'].cpu().numpy()[first] +allroots = torch.from_numpy(np.concatenate([roots(real), roots(synth)])).to(dev) +m = torch.randint(0, fps.shape[0], (4096,), device=dev) +j = order[start[m] + (torch.rand(4096, device=dev) * size[m]).long().minimum(size[m] - 1)] +print('sampled decoys share the formula:', bool((allroots[j] == allroots[m]).all()), '| own index reachable:', bool((order[start[m]:start[m]+1] >= 0).all()) if False else '') +state = torch.load('/workspace/research/runs/I3-ff512x6-real08/step-0100000-ema.pt', map_location=dev, weights_only=True) +model = inverse.FormulaFormer(**state['config']).to(dev); model.load_state_dict(state['ema']); model.train() +gen = torch.Generator(device=dev); gen.manual_seed(5) +for name, store, off in (('real', real, 0), ('synth', synth, real['fps'].shape[0])): + index = torch.randint(0, store['root'].shape[0], (512,), device=dev, generator=gen) + inputs = invdata.batch_of(store, index, dict(peak_drop=0.3, truncate=0.3, min_keep=4, jitter=0.15), gen) + bits = inverse.unpack_bits(store['fps'][store['mol'][index]]) + with torch.autocast('cuda', dtype=torch.bfloat16): + logits = model(*inputs) + bce = F.binary_cross_entropy_with_logits(logits.float(), bits, reduction='none').mean(1).mean() + for tau in (0.02, 0.05, 0.1): + nce, first, has = train_inv.contrast_term(logits, bits, store['mol'][index] + off, lib, 31, tau, gen) + g1 = torch.autograd.grad(bce, [p for p in model.parameters()], retain_graph=True, allow_unused=True) + g2 = torch.autograd.grad(nce.mean(), [p for p in model.parameters()], retain_graph=True, allow_unused=True) + n1 = torch.sqrt(sum((g ** 2).sum() for g in g1 if g is not None)).item() + n2 = torch.sqrt(sum((g ** 2).sum() for g in g2 if g is not None)).item() + print(f'{name} tau {tau}: bce {bce.item():.4f} grad {n1:.4f} | nce {nce[has].mean().item():.3f} (rows with decoys {has.float().mean().item():.3f}, ' + f'target first {first[has].float().mean().item():.3f}) grad {n2:.4f}') diff --git a/shared/package-files/10/10cedb5835d44c186a5e796f82087acb62bcfacfd2dbe67a761783ef82cba0e1/genstruct-x1-build.log b/shared/package-files/10/10cedb5835d44c186a5e796f82087acb62bcfacfd2dbe67a761783ef82cba0e1/genstruct-x1-build.log new file mode 100644 index 0000000000000000000000000000000000000000..74b58d51fba76dc0c09b683231926be50ea24696 --- /dev/null +++ b/shared/package-files/10/10cedb5835d44c186a5e796f82087acb62bcfacfd2dbe67a761783ef82cba0e1/genstruct-x1-build.log @@ -0,0 +1,3 @@ +{"kept": 313651, "tried": 378580, "failed": 36170, "duplicate": 28759, "seconds": 75.76316340314224} +{"kept": 435000, "tried": 562347, "failed": 53815, "duplicate": 44886, "seconds": 112.7075513349846} +{"schema": "allcond-generated-structures/v1", "name": "gen-x1", "structures": 435000, "seed": 0, "heavy_share": 0.5, "heavy_range": "450,1000", "supplied_2d_keys": 456761, "tried": 562347, "failed": 53815, "duplicate": 44886, "mass_percentiles_1_10_50_90_99": [240.0698731385979, 329.113824155818, 512.25358891665, 815.1804832622499, 967.3784052391234], "seconds": 114.15901068598032} diff --git a/shared/package-files/10/10f5c955b4d85e710ebfc7ce8c0795dea9f50553a2ac0b293a47cdc47f638c89/replay-5Ms-N5u48-L-ion-net2-edge2.log b/shared/package-files/10/10f5c955b4d85e710ebfc7ce8c0795dea9f50553a2ac0b293a47cdc47f638c89/replay-5Ms-N5u48-L-ion-net2-edge2.log new file mode 100644 index 0000000000000000000000000000000000000000..1756d537e955efd7cfdbdeeb39d1e11c93dd0a09 --- /dev/null +++ b/shared/package-files/10/10f5c955b4d85e710ebfc7ce8c0795dea9f50553a2ac0b293a47cdc47f638c89/replay-5Ms-N5u48-L-ion-net2-edge2.log @@ -0,0 +1,15 @@ +{"event": "loaded", "queries": 246, "pools": 54, "members": 5, "inverse_members": 5, "library": true, "ion": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 10259, "unsupported": 81, "seconds": 2.0642331360140815} +{"event": "planned", "queries": 246, "groups": 148, "molecules": 12710, "simulations": 34115, "seconds": 2.097684508014936} +{"event": "candidate_store", "pools": 53, "pairs": 10898, "merged_spectra": 215, "seconds": 1.7859268349711783} +{"event": "intact_ion", "scored": 233, "seconds": 0.009296510019339621} +{"event": "library", "scored": 228, "search_seconds": 1.3774798110243864, "seconds": 2.4032499460154213} +{"event": "inverse_annotated", "pools": 53, "pairs": 10898, "formulae": 2194, "unsupported_candidates": 89, "seconds": 5.733902798965573e-05} +{"event": "inverse", "scored": 239, "seconds": 5.373941712954547} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 34115, "total": 34115, "failed": 0, "seconds": 378.610075783974} +{"event": "consensus", "scored": 218, "pools": 53, "answers": 490, "search_seconds": 0.029964572982862592, "seconds": 0.47675299702677876} +{"event": "finished", "queries": 246, "unscored": 0, "directly_scored": 246, "scoring_seconds": 2.1313637019484304, "total_seconds": 409.63333430403145} +{"event": "measured", "exit_code": 0, "wall_seconds": 411.7, "user_seconds": 519.9, "system_seconds": 11.0, "max_rss_gib": 2.78} +{"event": "replay_checked", "exit_code": 0, "package_files": 326, "package_unchanged": true, "processes_left": 0, "rankings": 246} diff --git a/shared/package-files/11/11255895994cbd8d3d04ffdc163c6f8129fa67f150f0963c8d7447a7e75b83a0/netprop-released-sub-0_5-1.log b/shared/package-files/11/11255895994cbd8d3d04ffdc163c6f8129fa67f150f0963c8d7447a7e75b83a0/netprop-released-sub-0_5-1.log new file mode 100644 index 0000000000000000000000000000000000000000..ff4c2cb71ba1fb1ae6da1b88c33a0d1637c047e2 --- /dev/null +++ b/shared/package-files/11/11255895994cbd8d3d04ffdc163c6f8129fa67f150f0963c8d7447a7e75b83a0/netprop-released-sub-0_5-1.log @@ -0,0 +1,4 @@ +released rule from saved branches: Hit@1 0.7629 pool-macro 0.8529 Hit@5 0.8494 Hit@20 0.9284 | twin pools 179 (macro 0.7430), others macro 0.8659 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4032 (domain 0.3339 / other 0.4802) macro 0.2924 + lam 1.00/1.00: Hit@1 0.7962 (+0.0333 [+0.0085, +0.0604]) macro +0.0106 [+0.0030, +0.0189] pools +33 -15 | no top 20 +0.0269 cap30 +0.0261 [+0.0072, +0.0457] | Hit@5 +0.0290 macro@5 +0.0089 cap30@5 +0.0247 diff --git a/shared/package-files/11/11a153784e791a7d4efd6835e8e3c4963933d273502212259d71e6337e22ba85/replay-5Ms-I9b-L-edge.log b/shared/package-files/11/11a153784e791a7d4efd6835e8e3c4963933d273502212259d71e6337e22ba85/replay-5Ms-I9b-L-edge.log new file mode 100644 index 0000000000000000000000000000000000000000..ef434c3c5dc5ce085272fe373061161194a84d31 --- /dev/null +++ b/shared/package-files/11/11a153784e791a7d4efd6835e8e3c4963933d273502212259d71e6337e22ba85/replay-5Ms-I9b-L-edge.log @@ -0,0 +1,13 @@ +{"event": "loaded", "queries": 204, "pools": 44, "members": 5, "inverse_members": 1, "library": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 10259, "unsupported": 81, "seconds": 1.4050824709702283} +{"event": "planned", "queries": 204, "groups": 131, "molecules": 12453, "simulations": 32328, "seconds": 1.4296544039971195} +{"event": "candidate_store", "pools": 44, "pairs": 10025, "seconds": 1.077902405988425} +{"event": "library", "scored": 197, "search_seconds": 0.9763356070034206, "seconds": 1.6705012149759568} +{"event": "inverse_annotated", "pools": 44, "pairs": 10025, "formulae": 2002, "unsupported_candidates": 81, "seconds": 5.723000504076481e-05} +{"event": "inverse", "scored": 201, "seconds": 0.7131240600137971} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 32328, "total": 32328, "failed": 0, "seconds": 177.7333845719695} +{"event": "finished", "queries": 204, "unscored": 0, "directly_scored": 204, "scoring_seconds": 0.28621415700763464, "total_seconds": 195.41628485900583} +{"event": "measured", "exit_code": 0, "wall_seconds": 197.2, "user_seconds": 305.8, "system_seconds": 8.6, "max_rss_gib": 2.53} +{"event": "replay_checked", "exit_code": 0, "package_files": 268, "package_unchanged": true, "processes_left": 0, "rankings": 204} diff --git a/shared/package-files/11/11a2827f83849a0f01821e301ead5baa041c8c381d923948f2d062f242f1fffd/swap-N5-recur-hyb-s10-f5-p48-clip20-w1.0_0.5_0.5.log b/shared/package-files/11/11a2827f83849a0f01821e301ead5baa041c8c381d923948f2d062f242f1fffd/swap-N5-recur-hyb-s10-f5-p48-clip20-w1.0_0.5_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..718463fe3020bbc58f6ffeb7721abd477c6cadcd --- /dev/null +++ b/shared/package-files/11/11a2827f83849a0f01821e301ead5baa041c8c381d923948f2d062f242f1fffd/swap-N5-recur-hyb-s10-f5-p48-clip20-w1.0_0.5_0.5.log @@ -0,0 +1,12 @@ +released rule from saved branches: Hit@1 0.7852 pool-macro 0.8733 Hit@5 0.8846 Hit@20 0.9415 | twin pools 354 (macro 0.7853), others macro 0.8836 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4548 (domain 0.4225 / other 0.4873) macro 0.3854 + lam 1.00/1.00: Hit@1 0.7982 (+0.0130 [-0.0020, +0.0277]) macro +0.0092 [+0.0032, +0.0148] pools +67 -36 | no top 20 +0.0155 cap30 +0.0159 [+0.0021, +0.0289] | Hit@5 -0.0194 macro@5 +0.0065 cap30@5 +0.0081 +without consensus term: Hit@1 0.7852 (ref 0.7685; +0.0167 [-0.0017, +0.0391]) macro 0.8733 (+0.0083 [+0.0027, +0.0136]) pools +61 -33 cap30 +0.0096 | Hit@5 0.8846 (+0.0054) Hit@20 0.9415 (+0.0057) + macro Hit@5 0.9347 (-0.0003 [-0.0038, +0.0035]) pools +22 -23 + macro Hit@20 0.9678 (-0.0009 [-0.0038, +0.0021]) pools +12 -15 + domain 0.9370 (+0.0069) other 0.6327 (+0.0265) | Orbitrap no energy 0.5988 (+0.0291) | above 850 0.4925 (+0.0708) below 850 0.8518 (+0.0044) +full rule : Hit@1 0.7982 (ref 0.8063; -0.0081 [-0.0251, +0.0083]) macro 0.8825 (+0.0012 [-0.0032, +0.0056]) pools +36 -32 cap30 -0.0063 | Hit@5 0.8652 (-0.0107) Hit@20 0.9358 (+0.0189) + macro Hit@5 0.9412 (+0.0000 [-0.0035, +0.0038]) pools +21 -21 + macro Hit@20 0.9684 (-0.0012 [-0.0038, +0.0015]) pools +9 -13 + domain 0.9445 (+0.0036) other 0.6513 (-0.0198) | Orbitrap no energy 0.6172 (-0.0253) | above 850 0.5247 (-0.0191) below 850 0.8605 (-0.0056) diff --git a/shared/package-files/11/11f5e5e240b312c8bbea345aad8ff6903a5f2e017cd914ad48de8b6b08f8221c/recipe.json b/shared/package-files/11/11f5e5e240b312c8bbea345aad8ff6903a5f2e017cd914ad48de8b6b08f8221c/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..39e645a51dcee35190919f6b817697549229197c --- /dev/null +++ b/shared/package-files/11/11f5e5e240b312c8bbea345aad8ff6903a5f2e017cd914ad48de8b6b08f8221c/recipe.json @@ -0,0 +1,160 @@ +{ + "args": { + "store": "/workspace/research/inv", + "out": "runs/I17-ff512x6-real08-corpus2+train3-noise10", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 1.0, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "init": null, + "max_steps_this_run": 0 + }, + "parameters": 24997832, + "model": { + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "pair_dim": 64, + "fp_bits": 4096, + "max_energy": 200.0 + }, + "real_rows": 194119, + "synth_rows": 2333477, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "gpu": "NVIDIA H100 80GB HBM3", + "load_seconds": 13.599964391905814, + "extra_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + } +} diff --git a/shared/package-files/12/121122cc9f8338004770cf375b124e18081626a3ad4bf0001da96cb3869619ea/netprop-eval-m10t02.log b/shared/package-files/12/121122cc9f8338004770cf375b124e18081626a3ad4bf0001da96cb3869619ea/netprop-eval-m10t02.log new file mode 100644 index 0000000000000000000000000000000000000000..d5da5199e8af1ac05d11c6526dfff797cf0e4193 --- /dev/null +++ b/shared/package-files/12/121122cc9f8338004770cf375b124e18081626a3ad4bf0001da96cb3869619ea/netprop-eval-m10t02.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=6.0 norm | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4417 (domain 0.4098 / other 0.4737) macro 0.3686 + lam 0.25/0.50: Hit@1 0.7841 (+0.0128 [-0.0155, +0.0410]) macro +0.0106 [+0.0050, +0.0162] pools +69 -33 | no top 20 +0.0192 cap30 +0.0154 [+0.0022, +0.0287] | Hit@5 -0.0121 macro@5 +0.0077 cap30@5 +0.0137 | twin +22 -7 other +47 -26 | dom +0.0006 oth +0.0250 + lam 0.50/0.50: Hit@1 0.7853 (+0.0140 [-0.0138, +0.0416]) macro +0.0118 [+0.0059, +0.0177] pools +76 -36 | no top 20 +0.0206 cap30 +0.0168 [+0.0032, +0.0301] | Hit@5 -0.0138 macro@5 +0.0077 cap30@5 +0.0119 | twin +25 -8 other +51 -28 | dom +0.0032 oth +0.0249 + lam 0.50/0.75: Hit@1 0.7931 (+0.0218 [-0.0074, +0.0528]) macro +0.0130 [+0.0068, +0.0192] pools +83 -39 | no top 20 +0.0210 cap30 +0.0208 [+0.0065, +0.0361] | Hit@5 -0.0118 macro@5 +0.0077 cap30@5 +0.0140 | twin +29 -8 other +54 -31 | dom +0.0029 oth +0.0407 + lam 0.75/0.75: Hit@1 0.7927 (+0.0214 [-0.0081, +0.0523]) macro +0.0124 [+0.0062, +0.0183] pools +82 -40 | no top 20 +0.0205 cap30 +0.0203 [+0.0060, +0.0356] | Hit@5 -0.0124 macro@5 +0.0068 cap30@5 +0.0134 | twin +28 -8 other +54 -32 | dom +0.0026 oth +0.0402 + lam 1.00/1.00: Hit@1 0.7931 (+0.0218 [-0.0089, +0.0533]) macro +0.0127 [+0.0059, +0.0198] pools +94 -51 | no top 20 +0.0174 cap30 +0.0203 [+0.0027, +0.0382] | Hit@5 -0.0078 macro@5 +0.0068 cap30@5 +0.0168 | twin +30 -9 other +64 -42 | dom +0.0034 oth +0.0402 diff --git a/shared/package-files/12/121e7b127cf51cc7dfac79468d0c6a1f22b96ac5232abff278367a56fdd12317/swap-N5-recur-hyb-s10-f5-p48-w0.75_0.1_0.5.log b/shared/package-files/12/121e7b127cf51cc7dfac79468d0c6a1f22b96ac5232abff278367a56fdd12317/swap-N5-recur-hyb-s10-f5-p48-w0.75_0.1_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..a1984f52d550006fb3df37ae73673f5da3cae696 --- /dev/null +++ b/shared/package-files/12/121e7b127cf51cc7dfac79468d0c6a1f22b96ac5232abff278367a56fdd12317/swap-N5-recur-hyb-s10-f5-p48-w0.75_0.1_0.5.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7772 pool-macro 0.8698 Hit@5 0.8832 Hit@20 0.9416 | twin pools 354 (macro 0.7514), others macro 0.8836 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4600 (domain 0.4190 / other 0.5011) macro 0.3842 + lam 1.00/1.00: Hit@1 0.8093 (+0.0320 [+0.0143, +0.0541]) macro +0.0145 [+0.0080, +0.0207] pools +88 -39 | no top 20 +0.0269 cap30 +0.0268 [+0.0128, +0.0411] | Hit@5 -0.0010 macro@5 +0.0059 cap30@5 +0.0146 +without consensus term: Hit@1 0.7772 (ref 0.7685; +0.0087 [+0.0001, +0.0191]) macro 0.8698 (+0.0047 [+0.0015, +0.0083]) pools +27 -11 cap30 +0.0095 | Hit@5 0.8832 (+0.0039) Hit@20 0.9416 (+0.0058) + domain 0.9329 (+0.0028) other 0.6209 (+0.0147) | Orbitrap no energy 0.5867 (+0.0170) | above 850 0.4514 (+0.0297) below 850 0.8514 (+0.0040) +full rule : Hit@1 0.8093 (ref 0.8063; +0.0030 [-0.0084, +0.0129]) macro 0.8842 (+0.0030 [+0.0003, +0.0056]) pools +18 -8 cap30 +0.0046 | Hit@5 0.8821 (+0.0063) Hit@20 0.9086 (-0.0082) + domain 0.9442 (+0.0033) other 0.6737 (+0.0027) | Orbitrap no energy 0.6444 (+0.0020) | above 850 0.5286 (-0.0153) below 850 0.8732 (+0.0071) diff --git a/shared/package-files/12/1256343b32e8b9e5465ff9a2445a6ce93aaf9c45b37eb78f630f9ca13995fcc3/inv_swap.py b/shared/package-files/12/1256343b32e8b9e5465ff9a2445a6ce93aaf9c45b37eb78f630f9ca13995fcc3/inv_swap.py new file mode 100644 index 0000000000000000000000000000000000000000..1a2ab5fd57834dc367259e9ea7b208e5eadc13bd --- /dev/null +++ b/shared/package-files/12/1256343b32e8b9e5465ff9a2445a6ce93aaf9c45b37eb78f630f9ca13995fcc3/inv_swap.py @@ -0,0 +1,120 @@ +"""Swap the inverse branch of the release and compare inside the full rule (lab, E69; labels evaluate only) + +inv_swap.py prepare --score evals/score/NAME.pkl:pow070 --out evals/fullfold/swap-NAME/pred + a prediction directory with the released forward / library / ion branch outputs (links) and the + inverse distances of another network or ensemble (``eval_score.py`` output, validation query order). +inv_swap.py compare --pred evals/fullfold/swap-NAME/pred --term evals/netprop/term-swap-NAME.pkl + released rule without and with the consensus term (``netprop.py evaluate --save``) for the swapped + branch against the release: Hit@1, pool-macro, paired pool bootstrap, pools gained / lost, strata. +""" +import argparse +import json +import os +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import netprop +import scorelab + +ROOT = netprop.ROOT +REF = 'evals/fullfold/5Ms-I9b+I13-L-ion/pred' + + +def prepare(args): + queries, pools = netprop.load(None) + path, key = args.score.split(':') + rows = pickle.load(open(ROOT / path, 'rb'))[key] + assert len(rows) == len(queries) + ref = pickle.load(open(ROOT / REF / 'inverse.pkl', 'rb')) + out = {} + for q, row in zip(queries, rows): + if row is None: + continue + assert len(row) == len(pools[q['candidate_pool_id']]) + out[q['query_id']] = np.asarray(row, dtype=np.float64) + assert set(out) == set(ref), (len(out), len(ref)) + target = ROOT / args.out + target.mkdir(parents=True, exist_ok=True) + for name in ('distances', 'library', 'ion'): + link = target / f'{name}.pkl' + if not link.exists(): + os.symlink((ROOT / REF / f'{name}.pkl').resolve(), link) + tmp = target / 'inverse.pkl.tmp' + pickle.dump(out, open(tmp, 'wb')) + os.replace(tmp, target / 'inverse.pkl') + print('wrote', target, len(out)) + + +def rule(queries, pools, pred_dir, term_path, config): + pred = {name: pickle.load(open(ROOT / pred_dir / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion')} + base = netprop.released(queries, pools, pred, config) + if term_path is None: + return base, None + term = pickle.load(open(ROOT / term_path, 'rb'))['term'] + term = term[next(iter(term))] + return base, [b if (b is None or t is None) else b + t for b, t in zip(base, term)] + + +def compare(args): + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + config = json.load(open(ROOT / args.config)) + if args.inverse_weights: + wd, wo, ws = (float(x) for x in args.inverse_weights.split('/')) + config = json.loads(json.dumps(config)) + config['inverse'].update(weight_domain=wd, weight_other=wo, weight_other_single=ws) + ref_base, ref_net = rule(queries, pools, args.ref_pred, args.ref_term, json.load(open(ROOT / (args.ref_config or args.config)))) + new_base, new_net = rule(queries, pools, args.pred, args.term, config) + first = np.array([m[0] for m in ev.by_pool.values()]) + sizes, boot = ev.sizes, ev.boot + mz = np.array([float(q['precursor_mz']) for q in queries]) + orbi_ne = np.array([(q.get('instrument_type') == 'Orbitrap') and q.get('collision_energy') is None for q in queries]) + + def report(name, new, ref): + rn, rr = ev.ranks(new, 1.0), ev.ranks(ref, 1.0) + hn, hr = rn == 0, rr == 0 + d = hn[first].astype(float) - hr[first].astype(float) + per_query = np.sum(d[boot] * sizes[boot], axis=1) / np.sum(sizes[boot], axis=1) + macro = d[boot].mean(axis=1) + capped = np.minimum(sizes, 30.0) + print(f'{name}: Hit@1 {hn.mean():.4f} (ref {hr.mean():.4f}; {hn.mean() - hr.mean():+.4f} [{np.percentile(per_query, 2.5):+.4f}, {np.percentile(per_query, 97.5):+.4f}])' + f' macro {hn[first].mean():.4f} ({d.mean():+.4f} [{np.percentile(macro, 2.5):+.4f}, {np.percentile(macro, 97.5):+.4f}]) pools +{int((d > 0).sum())} -{int((d < 0).sum())}' + f' cap30 {np.sum(d * capped) / capped.sum():+.4f} | Hit@5 {np.mean(rn < 5):.4f} ({np.mean(rn < 5) - np.mean(rr < 5):+.4f}) Hit@20 {np.mean(rn < 20):.4f} ({np.mean(rn < 20) - np.mean(rr < 20):+.4f})') + for k in (5, 20): + dk = (rn < k)[first].astype(float) - (rr < k)[first].astype(float) + mk = dk[boot].mean(axis=1) + print(f' macro Hit@{k} {(rn < k)[first].mean():.4f} ({dk.mean():+.4f} [{np.percentile(mk, 2.5):+.4f}, {np.percentile(mk, 97.5):+.4f}]) pools +{int((dk > 0).sum())} -{int((dk < 0).sum())}') + dom = ev.domain + print(f' domain {hn[dom].mean():.4f} ({hn[dom].mean() - hr[dom].mean():+.4f}) other {hn[~dom].mean():.4f} ({hn[~dom].mean() - hr[~dom].mean():+.4f})' + f' | Orbitrap no energy {hn[orbi_ne].mean():.4f} ({hn[orbi_ne].mean() - hr[orbi_ne].mean():+.4f})' + f' | above 850 {hn[mz >= 850].mean():.4f} ({hn[mz >= 850].mean() - hr[mz >= 850].mean():+.4f}) below 850 {hn[mz < 850].mean():.4f} ({hn[mz < 850].mean() - hr[mz < 850].mean():+.4f})') + + report('without consensus term', new_base, ref_base) + if new_net is not None: + report('full rule ', new_net, ref_net) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + sub = p.add_subparsers(dest='cmd', required=True) + a = sub.add_parser('prepare') + a.add_argument('--score', required=True) + a.add_argument('--out', required=True) + b = sub.add_parser('compare') + b.add_argument('--pred', required=True) + b.add_argument('--term') + b.add_argument('--ref-pred', default=REF) + b.add_argument('--ref-term', default='evals/netprop/term-m10-half05-ties.pkl') + b.add_argument('--config', default='builds/5Ms-I9b+I13-L-ion/model_config.json') + b.add_argument('--inverse-weights', help='DOMAIN/OTHER/OTHER_SINGLE for the swapped branch (default: released)') + b.add_argument('--ref-config', help='model_config.json of the reference rule (default: --config)') + args = p.parse_args() + {'prepare': prepare, 'compare': compare}[args.cmd](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/12/126114bcdaa4ba1980c7d82acf8060756a3db8ec5920747dc10356d746ad6bf8/edge-released.log b/shared/package-files/12/126114bcdaa4ba1980c7d82acf8060756a3db8ec5920747dc10356d746ad6bf8/edge-released.log new file mode 100644 index 0000000000000000000000000000000000000000..f6533e0c74f46ae8b2ce509583bf23278f78e6a4 --- /dev/null +++ b/shared/package-files/12/126114bcdaa4ba1980c7d82acf8060756a3db8ec5920747dc10356d746ad6bf8/edge-released.log @@ -0,0 +1,9 @@ +{"event": "loaded", "queries": 204, "pools": 44, "members": 2, "inverse_members": 3, "workers": 7} +{"event": "canonicalized", "unique_candidates": 10259, "unsupported": 81, "seconds": 1.619917642994551} +{"event": "planned", "queries": 204, "groups": 131, "molecules": 12453, "simulations": 32328, "seconds": 1.659770774000208} +{"event": "inverse_annotated", "pools": 44, "pairs": 10025, "formulae": 2002, "unsupported_candidates": 81, "seconds": 1.6138801370107103} +{"event": "inverse", "scored": 201, "seconds": 3.802516915005981} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 32328, "total": 32328, "failed": 0, "seconds": 53.37848803000816} +{"event": "finished", "queries": 204, "unscored": 0, "directly_scored": 204, "scoring_seconds": 0.629630998999346, "total_seconds": 75.91329967800993} diff --git a/shared/package-files/12/12640a7a4c6499714e0ada64ed2cd459e63edbcd16298b18ac3ea05a3df37b08/missed_pools.py b/shared/package-files/12/12640a7a4c6499714e0ada64ed2cd459e63edbcd16298b18ac3ea05a3df37b08/missed_pools.py new file mode 100644 index 0000000000000000000000000000000000000000..32387348bd41fd4113b2d8765f4d078c19592a15 --- /dev/null +++ b/shared/package-files/12/12640a7a4c6499714e0ada64ed2cd459e63edbcd16298b18ac3ea05a3df37b08/missed_pools.py @@ -0,0 +1,56 @@ +"""Largest missed pools of a ranking file (lab; labels read for analysis) + +missed_pools.py evals/fullfold/NAME/rankings.jsonl [--top 25] +""" +import argparse +import json +import sys +from collections import Counter +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import netprop +import scorelab + + +def main(): + p = argparse.ArgumentParser() + p.add_argument('rankings') + p.add_argument('--top', type=int, default=25) + args = p.parse_args() + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + rank = {} + with open(netprop.ROOT / args.rankings) as f: + for line in f: + r = json.loads(line) + rank[r['query_id']] = r['ranking'] + rows = [] + lost_total = 0 + for pid, members in ev.by_pool.items(): + q = queries[members[0]] + label = pools[pid][int(ev.target[members[0]])]['candidate_id'] + position = rank[q['query_id']].index(label) + if position == 0: + continue + lost_total += len(members) + adducts = Counter(queries[i]['adduct'] for i in members).most_common(2) + inst = Counter(queries[i]['instrument_type'] for i in members).most_common(1)[0][0] + energy = np.mean([queries[i].get('collision_energy') is not None for i in members]) + peaks = np.median([len(queries[i]['mzs']) for i in members]) + rows.append((len(members), position, len(pools[pid]), float(q['precursor_mz']), adducts, inst, energy, peaks)) + rows.sort(key=lambda r: -r[0]) + print(f'missed pools {len(rows)} of {len(ev.by_pool)}; missed queries {lost_total} of {len(queries)} ({lost_total / len(queries):.4f})') + sizes = np.array([r[0] for r in rows]) + for low, high in ((1, 1), (2, 5), (6, 20), (21, 100), (101, 10000)): + m = (sizes >= low) & (sizes <= high) + print(f' pools with {low}-{high} spectra: {int(m.sum())} missed pools, {int(sizes[m].sum())} queries ({sizes[m].sum() / len(queries):.4f}), label rank 2-5 in {np.mean([r[1] < 5 for r, k in zip(rows, m) if k]) if m.any() else 0:.2f}') + for r in rows[:args.top]: + print(f' {r[0]:4d} spectra | label rank {r[1] + 1:3d} of {r[2]:3d} | m/z {r[3]:7.2f} | {r[4]} | {r[5]} | energy recorded {r[6]:.2f} | median peaks {r[7]:.0f}') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/12/1299c76e62961e85b48e0021dcd9c84b591c9bc1912a50dfc0ada8f9361e8314/scorelab-v5.log b/shared/package-files/12/1299c76e62961e85b48e0021dcd9c84b591c9bc1912a50dfc0ada8f9361e8314/scorelab-v5.log new file mode 100644 index 0000000000000000000000000000000000000000..e95cf6101260fd54a2770faab45b3af9f43699e9 --- /dev/null +++ b/shared/package-files/12/1299c76e62961e85b48e0021dcd9c84b591c9bc1912a50dfc0ada8f9361e8314/scorelab-v5.log @@ -0,0 +1,10 @@ +ind base all=0.4574 dom=0.6851 non=0.1917 h5=0.5803 h20=0.6535 | diff=+0.0000 [+0.0000,+0.0000] +agg base all=0.6055 dom=0.8131 non=0.3633 h5=0.7327 h20=0.8673 | diff=+0.0000 [+0.0000,+0.0000] +ind noprec all=0.4825 dom=0.7232 non=0.2018 h5=0.6078 h20=0.6982 | diff=+0.0252 [+0.0129,+0.0370] +agg noprec all=0.6376 dom=0.8131 non=0.4329 h5=0.7927 h20=0.8747 | diff=+0.0321 [-0.0027,+0.0874] +ind noprec_pp0.75 all=0.4928 dom=0.7336 non=0.2119 h5=0.6083 h20=0.7000 | diff=+0.0354 [+0.0208,+0.0513] +agg noprec_pp0.75 all=0.6348 dom=0.8106 non=0.4299 h5=0.7885 h20=0.8756 | diff=+0.0293 [-0.0068,+0.0862] +ind noprec_pp0.5 all=0.4918 dom=0.7310 non=0.2129 h5=0.6167 h20=0.6865 | diff=+0.0345 [+0.0172,+0.0534] +agg noprec_pp0.5 all=0.6591 dom=0.8391 non=0.4490 h5=0.7848 h20=0.8752 | diff=+0.0536 [-0.0072,+0.1226] +ind noprec_pp1.5 all=0.4723 dom=0.7050 non=0.2008 h5=0.5948 h20=0.6945 | diff=+0.0149 [+0.0005,+0.0290] +agg noprec_pp1.5 all=0.5976 dom=0.7915 non=0.3713 h5=0.7876 h20=0.8836 | diff=-0.0079 [-0.0333,+0.0213] diff --git a/shared/package-files/12/129b950b98313c716efaee637a2d14998af1522f8f2d5bfc98a83347b5db27a4/netprop-neigh-inv-s0.7.log b/shared/package-files/12/129b950b98313c716efaee637a2d14998af1522f8f2d5bfc98a83347b5db27a4/netprop-neigh-inv-s0.7.log new file mode 100644 index 0000000000000000000000000000000000000000..9f8cf2333ccf3d5bba882086dd8dec9254092056 --- /dev/null +++ b/shared/package-files/12/129b950b98313c716efaee637a2d14998af1522f8f2d5bfc98a83347b5db27a4/netprop-neigh-inv-s0.7.log @@ -0,0 +1,10 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4651 (domain 0.4549 / other 0.4754) macro 0.4238 + lam 1.00/1.00: Hit@1 0.7685 (-0.0028 [-0.0356, +0.0288]) macro +0.0021 [-0.0050, +0.0086] pools +73 -66 | no top 20 -0.0023 cap30 -0.0036 [-0.0232, +0.0139] | Hit@5 -0.0408 macro@5 -0.0050 cap30@5 -0.0149 + +k=10 p=2.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4680 (domain 0.4628 / other 0.4732) macro 0.4315 + lam 1.00/1.00: Hit@1 0.7689 (-0.0025 [-0.0352, +0.0289]) macro +0.0024 [-0.0044, +0.0089] pools +71 -63 | no top 20 -0.0020 cap30 -0.0032 [-0.0222, +0.0146] | Hit@5 -0.0392 macro@5 -0.0038 cap30@5 -0.0130 + +k=10 p=1.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4725 (domain 0.4713 / other 0.4736) macro 0.4400 + lam 1.00/1.00: Hit@1 0.7724 (+0.0011 [-0.0324, +0.0328]) macro +0.0027 [-0.0038, +0.0089] pools +69 -60 | no top 20 +0.0020 cap30 +0.0008 [-0.0180, +0.0185] | Hit@5 -0.0378 macro@5 -0.0044 cap30@5 -0.0115 diff --git a/shared/package-files/12/12b1c336c44796225178db90fec124f43e30d78b4b4d20f8e14747ddd87e3176/consensus-equivalence-5Ms-N5-L-ion-net.log b/shared/package-files/12/12b1c336c44796225178db90fec124f43e30d78b4b4d20f8e14747ddd87e3176/consensus-equivalence-5Ms-N5-L-ion-net.log new file mode 100644 index 0000000000000000000000000000000000000000..e59e8eaf43f9a2a71108163c4a0e410a1c170d7b --- /dev/null +++ b/shared/package-files/12/12b1c336c44796225178db90fec124f43e30d78b4b4d20f8e14747ddd87e3176/consensus-equivalence-5Ms-N5-L-ion-net.log @@ -0,0 +1,7 @@ +distances: largest absolute difference package run - base run 0 +inverse: largest absolute difference package run - base run 0.999 +library: largest absolute difference package run - base run 0 +ion: largest absolute difference package run - base run 0 +consensus term: 19428 queries covered by both, coverage differs for 0, largest absolute difference 4.44e-16 +label rank: package == lab for 19429 / 19429 queries; Hit@1 package 0.8063 lab 0.8063; Hit@5 0.8759 / 0.8759; Hit@20 0.9169 / 0.9169 +per spectrum (no pool mean): base 0.6255 with the term 0.6869 diff --git a/shared/package-files/12/12b1c336c44796225178db90fec124f43e30d78b4b4d20f8e14747ddd87e3176/consensus-equivalence-5Ms-N5-L-ion-net2.log b/shared/package-files/12/12b1c336c44796225178db90fec124f43e30d78b4b4d20f8e14747ddd87e3176/consensus-equivalence-5Ms-N5-L-ion-net2.log new file mode 100644 index 0000000000000000000000000000000000000000..e59e8eaf43f9a2a71108163c4a0e410a1c170d7b --- /dev/null +++ b/shared/package-files/12/12b1c336c44796225178db90fec124f43e30d78b4b4d20f8e14747ddd87e3176/consensus-equivalence-5Ms-N5-L-ion-net2.log @@ -0,0 +1,7 @@ +distances: largest absolute difference package run - base run 0 +inverse: largest absolute difference package run - base run 0.999 +library: largest absolute difference package run - base run 0 +ion: largest absolute difference package run - base run 0 +consensus term: 19428 queries covered by both, coverage differs for 0, largest absolute difference 4.44e-16 +label rank: package == lab for 19429 / 19429 queries; Hit@1 package 0.8063 lab 0.8063; Hit@5 0.8759 / 0.8759; Hit@20 0.9169 / 0.9169 +per spectrum (no pool mean): base 0.6255 with the term 0.6869 diff --git a/shared/package-files/12/12e6bb59a622cb1cea003a7f8bf56ca2cd037babdfce3d4999afe730ea6aa5f1/inspect2.py b/shared/package-files/12/12e6bb59a622cb1cea003a7f8bf56ca2cd037babdfce3d4999afe730ea6aa5f1/inspect2.py new file mode 100644 index 0000000000000000000000000000000000000000..0c2276ba4093f348e055eb7241089729b94911bc --- /dev/null +++ b/shared/package-files/12/12e6bb59a622cb1cea003a7f8bf56ca2cd037babdfce3d4999afe730ea6aa5f1/inspect2.py @@ -0,0 +1,56 @@ +"""Inspect zero-overlap failures with sub-formula explanations (dev only).""" +import json, sys, hashlib, pickle, re +from pathlib import Path +import numpy as np +sys.path.insert(0, '/workspace/research/allcond/pkg'); sys.path.insert(0, '/workspace/research/ms-pred/src') +import infer +from ms_pred import common +MASS = {'C': 12.0, 'H': 1.00782503223, 'N': 14.00307400443, 'O': 15.99491461957, 'S': 31.9720711744, 'P': 30.97376199842, + 'F': 18.99840316273, 'Cl': 34.968852682, 'Br': 78.9183376, 'I': 126.9044719, 'Si': 27.97692653465, 'B': 11.00930536, + 'Se': 79.9165218, 'As': 74.92159457} +E = 0.000548579909 +def sub_masses(formula): + comp = {el: int(n or 1) for el, n in re.findall(r'([A-Z][a-z]?)(\d*)', formula)} + masses = np.zeros(1) + for el, n in comp.items(): + masses = (masses[:, None] + MASS[el] * np.arange(n + 1)[None, :]).ravel() + return np.sort(masses) +root, pred = Path(sys.argv[1]), Path(sys.argv[2]) +labels = {json.loads(l)['query_id']: json.loads(l) for l in open('/workspace/data/validation.jsonl')} +queries = list(infer.read_jsonl(root / 'queries.jsonl')) +pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(root / 'candidate_pools.jsonl')} +inst = lambda name: common.instrument2onehot_pos.get(name or 'Unknown', common.instrument2onehot_pos['Unknown']) +plan = infer.Plan(queries, pools, 8, inst, set(common.ion2onehot_pos)) +masses = np.load(pred / 'masses.npy', mmap_mode='r'); intens = np.load(pred / 'intens.npy', mmap_mode='r') +dist = pickle.load(open(pred / 'distances.pkl', 'rb')) +rng = np.random.default_rng(1) +seen = set(); shown = 0 +cats = {'explained_frac': [], 'npk': [], 'prec_only': []} +for qi in rng.permutation(len(queries)): + q = queries[qi] + if q['collision_energy'] is not None or q['instrument_type'] != 'Orbitrap': continue + lab = labels[q['query_id']] + cands = pools[q['candidate_pool_id']] + tid = hashlib.sha256(lab['target_smiles'].encode()).hexdigest() + t = [i for i, c in enumerate(cands) if c['candidate_id'] == tid][0] + d = dist[q['query_id']] + if d[t] < 0.999: continue + task = plan.groups[plan.query_group[qi]]['tasks'][t] + mz = np.array(q['mzs']); it = np.array(q['intensities']) + sm = sub_masses(lab['target_formula']) + shift = (22.989769282 - E) if 'Na' in q['adduct'] else (MASS['H'] - E) + ions = np.sort(np.concatenate([sm + shift, sm + MASS['H'] - E])) + j = np.clip(np.searchsorted(ions, mz), 1, len(ions) - 1) + err = np.minimum(np.abs(mz - ions[j - 1]), np.abs(mz - ions[j])) + cats['explained_frac'].append(float((it[err < 0.003]).sum() / it.sum())); cats['npk'].append(len(mz)) + cats['prec_only'].append(float(np.all(np.abs(mz - q['precursor_mz']) < 0.5))) + if q['candidate_pool_id'] in seen or shown >= 8: continue + seen.add(q['candidate_pool_id']); shown += 1 + pm = np.array(masses[0, task]); pi = np.array(intens[0, task]).astype(float) + o = np.argsort(-it)[:10] + print('=' * 60); print(q['adduct'], 'prec', q['precursor_mz'], lab['target_formula'], lab['target_smiles'][:70]) + print(' observed (mz, inten, subformula err mDa):', [(round(float(mz[i]), 4), round(float(it[i]), 2), round(float(err[i]) * 1000, 1)) for i in sorted(o)]) + o = np.argsort(-pi)[:10] + print(' predicted:', [(round(float(pm[i]), 4), round(float(pi[i]), 2)) for i in sorted(o)]) +for k, v in cats.items(): print(k, 'mean', np.mean(v), 'median', np.median(v), 'n', len(v)) +a = np.array(cats['explained_frac']); print('zero-overlap queries with >50% intensity explained (3 mDa):', (a > 0.5).mean(), ' <10% explained:', (a < 0.1).mean()) diff --git a/shared/package-files/14/140c50e98165381502317d74efc7136025bf0595f2339eee93b3d1c2ea39c4b3/fusion_rule.py b/shared/package-files/14/140c50e98165381502317d74efc7136025bf0595f2339eee93b3d1c2ea39c4b3/fusion_rule.py new file mode 100644 index 0000000000000000000000000000000000000000..5b71967e3204df28a828c38b6beef1ac7a30d488 --- /dev/null +++ b/shared/package-files/14/140c50e98165381502317d74efc7136025bf0595f2339eee93b3d1c2ea39c4b3/fusion_rule.py @@ -0,0 +1,100 @@ +"""Sensitivity of the packaged fusion rule on cached validation distances (development only). + +fusion_rule.py NAME=INVERSE.pkl:KEY[+INVERSE.pkl:KEY...] [NAME=...] [--base NAME] [--grid] + +The packaged rule (``infer.fuse`` followed by the pool mean): + + fused(pool) = mean_q simulator(q) + mean_q w(q) * inverse(q) + w(q) = wd for [M+H]+ spectra with a recorded collision energy + = max(wn, c / n_spectra) otherwise + +Each NAME is an inverse model given as one or more ``eval_inv.py`` pickles (several = +plain mean of their distances, i.e. an inverse ensemble). Reports the simulator alone, the +inverse alone (pool mean) and the rule for the selected constants and a grid around them, +with the paired pool bootstrap versus the simulator and non-domain Hit@1 by pool size. +""" +import argparse +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from fuselab import Lab + +MEMBERS = ['B20k=/workspace/research/evals/B20k-full/pred/scorelab-v3.pkl', + 'B30k=/workspace/research/evals/B30k-full/pred/scorelab-v5.pkl'] +BINS = ((1, 1), (2, 4), (5, 15), (16, 63), (64, 9999)) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('models', nargs='+') + p.add_argument('--root', default='/workspace/research/validation-input') + p.add_argument('--variant', default='noprec_pp0.75') + p.add_argument('--members', nargs='*', default=MEMBERS) + p.add_argument('--selected', default='0.75,0.05,0.5') + p.add_argument('--grid', action='store_true') + p.add_argument('--versus', help='NAME of the model whose selected rule is the paired-bootstrap base (default: simulator)') + args = p.parse_args() + lab = Lab(args.root, args.variant, args.members).setup() + pools = len(lab.members) + size = np.array([len(m) for m in lab.members]) + dom = [lab.domain[m] for m in lab.members] + sim = [lab.matrix(lab.sim, s).mean(0) for s in range(pools)] + non_domain = np.array([(~d).all() for d in dom]) + base = lab.pool_rule(lambda s: sim[s]) + + def report(name, rank, reference): + hit = rank == 0 + pool_hit = np.array([hit[m[0]] for m in lab.members]) + cells = [] + for low, high in BINS: + m = non_domain & (size >= low) & (size <= high) + cells.append(f'{(pool_hit[m] * size[m]).sum() / size[m].sum():.3f}') + print(lab.line(name, rank, reference) + ' | non-domain by pool size ' + ' '.join(cells), flush=True) + + def load(spec): + parts = [] + for item in spec.split('+'): + path, key = item.rsplit(':', 1) + data = pickle.load(open(path, 'rb'))[key] + parts.append([lab.matrix(data, s) for s in range(pools)]) + return [np.mean([part[s] for part in parts], axis=0) for s in range(pools)] + + def rule(inv, wd, wn, c): + def fused(s): + w = np.where(dom[s], wd, max(wn, c / len(dom[s]))) + return sim[s] + (w[:, None] * inv[s]).mean(0) + return lab.pool_rule(fused) + + print('non-domain pool-size bins: ' + ' '.join(f'{a}-{b}' for a, b in BINS)) + print(lab.line('simulator (released forward branch)', base)) + selected = tuple(float(x) for x in args.selected.split(',')) + models = {} + for spec in args.models: + name, value = spec.split('=', 1) + models[name] = load(value) + reference = base + if args.versus: + reference = rule(models[args.versus], *selected) + for name, inv in models.items(): + print('---', name) + report(f'{name}: inverse alone (pool mean)', lab.pool_rule(lambda s: inv[s].mean(0)), base) + report(f'{name}: wd={selected[0]} wn={selected[1]} c={selected[2]}', rule(inv, *selected), reference) + if not args.grid: + continue + wd0, wn0, c0 = selected + for wd in (0.3, 0.5, 0.6, 0.9, 1.0, 1.25): + report(f'{name}: wd={wd}', rule(inv, wd, wn0, c0), base) + for wn in (0.0, 0.02, 0.035, 0.07, 0.1, 0.15): + report(f'{name}: wn={wn}', rule(inv, wd0, wn, c0), base) + for c in (0.0, 0.25, 1.0, 2.0): + report(f'{name}: c={c}', rule(inv, wd0, wn0, c), base) + report(f'{name}: wn=0 c=0 (domain only)', rule(inv, wd0, 0.0, 0.0), base) + report(f'{name}: wd=0 (non-domain only)', rule(inv, 0.0, wn0, c0), base) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/14/1430eeac7ff4da529e00b39c3a058abe74a4f5dbf69ffe9707ae447b9524d7df/validation.jsonl b/shared/package-files/14/1430eeac7ff4da529e00b39c3a058abe74a4f5dbf69ffe9707ae447b9524d7df/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..381e3d8ae828b37032dfc13e97ed606e4a8c4e6f --- /dev/null +++ b/shared/package-files/14/1430eeac7ff4da529e00b39c3a058abe74a4f5dbf69ffe9707ae447b9524d7df/validation.jsonl @@ -0,0 +1,10 @@ +{"step": 5000, "elapsed": 159.4368463968858, "val_loss": 0.03798504603173534, "val_cos": 0.6285174646308354, "val_loss_ema": 0.035821626347001825, "val_cos_ema": 0.6467729985017564} +{"step": 10000, "elapsed": 310.5557022858411, "val_loss": 0.033269719730483024, "val_cos": 0.67887269684251, "val_loss_ema": 0.032438482097728025, "val_cos_ema": 0.686638024887893, "ind_cos": 0.4086159864120644, "agg_cos": 0.45535024962684645, "ind_nll": 0.27870708734366156, "agg_nll": 0.2551855473776314, "retrieval_seconds": 15.939691528212279} +{"step": 15000, "elapsed": 479.3448803727515, "val_loss": 0.03283510184078186, "val_cos": 0.68909920968253, "val_loss_ema": 0.031045216982446503, "val_cos_ema": 0.7039999806989552} +{"step": 20000, "elapsed": 634.2012787316926, "val_loss": 0.031917238046496016, "val_cos": 0.6994428105015377, "val_loss_ema": 0.030351062240416025, "val_cos_ema": 0.7142906418683089, "ind_cos": 0.4696072880745278, "agg_cos": 0.5133048535694066, "ind_nll": 0.36126408976272584, "agg_nll": 0.3542127747182047, "retrieval_seconds": 16.779075880069286} +{"step": 25000, "elapsed": 808.2070019226521, "val_loss": 0.03156954907519345, "val_cos": 0.7080652507004671, "val_loss_ema": 0.030508682727691007, "val_cos_ema": 0.7174829668279377} +{"step": 30000, "elapsed": 969.49993793061, "val_loss": 0.031984809374034945, "val_cos": 0.7082619931867312, "val_loss_ema": 0.030744728238775637, "val_cos_ema": 0.7184512484760217, "ind_cos": 0.4821143651242987, "agg_cos": 0.5330176540223377, "ind_nll": 0.38478562972875596, "agg_nll": 0.37423439188841423, "retrieval_seconds": 17.300428166985512} +{"step": 35000, "elapsed": 1158.2591622639447, "val_loss": 0.03171259482329391, "val_cos": 0.7140220168124164, "val_loss_ema": 0.030994197541720416, "val_cos_ema": 0.7199540031975398} +{"step": 40000, "elapsed": 1299.0981366955675, "val_loss": 0.031872882398306615, "val_cos": 0.7161092878437194, "val_loss_ema": 0.031333974781023614, "val_cos_ema": 0.7194546703401649, "ind_cos": 0.48509959339132225, "agg_cos": 0.5305985897369911, "ind_nll": 0.39430747851150344, "agg_nll": 0.3822636265376499, "retrieval_seconds": 12.715768855065107} +{"step": 45000, "elapsed": 1405.196320829913, "val_loss": 0.031078219837116273, "val_cos": 0.7219372483827333, "val_loss_ema": 0.031063084742493904, "val_cos_ema": 0.721944153281258} +{"step": 50000, "elapsed": 1497.6725360290147, "val_loss": 0.0312791907098291, "val_cos": 0.7212922718013344, "val_loss_ema": 0.031130075295185355, "val_cos_ema": 0.7220687241848526, "ind_cos": 0.4890627412630604, "agg_cos": 0.5365175768181584, "ind_nll": 0.39770446240156465, "agg_nll": 0.39312368109526996, "retrieval_seconds": 13.11741911014542} diff --git a/shared/package-files/14/143891692e5ef02133824bcde29064d730aeac6542f790fe77f7cab759576ea7/release_pools.py b/shared/package-files/14/143891692e5ef02133824bcde29064d730aeac6542f790fe77f7cab759576ea7/release_pools.py new file mode 100644 index 0000000000000000000000000000000000000000..106eba2401913b281c9ab7d607143318c8253bbd --- /dev/null +++ b/shared/package-files/14/143891692e5ef02133824bcde29064d730aeac6542f790fe77f7cab759576ea7/release_pools.py @@ -0,0 +1,117 @@ +"""Missed pools of a released package by size (lab, E65; validation labels: analysis only) + +release_pools.py --pred evals/fullfold/NAME/pred --rankings evals/fullfold/NAME/rankings.jsonl [--top 40] + +A pool = all validation spectra of one molecule (they share the candidate pool); the pool rule gives +them one ranking. Prints the lost share by pool size and, for the largest missed pools, the +pool-mean rank of the target under each branch alone, the formula / similarity of the wrong top-1. +""" +import argparse +import json +import pickle +import sys +from collections import Counter +from pathlib import Path + +import numpy as np +from rdkit import Chem, DataStructs, RDLogger +from rdkit.Chem import AllChem, rdMolDescriptors + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import scorelab +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import infer + +RDLogger.DisableLog('rdApp.*') +ROOT = Path('/workspace/research') + + +def fp(smiles): + mol = Chem.MolFromSmiles(smiles) + return None if mol is None else (AllChem.GetMorganFingerprintAsBitVect(mol, 2, 2048), rdMolDescriptors.CalcMolFormula(mol)) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--pred', required=True) + p.add_argument('--rankings', required=True) + p.add_argument('--top', type=int, default=40) + p.add_argument('--save') + args = p.parse_args() + root = ROOT / 'validation-input' + queries = list(infer.read_jsonl(root / 'queries.jsonl')) + pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(root / 'candidate_pools.jsonl')} + ev = scorelab.Evaluator(queries, pools) + n_all = len(queries) + branch = {name: pickle.load(open(ROOT / args.pred / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion')} + top = {} + rank = np.full(n_all, 10 ** 6) + index = {q['query_id']: i for i, q in enumerate(queries)} + for line in open(ROOT / args.rankings): + row = json.loads(line) + i = index[row['query_id']] + ids = ev.ids[queries[i]['candidate_pool_id']] + order = row.get('ranked_candidate_ids') or row.get('ranking') or row.get('candidates') + top[i] = order[:5] + rank[i] = order.index(ids[ev.target[i]]) + print(f'queries {n_all} Hit@1 {np.mean(rank == 0):.4f} Hit@5 {np.mean(rank < 5):.4f} Hit@20 {np.mean(rank < 20):.4f}') + print('rank classes (share of all): 1 %.4f | 2 %.4f | 3-5 %.4f | 6-20 %.4f | beyond %.4f' % ( + np.mean(rank == 0), np.mean(rank == 1), np.mean((rank >= 2) & (rank < 5)), np.mean((rank >= 5) & (rank < 20)), np.mean(rank >= 20))) + mz = np.array([float(q['precursor_mz']) for q in queries]) + adduct = np.array([q['adduct'] for q in queries]) + energy = np.array([q.get('collision_energy') is not None for q in queries]) + rows = [] + for pid, members in ev.by_pool.items(): + members = np.array(members) + r = rank[members] + own = {} + for name, pred in branch.items(): + vals = [pred.get(queries[i]['query_id']) for i in members] + vals = [v for v in vals if v is not None] + if not vals: + own[name] = -1 + continue + mean = np.mean(vals, axis=0) + order = np.lexsort((ev.ids[pid], mean)) + own[name] = int(np.where(order == ev.target[members[0]])[0][0]) + rows.append({'pool': pid, 'size': len(members), 'missed': int((r > 0).sum()), 'rank': int(np.median(r)), 'mz': float(np.median(mz[members])), + 'na': float(np.mean(adduct[members] == '[M+Na]+')), 'energy': float(np.mean(energy[members])), 'cands': len(pools[pid]), + 'own': own, 'first': int(members[0])}) + print('\nby pool size: pools | queries | Hit@1 | lost share | missed pools | top-5 among missed') + for lo, hi in ((1, 2), (2, 5), (5, 20), (20, 50), (50, 100), (100, 10 ** 6)): + sel = [r for r in rows if lo <= r['size'] < hi] + q = sum(r['size'] for r in sel) + miss = sum(r['missed'] for r in sel) + missed = [r for r in sel if r['missed'] > r['size'] / 2] + print(f' [{lo},{hi}) {len(sel):5d} | {q:6d} | {1 - miss / q:.4f} | {miss / n_all:.4f} | {len(missed):4d} | ' + f'{np.mean([r["rank"] < 5 for r in missed]) if missed else float("nan"):.3f}') + missed = sorted([r for r in rows if r['missed'] > 0], key=lambda r: -r['missed']) + cum = np.cumsum([r['missed'] for r in missed]) / n_all + print(f'\nmissed pools {len(missed)}; lost share in the largest 10 / 25 / 50 / 100 / 200: ' + ' / '.join(f'{cum[min(k, len(cum)) - 1]:.4f}' for k in (10, 25, 50, 100, 200))) + print('\nlargest missed pools: size | missed | rank | m/z | Na share | energy share | cands | alone F / I / L / ion | top-1 same formula | Tanimoto top-1 | isomers in pool') + stats = Counter() + detail = [] + for r in missed[:args.top if args.top > 0 else len(missed)]: + i = r['first'] + cands = pools[r['pool']] + by_id = {c['candidate_id']: c['smiles'] for c in cands} + target = fp(by_id[ev.ids[r['pool']][ev.target[i]]]) + first = fp(by_id[top[i][0]]) + same = int(first is not None and target is not None and first[1] == target[1]) + tani = DataStructs.TanimotoSimilarity(first[0], target[0]) if first and target else float('nan') + formulas = Counter() + for c in cands: + f = fp(c['smiles']) + formulas[f[1] if f else '?'] += 1 + iso = formulas[target[1]] if target else 0 + own = r['own'] + r.update(same=same, tanimoto=tani, isomers=iso) + detail.append(r) + print(f" {r['size']:4d} | {r['missed']:4d} | {r['rank'] + 1:4d} | {r['mz']:7.2f} | {r['na']:.2f} | {r['energy']:.2f} | {r['cands']:3d} | " + f"{own['distances'] + 1:3d} / {own['inverse'] + 1:3d} / {own['library'] + 1:3d} / {own['ion'] + 1:3d} | {same} | {tani:.2f} | {iso}") + if args.save: + json.dump(detail, open(ROOT / args.save, 'w')) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net-val-sub.report.json b/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net-val-sub.report.json new file mode 100644 index 0000000000000000000000000000000000000000..2d00a17680aa776ca2daecb7bfc6d8d9530d4e29 --- /dev/null +++ b/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net-val-sub.report.json @@ -0,0 +1,119 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.7647880763856544, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.5968397927995166, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.7647880763856544, + "hit_rate_at_20": 0.8984629715882627, + "hit_rate_at_5": 0.8528178854215184 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.0055891942244993015, + "grouping": "supplied target_inchikey connectivity block", + "lower": -0.0004286552025327156, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.01210618751997078 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8244873341375151, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.5623721881390593, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.7647880763856544, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.927734375, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.903954802259887, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.6622516556291391, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.9540229885057471, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.5995828988529719, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7714285714285715, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7759358288770053, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.6776859504132231, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.5993945509586277, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.9065743944636678, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.7647880763856544, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.6640621247089459, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8615961684824949 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net-val-sub.score.log b/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net-val-sub.score.log new file mode 100644 index 0000000000000000000000000000000000000000..2d00a17680aa776ca2daecb7bfc6d8d9530d4e29 --- /dev/null +++ b/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net-val-sub.score.log @@ -0,0 +1,119 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.7647880763856544, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.5968397927995166, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.7647880763856544, + "hit_rate_at_20": 0.8984629715882627, + "hit_rate_at_5": 0.8528178854215184 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.0055891942244993015, + "grouping": "supplied target_inchikey connectivity block", + "lower": -0.0004286552025327156, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.01210618751997078 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8244873341375151, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.5623721881390593, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.7647880763856544, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.927734375, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.903954802259887, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.6622516556291391, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.9540229885057471, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.5995828988529719, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7714285714285715, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7759358288770053, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.6776859504132231, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.5993945509586277, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.9065743944636678, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.7647880763856544, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.6640621247089459, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8615961684824949 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net2-val-sub.report.json b/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net2-val-sub.report.json new file mode 100644 index 0000000000000000000000000000000000000000..2d00a17680aa776ca2daecb7bfc6d8d9530d4e29 --- /dev/null +++ b/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net2-val-sub.report.json @@ -0,0 +1,119 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.7647880763856544, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.5968397927995166, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.7647880763856544, + "hit_rate_at_20": 0.8984629715882627, + "hit_rate_at_5": 0.8528178854215184 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.0055891942244993015, + "grouping": "supplied target_inchikey connectivity block", + "lower": -0.0004286552025327156, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.01210618751997078 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8244873341375151, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.5623721881390593, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.7647880763856544, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.927734375, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.903954802259887, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.6622516556291391, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.9540229885057471, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.5995828988529719, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7714285714285715, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7759358288770053, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.6776859504132231, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.5993945509586277, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.9065743944636678, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.7647880763856544, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.6640621247089459, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8615961684824949 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net2-val-sub.score.log b/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net2-val-sub.score.log new file mode 100644 index 0000000000000000000000000000000000000000..2d00a17680aa776ca2daecb7bfc6d8d9530d4e29 --- /dev/null +++ b/shared/package-files/14/14c7984c850f4dbbadd26d8da8728c2e9364736e776e7f0e6558f6d574d3d65b/replay-5Ms-N5-L-ion-net2-val-sub.score.log @@ -0,0 +1,119 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.7647880763856544, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.5968397927995166, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.7647880763856544, + "hit_rate_at_20": 0.8984629715882627, + "hit_rate_at_5": 0.8528178854215184 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.0055891942244993015, + "grouping": "supplied target_inchikey connectivity block", + "lower": -0.0004286552025327156, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.01210618751997078 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8244873341375151, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.5623721881390593, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.7647880763856544, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.927734375, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.903954802259887, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.6622516556291391, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.9540229885057471, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.5995828988529719, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7714285714285715, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7759358288770053, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.6776859504132231, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.5993945509586277, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.9065743944636678, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.7647880763856544, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.6640621247089459, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8615961684824949 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/1c/1c06df17bd17c3cd374ae9966cd2693cbe07985405904fa5b7cc79379346a442/train-decoys-audit.log b/shared/package-files/1c/1c06df17bd17c3cd374ae9966cd2693cbe07985405904fa5b7cc79379346a442/train-decoys-audit.log new file mode 100644 index 0000000000000000000000000000000000000000..1b919640ef2abd292c1ad77318afc4d31628168d --- /dev/null +++ b/shared/package-files/1c/1c06df17bd17c3cd374ae9966cd2693cbe07985405904fa5b7cc79379346a442/train-decoys-audit.log @@ -0,0 +1,16 @@ +validation candidates 863339, with the fingerprint of a train label: 2011 (0.0023) +pools with at least one train-label candidate: 0.192 of pools, 0.184 of queries; median count in those pools 1, mean 3.1 +target carries a train-label fingerprint (should be ~0; fingerprint collisions): 10 pools, 79 queries + all queries 19429 | fused top-1 is a train label: 0.0113 of queries = 0.033 of the missed queries | forward-only top-1 is a train label: 0.0047 + domain pools queries 7569 | fused top-1 is a train label: 0.0037 of queries = 0.034 of the missed queries | forward-only top-1 is a train label: 0.0013 + mixed pools queries 3437 | fused top-1 is a train label: 0.0038 of queries = 0.002 of the missed queries | forward-only top-1 is a train label: 0.0032 + non-domain pools queries 8423 | fused top-1 is a train label: 0.0213 of queries = 0.039 of the missed queries | forward-only top-1 is a train label: 0.0083 +simulator all=0.6539 dom=0.8039 non=0.5034 h5=0.8177 h20=0.8925 macro=0.7519 +packaged rule all=0.7265 dom=0.8937 non=0.5586 h5=0.8372 h20=0.9033 macro=0.8116 +AUDIT (not a release candidate): demote every train-label candidate to the end +simulator, train labels demoted all=0.6500 dom=0.8035 non=0.4958 h5=0.8138 h20=0.8884 macro=0.7493 | -0.0040 [-0.0086,-0.0006] +packaged rule, train labels demoted all=0.7248 dom=0.8940 non=0.5550 h5=0.8333 h20=0.8999 macro=0.8110 | -0.0016 [-0.0046,+0.0004] + +real 0m1.976s +user 0m1.911s +sys 0m0.441s diff --git a/shared/package-files/1c/1c3ab6fda7483fa65758b5b0ef134e17eacce3f108cd0b2f9e526d2b89366eb3/train-C1.log b/shared/package-files/1c/1c3ab6fda7483fa65758b5b0ef134e17eacce3f108cd0b2f9e526d2b89366eb3/train-C1.log new file mode 100644 index 0000000000000000000000000000000000000000..f422c2127f7d6841643e46982ae1835ffb22d2eb --- /dev/null +++ b/shared/package-files/1c/1c3ab6fda7483fa65758b5b0ef134e17eacce3f108cd0b2f9e526d2b89366eb3/train-C1.log @@ -0,0 +1,6 @@ +{"event": "resumed", "source": "/workspace/research/forks/B-step0035000-resume.ckpt", "step": 35000, "epoch": 5, "batch_in_epoch": 5460, "elapsed": 9512.104094705079, "skipped": 0} +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "own-checkpoint:0739bdd163a52753b55f2558914ac1fb8383b00c0436512105f4f0e28d55a5a8", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 37500, "elapsed_seconds": 11359.873801814043, "validation_loss": 0.5803505964577198, "validation_loss_ema": 0.5706611545756459} +{"step": 40000, "elapsed_seconds": 13108.830896281055, "validation_loss": 0.5801039915531874, "validation_loss_ema": 0.5671867122873664} diff --git a/shared/package-files/1c/1c62fd3fc145992a5442c8e61d5c4838eeb967bb18dfb4db155e63e9a2d50887/replay-B20k+B30k-I1-50k-val-sub.report.json b/shared/package-files/1c/1c62fd3fc145992a5442c8e61d5c4838eeb967bb18dfb4db155e63e9a2d50887/replay-B20k+B30k-I1-50k-val-sub.report.json new file mode 100644 index 0000000000000000000000000000000000000000..c4786eec99494c1eeea3b1b35c9e2d4cf1a4f289 --- /dev/null +++ b/shared/package-files/1c/1c62fd3fc145992a5442c8e61d5c4838eeb967bb18dfb4db155e63e9a2d50887/replay-B20k+B30k-I1-50k-val-sub.report.json @@ -0,0 +1,107 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.695854680950163, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.4449579290613783, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.695854680950163, + "hit_rate_at_20": 0.8938053097345132, + "hit_rate_at_5": 0.816022356776898 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.7623642943305187, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.4703476482617587, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.695854680950163, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.865234375, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.8305084745762712, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.6556291390728477, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.8850574712643678, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.5182481751824818, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6857142857142857, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7128342245989305, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.5661157024793388, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.513622603430878, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.8520761245674741, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.695854680950163, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.5969655535929207, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.79291710887529 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/1c/1c779b0269e213cd4430fb1a2449b8eee4f9af5d3326082b46c4ff1c595bf0da/e74-unexplained-train-orbi-noenergy.log b/shared/package-files/1c/1c779b0269e213cd4430fb1a2449b8eee4f9af5d3326082b46c4ff1c595bf0da/e74-unexplained-train-orbi-noenergy.log new file mode 100644 index 0000000000000000000000000000000000000000..4dad826f1ce35d1b1f1dde02746783aad2210b84 --- /dev/null +++ b/shared/package-files/1c/1c779b0269e213cd4430fb1a2449b8eee4f9af5d3326082b46c4ff1c595bf0da/e74-unexplained-train-orbi-noenergy.log @@ -0,0 +1,10 @@ +== [M+H]+ Orbitrap energy=no: 11675 spectra, with unexplained peaks 10664; unexplained share 0.289; of it +1.00335 above a stronger peak 0.044, control +1.0237 0.004 +unexplained - explained (Da: share of pair weight, explained-explained share of the same bin): + +0.136: 0.0036 (0.0003); +0.128: 0.0035 (0.0003); +0.166: 0.0033 (0.0003); +0.158: 0.0031 (0.0003); +0.196: 0.0030 (0.0001); +0.174: 0.0029 (0.0002); +0.144: 0.0029 (0.0004); +0.008: 0.0029 (0.0010); -0.090: 0.0029 (0.0002); +1.004: 0.0028 (0.0001); -0.098: 0.0028 (0.0004); -0.076: 0.0028 (0.0003); +0.090: 0.0027 (0.0003); +0.106: 0.0027 (0.0004); +0.234: 0.0027 (0.0000); +0.098: 0.0026 (0.0004); +0.204: 0.0026 (0.0002); +0.120: 0.0026 (0.0003); -0.068: 0.0025 (0.0005); +0.188: 0.0025 (0.0002); +0.150: 0.0025 (0.0002); -0.030: 0.0025 (0.0007); +0.076: 0.0024 (0.0003); +0.114: 0.0024 (0.0002) +precursor - unexplained (Da: share): + 18.012: 0.0038; 45.002: 0.0016; 18.000: 0.0014; 31.040: 0.0013; 46.000: 0.0012; 61.076: 0.0012; 57.060: 0.0012; 17.008: 0.0011; 18.016: 0.0010; 176.036: 0.0010; 1.014: 0.0009; 18.008: 0.0009; 17.006: 0.0009; 45.060: 0.0008; 28.000: 0.0008; 18.014: 0.0008; 18.018: 0.0008; 32.026: 0.0008; 94.016: 0.0007; 16.024: 0.0007; 134.072: 0.0007; 60.024: 0.0007; 68.066: 0.0007; 150.026: 0.0007 +== [M+Na]+ Orbitrap energy=no: 10933 spectra, with unexplained peaks 10326; unexplained share 0.615; of it +1.00335 above a stronger peak 0.029, control +1.0237 0.001 +unexplained - explained (Da: share of pair weight, explained-explained share of the same bin): + -21.982: 0.0064 (0.0021); +1.004: 0.0050 (0.0012); -1.004: 0.0045 (0.0022); +1.002: 0.0036 (0.0013); -1.006: 0.0034 (0.0035); -1.002: 0.0033 (0.0024); +1.006: 0.0031 (0.0030); +2.016: 0.0030 (0.0053); +14.016: 0.0028 (0.0064); +0.004: 0.0028 (0.0003); -14.014: 0.0026 (0.0040); +18.010: 0.0025 (0.0129); -27.994: 0.0025 (0.0067); +0.002: 0.0024 (0.0002); -2.014: 0.0022 (0.0033); +15.024: 0.0022 (0.0080); -23.998: 0.0021 (0.0013); -26.014: 0.0021 (0.0028); +1.008: 0.0020 (0.0137); +14.014: 0.0020 (0.0038); -11.998: 0.0019 (0.0014); -39.992: 0.0019 (0.0007); +2.014: 0.0019 (0.0033); +0.006: 0.0019 (0.0003) +precursor - unexplained (Da: share): + 21.980: 0.0093; 21.982: 0.0083; 21.984: 0.0073; 21.986: 0.0053; 21.978: 0.0045; 32.028: 0.0037; 28.032: 0.0031; 21.976: 0.0028; 154.228: 0.0025; 21.988: 0.0025; 65.974: 0.0024; 27.992: 0.0022; 55.992: 0.0021; 15.024: 0.0021; 200.082: 0.0020; 56.056: 0.0020; 70.002: 0.0020; 14.016: 0.0019; 118.228: 0.0017; 83.986: 0.0014; 15.026: 0.0014; 101.992: 0.0014; 43.020: 0.0014; 754.336: 0.0013 diff --git a/shared/package-files/1c/1cdaec009d6b592fc243d2f279ae1865f98c39a20541157547082c5708efce0a/prepare_inv.py b/shared/package-files/1c/1cdaec009d6b592fc243d2f279ae1865f98c39a20541157547082c5708efce0a/prepare_inv.py new file mode 100644 index 0000000000000000000000000000000000000000..8503717b4a019f2d45a0c49791e5a8f80f0dc9f6 --- /dev/null +++ b/shared/package-files/1c/1cdaec009d6b592fc243d2f279ae1865f98c39a20541157547082c5708efce0a/prepare_inv.py @@ -0,0 +1,301 @@ +#!/usr/bin/env python3 +"""Training/evaluation stores for the inverse branch (``pkg/inverse.py``). + +prepare_inv.py synth OUT_DIR [--sqlite /tmp/synth/subformulae.sqlite] + Supplied synthetic corpus: root formula = the corpus' ``cand_form``, peak sub-formulae = + the corpus' own assignment (identical to ``inverse.SubformulaTable`` at 20 ppm / 4 mDa, + see ``check_assign.py``), intensity = ``ms2_inten`` squared (as in ``prepare_synth.py``). +prepare_inv.py real OUT_DIR --fold train|validation + Experimental spectra of a labelled fold annotated under the LABEL formula (training + targets for train; a diagnostic only for validation). +prepare_inv.py pools OUT_DIR --input INPUT_ROOT + Inference-style store of a query set: every query annotated under every distinct + candidate formula of its pool, plus candidate fingerprints. Reads no label. + +Stores (npz): root int16 [N,E]; offset int64 [N+1]; peaks uint8 [T,E]; inten float32 [T] +(strongest first, at most ``inverse.MAX_PEAKS`` per spectrum); adduct, instrument uint8 [N]; +energy float32 [N] (NaN = not recorded); mol int32 [N] -> fps uint8 [M,512]. +""" +import argparse +import csv +import hashlib +import json +import multiprocessing +import re +import sqlite3 +import sys +import time +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +import inverse +import invrun + +DATA = Path('/workspace/data') +LABELS = DATA / 'synthetic_augmentation' / 'labels.tsv' +ENERGY = re.compile(r'_ev-(\d+(?:\.\d+)?)$') +PPM, FLOOR = invrun.PPM, invrun.FLOOR +STATE = {} + + +def digest(path): + h = hashlib.sha256() + with Path(path).open('rb') as f: + for block in iter(lambda: f.read(8 * 1024 * 1024), b''): + h.update(block) + return h.hexdigest() + + +instrument_index = invrun.instrument_index + + +def fingerprint_chunk(chunk): + from rdkit import Chem, RDLogger + RDLogger.DisableLog('rdApp.*') + out = [] + for smiles in chunk: + mol = Chem.MolFromSmiles(smiles) + if mol is None: + out.append(None) + continue + formula = inverse.mol_formula(mol) + out.append(None if formula is None else (inverse.fingerprint(mol), formula, Chem.GetFormalCharge(mol))) + return out + + +def fingerprints(smiles_list, workers): + chunks = [smiles_list[i:i + 2000] for i in range(0, len(smiles_list), 2000)] + with multiprocessing.Pool(workers) as pool: + return [d for part in pool.imap(fingerprint_chunk, chunks, chunksize=1) for d in part] + + +def save(out, name, rows, fps, extra): + """rows: list of (root, peaks, inten, adduct, instrument, energy, mol).""" + counts = np.array([len(r[2]) for r in rows], dtype=np.int64) + np.savez(out / name, + root=np.stack([r[0] for r in rows]).astype(np.int16), + offset=np.concatenate([[0], np.cumsum(counts)]), + peaks=np.concatenate([r[1] for r in rows]).astype(np.uint8), + inten=np.concatenate([r[2] for r in rows]).astype(np.float32), + adduct=np.array([r[3] for r in rows], dtype=np.uint8), + instrument=np.array([r[4] for r in rows], dtype=np.uint8), + energy=np.array([r[5] for r in rows], dtype=np.float32), + mol=np.array([r[6] for r in rows], dtype=np.int32), + fps=fps, **extra) + + +# -------------------------------------------------------------------------- +# synthetic corpus +# -------------------------------------------------------------------------- + +def extract_synth(job): + low, high = job + db = sqlite3.connect(f"file:{STATE['sqlite']}?mode=ro", uri=True) + cache = {} + names, roots, adducts, counts, peaks, intens = [], [], [], [], [], [] + for spec, payload in db.execute('SELECT spec, payload FROM subformulae WHERE spec >= ? AND spec < ? ORDER BY spec', + (low, high)): + data = json.loads(payload) + table = data.get('output_tbl') + root = inverse.parse_formula(data['cand_form']) + if not table or root is None or data['cand_ion'] not in inverse.ADDUCTS: + continue + inten = np.asarray(table['ms2_inten'], dtype=np.float64) ** 2 + order = np.argsort(-inten, kind='stable')[:inverse.MAX_PEAKS] + rows = [] + for k in order: + text = table['formula'][k] + vec = cache.get(text) + if vec is None: + vec = cache[text] = inverse.parse_formula(text) + rows.append(vec) + if not rows or any(v is None for v in rows): + continue + inten = inten[order] / inten[order].max() + names.append(spec) + roots.append(root) + adducts.append(inverse.ADDUCTS.index(data['cand_ion'])) + counts.append(len(rows)) + peaks.append(np.minimum(np.stack(rows), 255).astype(np.uint8)) + intens.append(inten.astype(np.float32)) + db.close() + return (names, np.stack(roots).astype(np.int16), np.array(adducts, dtype=np.uint8), np.array(counts, dtype=np.int32), + np.concatenate(peaks), np.concatenate(intens)) + + +def run_synth(args): + started = time.monotonic() + STATE['sqlite'] = str(args.sqlite) + labels, smiles_list, smiles_index = {}, [], {} + with LABELS.open() as stream: + for row in csv.DictReader(stream, delimiter='\t'): + index = smiles_index.get(row['smiles']) + if index is None: + index = smiles_index[row['smiles']] = len(smiles_list) + smiles_list.append(row['smiles']) + energy = ENERGY.search(row['spec']) + labels[row['spec']] = (index, instrument_index(row['instrument']), float(energy.group(1)) if energy else float('nan')) + described = fingerprints(smiles_list, args.workers) + print(json.dumps({'labels': len(labels), 'label_smiles': len(smiles_list), + 'described': sum(d is not None for d in described), 'seconds': time.monotonic() - started}), flush=True) + prefixes = sorted({name.rsplit('_', 4)[0] for name in labels}) + jobs = [(prefix + token, prefix + token[:-1] + '`') for prefix in prefixes for token in ('_Orbitrap_', '_QTOF_')] + with multiprocessing.Pool(args.workers) as pool: + parts = pool.map(extract_synth, jobs, chunksize=1) + print(json.dumps({'payloads_kept': sum(len(p[0]) for p in parts), 'seconds': time.monotonic() - started}), flush=True) + slot_of, fps = {}, [] + root, adduct, instrument, energy, mol, counts, peaks, inten = [], [], [], [], [], [], [], [] + skipped = {'structure': 0, 'formula_mismatch': 0} + for names, part_root, part_adduct, part_counts, part_peaks, part_inten in parts: + keep = np.zeros(len(names), dtype=bool) + for i, name in enumerate(names): + index, ins, ev = labels[name] + info = described[index] + if info is None: + skipped['structure'] += 1 + continue + if not np.array_equal(info[1], part_root[i]): + skipped['formula_mismatch'] += 1 + continue + slot = slot_of.get(index) + if slot is None: + slot = slot_of[index] = len(fps) + fps.append(info[0]) + keep[i] = True + instrument.append(ins) + energy.append(ev) + mol.append(slot) + root.append(part_root[keep]) + adduct.append(part_adduct[keep]) + counts.append(part_counts[keep]) + mask = np.repeat(keep, part_counts) + peaks.append(part_peaks[mask]) + inten.append(part_inten[mask]) + counts = np.concatenate(counts) + args.output.mkdir(parents=True, exist_ok=True) + np.savez(args.output / 'synth.npz', root=np.concatenate(root), offset=np.concatenate([[0], np.cumsum(counts, dtype=np.int64)]), + peaks=np.concatenate(peaks), inten=np.concatenate(inten), adduct=np.concatenate(adduct), + instrument=np.array(instrument, dtype=np.uint8), energy=np.array(energy, dtype=np.float32), + mol=np.array(mol, dtype=np.int32), fps=np.stack(fps)) + manifest = {'schema': 'allcond-inverse-synth/v1', 'spectra': int(len(counts)), 'structures': len(fps), + 'peaks': int(counts.sum()), 'skipped': skipped, 'max_peaks': inverse.MAX_PEAKS, + 'intensity': 'ms2_inten squared, max scaled to 1', 'sources': {'labels.tsv': digest(LABELS)}, + 'sha256': digest(args.output / 'synth.npz'), 'elapsed_seconds': time.monotonic() - started} + (args.output / 'synth.manifest.json').write_text(json.dumps(manifest, indent=1) + '\n') + print(json.dumps(manifest, indent=1)) + + +# -------------------------------------------------------------------------- +# labelled experimental folds (label formula) +# -------------------------------------------------------------------------- + +def annotate_real_chunk(chunk): + out = [] + tables = {} + for row, formula in chunk: + key = formula.tobytes() + table = tables.get(key) + if table is None: + if len(tables) > 64: + tables.clear() + table = tables[key] = inverse.SubformulaTable(formula) + mz, inten = inverse.select_peaks(row['mzs'], row['intensities']) + peaks, kept = inverse.annotate(table, mz, inten, row['adduct'], PPM, FLOOR) + out.append((peaks, kept, len(mz), float(inten.sum()), float(kept.sum()))) + return out + + +def run_real(args): + started = time.monotonic() + path = DATA / f'{args.fold}.jsonl' + rows = [json.loads(line) for line in path.open()] + smiles_list, smiles_index = [], {} + for row in rows: + if row['target_smiles'] not in smiles_index: + smiles_index[row['target_smiles']] = len(smiles_list) + smiles_list.append(row['target_smiles']) + described = fingerprints(smiles_list, args.workers) + jobs, kept_rows, skipped = [], [], {'structure': 0, 'adduct': 0} + for i, row in enumerate(rows): + info = described[smiles_index[row['target_smiles']]] + if info is None: + skipped['structure'] += 1 + elif row['adduct'] not in inverse.ADDUCTS: + skipped['adduct'] += 1 + else: + jobs.append(({k: row[k] for k in ('mzs', 'intensities', 'adduct')}, info[1])) + kept_rows.append(i) + chunks = [jobs[i:i + 500] for i in range(0, len(jobs), 500)] + with multiprocessing.Pool(args.workers) as pool: + annotated = [a for part in pool.imap(annotate_real_chunk, chunks, chunksize=1) for a in part] + slot_of, fps, out = {}, [], [] + for i, (peaks, inten, _, _, _) in zip(kept_rows, annotated): + row = rows[i] + index = smiles_index[row['target_smiles']] + slot = slot_of.get(index) + if slot is None: + slot = slot_of[index] = len(fps) + fps.append(described[index][0]) + energy = row['collision_energy'] + out.append((described[index][1], peaks, inten, inverse.ADDUCTS.index(row['adduct']), + instrument_index(row['instrument_type']), float('nan') if energy is None else float(energy), slot)) + args.output.mkdir(parents=True, exist_ok=True) + name = f'real-{args.fold}.npz' + save(args.output, name, out, np.stack(fps), {'row': np.array(kept_rows, dtype=np.int64)}) + selected = np.array([a[2] for a in annotated]) + total = np.array([a[3] for a in annotated]) + explained = np.array([a[4] for a in annotated]) + manifest = {'schema': 'allcond-inverse-real/v1', 'fold': args.fold, 'spectra': len(out), 'structures': len(fps), + 'skipped': skipped, 'ppm': PPM, 'floor': FLOOR, 'max_peaks': inverse.MAX_PEAKS, + 'mean_selected_peaks': float(selected.mean()), 'mean_annotated_peaks': float(np.mean([len(a[1]) for a in annotated])), + 'no_annotated_peak': int(sum(len(a[1]) == 0 for a in annotated)), + 'mean_explained_intensity': float(np.mean(explained / np.maximum(total, 1e-9))), + 'source_sha256': digest(path), 'sha256': digest(args.output / name), + 'elapsed_seconds': time.monotonic() - started} + (args.output / f'real-{args.fold}.manifest.json').write_text(json.dumps(manifest, indent=1) + '\n') + print(json.dumps(manifest, indent=1)) + + +# -------------------------------------------------------------------------- +# inference-style store: queries x distinct candidate formulae +# -------------------------------------------------------------------------- + +def run_pools(args): + started = time.monotonic() + queries = [json.loads(line) for line in (args.input / 'queries.jsonl').open()] + pools = {} + for line in (args.input / 'candidate_pools.jsonl').open(): + pool = json.loads(line) + pools[pool['candidate_pool_id']] = pool['candidates'] + store = invrun.build_store(queries, pools, args.workers) + args.output.mkdir(parents=True, exist_ok=True) + name = f'pools-{args.input.name}.npz' + np.savez(args.output / name, **store) + manifest = {'schema': 'allcond-inverse-pools/v1', 'input': str(args.input), 'queries': len(queries), + 'pools': len(store['pool_id']), 'pairs': int(len(store['offset']) - 1), + 'distinct_formulae': int(store['pool_formula_start'][-1]), 'candidates': int(store['pool_cand_start'][-1]), + 'unsupported_candidates': int((store['cand_formula'] < 0).sum()), + 'mean_annotated_peaks': float(np.diff(store['offset']).mean()), 'ppm': PPM, 'floor': FLOOR, + 'query_sha256': digest(args.input / 'queries.jsonl'), 'sha256': digest(args.output / name), + 'elapsed_seconds': time.monotonic() - started} + (args.output / f'pools-{args.input.name}.manifest.json').write_text(json.dumps(manifest, indent=1) + '\n') + print(json.dumps(manifest, indent=1)) + + +def main(): + p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + p.add_argument('mode', choices=['synth', 'real', 'pools']) + p.add_argument('output', type=Path) + p.add_argument('--sqlite', type=Path, default=Path('/tmp/synth/subformulae.sqlite')) + p.add_argument('--fold', default='train') + p.add_argument('--input', type=Path) + p.add_argument('--workers', type=int, default=11) + args = p.parse_args() + {'synth': run_synth, 'real': run_real, 'pools': run_pools}[args.mode](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/22/2229e517381cf87046e431cae8abff14fb5e32484fa8a6b03c500faef0c05fb4/metrics.jsonl b/shared/package-files/22/2229e517381cf87046e431cae8abff14fb5e32484fa8a6b03c500faef0c05fb4/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..51aaebaad3877ad15144f4ae1137b1130e4d03d1 --- /dev/null +++ b/shared/package-files/22/2229e517381cf87046e431cae8abff14fb5e32484fa8a6b03c500faef0c05fb4/metrics.jsonl @@ -0,0 +1,300 @@ +{"step": 100, "epoch": 0, "elapsed_seconds": 93.11415614304133, "train_loss": 1.8059997153282166, "lr": 1.9508230199714393e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.8946024179458618, "train_magma_inten_loss": 0.7657176852226257, "train_frag_loss": 7.2046308517456055, "train_loss": 1.4861807823181152}} +{"step": 200, "epoch": 0, "elapsed_seconds": 118.46230287605431, "train_loss": 1.3910854482650756, "lr": 3.80650327856162e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.9042806029319763, "train_magma_inten_loss": 0.7540241479873657, "train_frag_loss": 6.200036525726318, "train_loss": 1.3740277290344238}} +{"step": 300, "epoch": 0, "elapsed_seconds": 153.94541353499517, "train_loss": 1.2958072245121002, "lr": 5.571680942997688e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.8657864332199097, "train_magma_inten_loss": 0.7181433439254761, "train_frag_loss": 5.3348212242126465, "train_loss": 1.2516255378723145}} +{"step": 400, "epoch": 0, "elapsed_seconds": 193.73515307705384, "train_loss": 1.1883221697807311, "lr": 7.250769876880728e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7953676581382751, "train_magma_inten_loss": 0.6295595169067383, "train_frag_loss": 5.136037826538086, "train_loss": 1.1431633234024048}} +{"step": 500, "epoch": 0, "elapsed_seconds": 233.45409189304337, "train_loss": 1.0917471712827682, "lr": 8.847968677143805e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7149209976196289, "train_magma_inten_loss": 0.5960277318954468, "train_frag_loss": 5.611949920654297, "train_loss": 1.1572227478027344}} +{"step": 600, "epoch": 0, "elapsed_seconds": 273.58223095699213, "train_loss": 1.0471038019657135, "lr": 0.00010367271172731286, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6648051738739014, "train_magma_inten_loss": 0.5064797401428223, "train_frag_loss": 3.764711618423462, "train_loss": 0.8829509019851685}} +{"step": 700, "epoch": 0, "elapsed_seconds": 313.1747474380536, "train_loss": 1.008434857726097, "lr": 0.00011812476411251463, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7292327880859375, "train_magma_inten_loss": 0.620678186416626, "train_frag_loss": 4.807349681854248, "train_loss": 1.1014131307601929}} +{"step": 800, "epoch": 0, "elapsed_seconds": 352.5040598480264, "train_loss": 0.9941985195875168, "lr": 0.00013187198158574428, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6655956506729126, "train_magma_inten_loss": 0.518310010433197, "train_frag_loss": 4.640652179718018, "train_loss": 0.9823752641677856}} +{"step": 900, "epoch": 0, "elapsed_seconds": 390.86950981698465, "train_loss": 0.9809768891334534, "lr": 0.00014494873935129066, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6218172311782837, "train_magma_inten_loss": 0.4952813982963562, "train_frag_loss": 4.684747695922852, "train_loss": 0.9637562036514282}} +{"step": 1000, "epoch": 0, "elapsed_seconds": 423.71575273398776, "train_loss": 0.9725760209560395, "lr": 0.00015738773611494663, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6512727737426758, "train_magma_inten_loss": 0.5426249504089355, "train_frag_loss": 4.875405311584473, "train_loss": 1.030165433883667}} +{"step": 1100, "epoch": 0, "elapsed_seconds": 453.3523472889792, "train_loss": 0.9510481494665146, "lr": 0.00016922007584780534, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.676098644733429, "train_magma_inten_loss": 0.5854042768478394, "train_frag_loss": 4.748208522796631, "train_loss": 1.0602251291275024}} +{"step": 1200, "epoch": 0, "elapsed_seconds": 487.4153915310744, "train_loss": 0.9230020540952683, "lr": 0.00018047534556238945, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5798729658126831, "train_magma_inten_loss": 0.5453187227249146, "train_frag_loss": 4.2654643058776855, "train_loss": 0.971865177154541}} +{"step": 1300, "epoch": 0, "elapsed_seconds": 521.8013487110147, "train_loss": 0.9379134130477905, "lr": 0.0001911816892955936, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.705707311630249, "train_magma_inten_loss": 0.5631601810455322, "train_frag_loss": 4.032994747161865, "train_loss": 0.9664596319198608}} +{"step": 1400, "epoch": 0, "elapsed_seconds": 556.0871227070456, "train_loss": 0.9268297898769379, "lr": 0.0002013658784834362, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6422141194343567, "train_magma_inten_loss": 0.5202873945236206, "train_frag_loss": 4.5466718673706055, "train_loss": 0.9749546051025391}} +{"step": 1500, "epoch": 0, "elapsed_seconds": 583.7377264340175, "train_loss": 0.9169996982812881, "lr": 0.00021105337890359413, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6358562707901001, "train_magma_inten_loss": 0.5018295645713806, "train_frag_loss": 4.236950397491455, "train_loss": 0.9255245923995972}} +{"step": 1600, "epoch": 0, "elapsed_seconds": 609.4435106080491, "train_loss": 0.8950190246105194, "lr": 0.0002202684143531114, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5840342044830322, "train_magma_inten_loss": 0.442658007144928, "train_frag_loss": 3.814802885055542, "train_loss": 0.8241382837295532}} +{"step": 1700, "epoch": 0, "elapsed_seconds": 637.7495044040261, "train_loss": 0.8931854522228241, "lr": 0.00022903402722050932, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.575722873210907, "train_magma_inten_loss": 0.4730309844017029, "train_frag_loss": 3.7474818229675293, "train_loss": 0.8477791547775269}} +{"step": 1800, "epoch": 0, "elapsed_seconds": 665.8431213130243, "train_loss": 0.8991113078594207, "lr": 0.00023737213610376036, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.664933979511261, "train_magma_inten_loss": 0.5337307453155518, "train_frag_loss": 3.678361177444458, "train_loss": 0.9015668630599976}} +{"step": 1900, "epoch": 0, "elapsed_seconds": 693.1032023610314, "train_loss": 0.8781105852127076, "lr": 0.0002453035906181995, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5821422338485718, "train_magma_inten_loss": 0.49437710642814636, "train_frag_loss": 3.610637903213501, "train_loss": 0.8554409146308899}} +{"step": 2000, "epoch": 0, "elapsed_seconds": 720.0702658260707, "train_loss": 0.8674806213378906, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5773441791534424, "train_magma_inten_loss": 0.505662202835083, "train_frag_loss": 4.161020755767822, "train_loss": 0.9217642545700073}} +{"step": 2100, "epoch": 0, "elapsed_seconds": 798.9602557640756, "train_loss": 0.896078879237175, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5752276182174683, "train_magma_inten_loss": 0.44224390387535095, "train_frag_loss": 3.887611150741577, "train_loss": 0.8310050368309021}} +{"step": 2200, "epoch": 0, "elapsed_seconds": 819.305203084019, "train_loss": 0.8962298184633255, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5887744426727295, "train_magma_inten_loss": 0.47527429461479187, "train_frag_loss": 3.3932836055755615, "train_loss": 0.8146026730537415}} +{"step": 2300, "epoch": 0, "elapsed_seconds": 839.2905666220468, "train_loss": 0.8699680906534195, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.679273247718811, "train_magma_inten_loss": 0.5673850178718567, "train_frag_loss": 3.960893154144287, "train_loss": 0.9634743332862854}} +{"step": 2400, "epoch": 0, "elapsed_seconds": 859.5467970740283, "train_loss": 0.8662934440374375, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6508983373641968, "train_magma_inten_loss": 0.5405307412147522, "train_frag_loss": 3.5205371379852295, "train_loss": 0.8925844430923462}} +{"step": 2500, "epoch": 0, "elapsed_seconds": 881.6711023930693, "train_loss": 0.8573305863142013, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6555650234222412, "train_magma_inten_loss": 0.5417253971099854, "train_frag_loss": 3.4350457191467285, "train_loss": 0.8852299451828003}} +{"step": 2600, "epoch": 0, "elapsed_seconds": 903.7271274590166, "train_loss": 0.8464039158821106, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4787963032722473, "train_magma_inten_loss": 0.40971678495407104, "train_frag_loss": 3.257972478866577, "train_loss": 0.7355140447616577}} +{"step": 2700, "epoch": 0, "elapsed_seconds": 925.6733612311073, "train_loss": 0.8440383464097977, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6882138252258301, "train_magma_inten_loss": 0.571563184261322, "train_frag_loss": 3.461150646209717, "train_loss": 0.9176782369613647}} +{"step": 2800, "epoch": 0, "elapsed_seconds": 947.8967094940599, "train_loss": 0.8417361581325531, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5515886545181274, "train_magma_inten_loss": 0.4088936746120453, "train_frag_loss": 3.1368932723999023, "train_loss": 0.722582995891571}} +{"step": 2900, "epoch": 0, "elapsed_seconds": 970.7202956500696, "train_loss": 0.8430289119482041, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5879851579666138, "train_magma_inten_loss": 0.47874340415000916, "train_frag_loss": 3.944680690765381, "train_loss": 0.8732115030288696}} +{"step": 3000, "epoch": 0, "elapsed_seconds": 992.8234804950189, "train_loss": 0.8463692766427994, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6579149961471558, "train_magma_inten_loss": 0.5026803016662598, "train_frag_loss": 3.4925966262817383, "train_loss": 0.8519399762153625}} +{"step": 3100, "epoch": 0, "elapsed_seconds": 1014.7010665680282, "train_loss": 0.8345599067211151, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5609737634658813, "train_magma_inten_loss": 0.4304672181606293, "train_frag_loss": 3.0845327377319336, "train_loss": 0.7389205098152161}} +{"step": 3200, "epoch": 0, "elapsed_seconds": 1034.1023121700855, "train_loss": 0.8349987268447876, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6210103034973145, "train_magma_inten_loss": 0.48865509033203125, "train_frag_loss": 3.0622687339782715, "train_loss": 0.7948819398880005}} +{"step": 3300, "epoch": 0, "elapsed_seconds": 1053.0696759980638, "train_loss": 0.8290480178594589, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6361576914787292, "train_magma_inten_loss": 0.4806745946407318, "train_frag_loss": 3.2945895195007324, "train_loss": 0.8101335763931274}} +{"step": 3400, "epoch": 0, "elapsed_seconds": 1074.4763368930435, "train_loss": 0.8133710545301437, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49356672167778015, "train_magma_inten_loss": 0.39780911803245544, "train_frag_loss": 2.9974000453948975, "train_loss": 0.6975491046905518}} +{"step": 3500, "epoch": 0, "elapsed_seconds": 1095.857839264092, "train_loss": 0.8038298028707505, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5396087169647217, "train_magma_inten_loss": 0.5165929198265076, "train_frag_loss": 3.219604969024658, "train_loss": 0.8385534286499023}} +{"step": 3600, "epoch": 0, "elapsed_seconds": 1123.0699364240281, "train_loss": 0.8215945851802826, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7147858142852783, "train_magma_inten_loss": 0.5898762941360474, "train_frag_loss": 3.6069047451019287, "train_loss": 0.9505667686462402}} +{"step": 3700, "epoch": 0, "elapsed_seconds": 1144.2446994740749, "train_loss": 0.809402140378952, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5713751316070557, "train_magma_inten_loss": 0.40116775035858154, "train_frag_loss": 3.4765591621398926, "train_loss": 0.7488236427307129}} +{"step": 3800, "epoch": 0, "elapsed_seconds": 1165.043713019113, "train_loss": 0.8055038642883301, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49633854627609253, "train_magma_inten_loss": 0.36913979053497314, "train_frag_loss": 3.1885581016540527, "train_loss": 0.6879956126213074}} +{"step": 3900, "epoch": 0, "elapsed_seconds": 1185.4255642800126, "train_loss": 0.809414724111557, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4975321292877197, "train_magma_inten_loss": 0.4073721766471863, "train_frag_loss": 3.636625051498413, "train_loss": 0.7710347175598145}} +{"step": 4000, "epoch": 0, "elapsed_seconds": 1205.2122335580643, "train_loss": 0.8118257957696915, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5779180526733398, "train_magma_inten_loss": 0.4547852575778961, "train_frag_loss": 3.205920696258545, "train_loss": 0.7753773331642151}} +{"step": 4100, "epoch": 0, "elapsed_seconds": 1225.4244774570689, "train_loss": 0.7907622015476227, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5018936991691589, "train_magma_inten_loss": 0.3471617102622986, "train_frag_loss": 2.431666851043701, "train_loss": 0.5903283953666687}} +{"step": 4200, "epoch": 0, "elapsed_seconds": 1245.7751174250152, "train_loss": 0.796233057975769, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6455370187759399, "train_magma_inten_loss": 0.49284952878952026, "train_frag_loss": 3.55613374710083, "train_loss": 0.8484629392623901}} +{"step": 4300, "epoch": 0, "elapsed_seconds": 1264.4190242440673, "train_loss": 0.783756811618805, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6134688854217529, "train_magma_inten_loss": 0.48678380250930786, "train_frag_loss": 3.411036491394043, "train_loss": 0.8278874158859253}} +{"step": 4400, "epoch": 0, "elapsed_seconds": 1286.8002478281269, "train_loss": 0.7962261462211608, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5880453586578369, "train_magma_inten_loss": 0.4871971011161804, "train_frag_loss": 4.022994041442871, "train_loss": 0.8894965052604675}} +{"step": 4500, "epoch": 0, "elapsed_seconds": 1311.876414702041, "train_loss": 0.7921220827102661, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5502345561981201, "train_magma_inten_loss": 0.41557496786117554, "train_frag_loss": 3.8456289768218994, "train_loss": 0.8001378774642944}} +{"step": 4600, "epoch": 0, "elapsed_seconds": 1337.5106019551167, "train_loss": 0.7903547543287277, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6306752562522888, "train_magma_inten_loss": 0.49470728635787964, "train_frag_loss": 3.143920660018921, "train_loss": 0.8090993165969849}} +{"step": 4700, "epoch": 0, "elapsed_seconds": 1363.6308854240924, "train_loss": 0.778508978486061, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5639557242393494, "train_magma_inten_loss": 0.4200182557106018, "train_frag_loss": 3.4505226612091064, "train_loss": 0.7650705575942993}} +{"step": 4800, "epoch": 0, "elapsed_seconds": 1390.8863402890274, "train_loss": 0.7824116820096969, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5987224578857422, "train_magma_inten_loss": 0.5099536180496216, "train_frag_loss": 3.6004889011383057, "train_loss": 0.8700025081634521}} +{"step": 4900, "epoch": 0, "elapsed_seconds": 1421.483692750102, "train_loss": 0.7773028475046158, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5126916170120239, "train_magma_inten_loss": 0.3987816572189331, "train_frag_loss": 2.9747462272644043, "train_loss": 0.6962562799453735}} +{"step": 5000, "epoch": 0, "elapsed_seconds": 1444.6998637880897, "train_loss": 0.7675675147771835, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5244914889335632, "train_magma_inten_loss": 0.37251946330070496, "train_frag_loss": 3.305764675140381, "train_loss": 0.6852355003356934}} +{"step": 5100, "epoch": 0, "elapsed_seconds": 1529.7323861080222, "train_loss": 0.7443508213758468, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5015935897827148, "train_magma_inten_loss": 0.4337930381298065, "train_frag_loss": 3.3901939392089844, "train_loss": 0.7456905841827393, "val_loss": 0.6603178381919861}} +{"step": 5200, "epoch": 0, "elapsed_seconds": 1548.993349319091, "train_loss": 0.7419103717803955, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.542816162109375, "train_magma_inten_loss": 0.4289730191230774, "train_frag_loss": 2.8663482666015625, "train_loss": 0.6983286738395691, "val_loss": 0.6603178381919861}} +{"step": 5300, "epoch": 0, "elapsed_seconds": 1572.7992943830322, "train_loss": 0.7288772994279862, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5665894150733948, "train_magma_inten_loss": 0.47545701265335083, "train_frag_loss": 3.474449396133423, "train_loss": 0.7972707152366638, "val_loss": 0.6603178381919861}} +{"step": 5400, "epoch": 0, "elapsed_seconds": 1598.0894733160967, "train_loss": 0.7336851328611373, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5440919399261475, "train_magma_inten_loss": 0.45421484112739563, "train_frag_loss": 3.1573071479797363, "train_loss": 0.7473602294921875, "val_loss": 0.6603178381919861}} +{"step": 5500, "epoch": 0, "elapsed_seconds": 1623.7749558230862, "train_loss": 0.7412242716550828, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5729490518569946, "train_magma_inten_loss": 0.44235116243362427, "train_frag_loss": 2.889103889465332, "train_loss": 0.7154302597045898, "val_loss": 0.6603178381919861}} +{"step": 5600, "epoch": 0, "elapsed_seconds": 1650.0659223990515, "train_loss": 0.7321299105882645, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4077262282371521, "train_magma_inten_loss": 0.3365393579006195, "train_frag_loss": 3.1330814361572266, "train_loss": 0.6256353855133057, "val_loss": 0.6603178381919861}} +{"step": 5700, "epoch": 0, "elapsed_seconds": 1677.3350509951124, "train_loss": 0.7306518709659576, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5567598342895508, "train_magma_inten_loss": 0.4266836941242218, "train_frag_loss": 3.108579158782959, "train_loss": 0.7194634675979614, "val_loss": 0.6603178381919861}} +{"step": 5800, "epoch": 0, "elapsed_seconds": 1709.2755957570625, "train_loss": 0.7283621597290039, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41026920080184937, "train_magma_inten_loss": 0.32676589488983154, "train_frag_loss": 3.358269453048706, "train_loss": 0.6373604536056519, "val_loss": 0.6603178381919861}} +{"step": 5900, "epoch": 0, "elapsed_seconds": 1729.0313367730705, "train_loss": 0.7281289458274841, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6005568504333496, "train_magma_inten_loss": 0.526229977607727, "train_frag_loss": 3.508511543273926, "train_loss": 0.8494287729263306, "val_loss": 0.6603178381919861}} +{"step": 6000, "epoch": 1, "elapsed_seconds": 1806.7129308120348, "train_loss": 0.736555238366127, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5904554128646851, "train_magma_inten_loss": 0.5234458446502686, "train_frag_loss": 3.4109208583831787, "train_loss": 0.8371296525001526, "val_loss": 0.6603178381919861}} +{"step": 6100, "epoch": 1, "elapsed_seconds": 1825.7571559160715, "train_loss": 0.7226332366466522, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3827475309371948, "train_magma_inten_loss": 0.27794867753982544, "train_frag_loss": 3.014448642730713, "train_loss": 0.5597289800643921, "val_loss": 0.6603178381919861}} +{"step": 6200, "epoch": 1, "elapsed_seconds": 1844.3655811810168, "train_loss": 0.7277626794576645, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4819377660751343, "train_magma_inten_loss": 0.40575990080833435, "train_frag_loss": 3.0731730461120605, "train_loss": 0.6899632215499878, "val_loss": 0.6603178381919861}} +{"step": 6300, "epoch": 1, "elapsed_seconds": 1863.0973902210826, "train_loss": 0.7161262494325638, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45088377594947815, "train_magma_inten_loss": 0.3588753044605255, "train_frag_loss": 2.6355488300323486, "train_loss": 0.605275571346283, "val_loss": 0.6603178381919861}} +{"step": 6400, "epoch": 1, "elapsed_seconds": 1881.0126233410556, "train_loss": 0.7192488789558411, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5573015213012695, "train_magma_inten_loss": 0.47453752160072327, "train_frag_loss": 3.2866902351379395, "train_loss": 0.7786160707473755, "val_loss": 0.6603178381919861}} +{"step": 6500, "epoch": 1, "elapsed_seconds": 1899.761878762045, "train_loss": 0.7211046898365021, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.480101615190506, "train_magma_inten_loss": 0.3914995789527893, "train_frag_loss": 3.2768712043762207, "train_loss": 0.6952781677246094, "val_loss": 0.6603178381919861}} +{"step": 6600, "epoch": 1, "elapsed_seconds": 1920.842125758063, "train_loss": 0.7232139670848846, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4916656017303467, "train_magma_inten_loss": 0.41962945461273193, "train_frag_loss": 3.4345216751098633, "train_loss": 0.7359400391578674, "val_loss": 0.6603178381919861}} +{"step": 6700, "epoch": 1, "elapsed_seconds": 1938.9472263420466, "train_loss": 0.7247811138629914, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5319259166717529, "train_magma_inten_loss": 0.43738049268722534, "train_frag_loss": 3.0738918781280518, "train_loss": 0.7234852910041809, "val_loss": 0.6603178381919861}} +{"step": 6800, "epoch": 1, "elapsed_seconds": 1957.6304822040256, "train_loss": 0.7157949769496917, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5032713413238525, "train_magma_inten_loss": 0.42034050822257996, "train_frag_loss": 3.274784564971924, "train_loss": 0.7233642339706421, "val_loss": 0.6603178381919861}} +{"step": 6900, "epoch": 1, "elapsed_seconds": 1975.512685075053, "train_loss": 0.7236279702186584, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6062614917755127, "train_magma_inten_loss": 0.46532198786735535, "train_frag_loss": 3.4015679359436035, "train_loss": 0.7855570316314697, "val_loss": 0.6603178381919861}} +{"step": 7000, "epoch": 1, "elapsed_seconds": 1993.2234984490788, "train_loss": 0.7257109218835831, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4117739200592041, "train_magma_inten_loss": 0.2986178696155548, "train_frag_loss": 3.220919370651245, "train_loss": 0.5998162031173706, "val_loss": 0.6603178381919861}} +{"step": 7100, "epoch": 1, "elapsed_seconds": 2013.7278286740184, "train_loss": 0.7182488435506821, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4065350294113159, "train_magma_inten_loss": 0.34291040897369385, "train_frag_loss": 2.946779251098633, "train_loss": 0.6144829988479614, "val_loss": 0.6603178381919861}} +{"step": 7200, "epoch": 1, "elapsed_seconds": 2036.65248768311, "train_loss": 0.704605656862259, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5575954914093018, "train_magma_inten_loss": 0.48332756757736206, "train_frag_loss": 3.173373222351074, "train_loss": 0.7763579487800598, "val_loss": 0.6603178381919861}} +{"step": 7300, "epoch": 1, "elapsed_seconds": 2059.9226289680228, "train_loss": 0.7045807087421417, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4119129180908203, "train_magma_inten_loss": 0.367683470249176, "train_frag_loss": 2.8609771728515625, "train_loss": 0.6295943260192871, "val_loss": 0.6603178381919861}} +{"step": 7400, "epoch": 1, "elapsed_seconds": 2083.077088465099, "train_loss": 0.6948799049854278, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4363940954208374, "train_magma_inten_loss": 0.35677972435951233, "train_frag_loss": 3.084293842315674, "train_loss": 0.6423276662826538, "val_loss": 0.6603178381919861}} +{"step": 7500, "epoch": 1, "elapsed_seconds": 2106.43837311503, "train_loss": 0.7126457715034484, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.47555097937583923, "train_magma_inten_loss": 0.42582428455352783, "train_frag_loss": 3.0817065238952637, "train_loss": 0.684890627861023, "val_loss": 0.6603178381919861}} +{"step": 7600, "epoch": 1, "elapsed_seconds": 2129.9344090140657, "train_loss": 0.6794495397806167, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4297008812427521, "train_magma_inten_loss": 0.3748089671134949, "train_frag_loss": 2.83805251121521, "train_loss": 0.6151207089424133, "val_loss": 0.6603178381919861}} +{"step": 7700, "epoch": 1, "elapsed_seconds": 2153.2007608601125, "train_loss": 0.6665908193588257, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5424225330352783, "train_magma_inten_loss": 0.4548763632774353, "train_frag_loss": 2.72078275680542, "train_loss": 0.6918935775756836, "val_loss": 0.6603178381919861}} +{"step": 7800, "epoch": 1, "elapsed_seconds": 2176.7752640430117, "train_loss": 0.6832079190015793, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5402172803878784, "train_magma_inten_loss": 0.4114106297492981, "train_frag_loss": 3.352217197418213, "train_loss": 0.7074134945869446, "val_loss": 0.6603178381919861}} +{"step": 7900, "epoch": 1, "elapsed_seconds": 2200.147125918069, "train_loss": 0.6680972611904145, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5014158487319946, "train_magma_inten_loss": 0.42057380080223083, "train_frag_loss": 3.3478217124938965, "train_loss": 0.7071073055267334, "val_loss": 0.6603178381919861}} +{"step": 8000, "epoch": 1, "elapsed_seconds": 2223.9353901380673, "train_loss": 0.6715867030620575, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4934939742088318, "train_magma_inten_loss": 0.4315977096557617, "train_frag_loss": 3.0178866386413574, "train_loss": 0.6878068447113037, "val_loss": 0.6603178381919861}} +{"step": 8100, "epoch": 1, "elapsed_seconds": 2248.138297423022, "train_loss": 0.6615445381402969, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3852154016494751, "train_magma_inten_loss": 0.3166344165802002, "train_frag_loss": 2.7495651245117188, "train_loss": 0.5523796081542969, "val_loss": 0.6603178381919861}} +{"step": 8200, "epoch": 1, "elapsed_seconds": 2271.9530834690668, "train_loss": 0.6635142582654953, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45816248655319214, "train_magma_inten_loss": 0.3902040719985962, "train_frag_loss": 2.8050484657287598, "train_loss": 0.6303250789642334, "val_loss": 0.6603178381919861}} +{"step": 8300, "epoch": 1, "elapsed_seconds": 2295.5709473370807, "train_loss": 0.6670183372497559, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5324605107307434, "train_magma_inten_loss": 0.44521230459213257, "train_frag_loss": 3.25421142578125, "train_loss": 0.7253805994987488, "val_loss": 0.6603178381919861}} +{"step": 8400, "epoch": 1, "elapsed_seconds": 2319.5641456980957, "train_loss": 0.6683505207300187, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49401798844337463, "train_magma_inten_loss": 0.39529097080230713, "train_frag_loss": 3.539175510406494, "train_loss": 0.700722336769104, "val_loss": 0.6603178381919861}} +{"step": 8500, "epoch": 1, "elapsed_seconds": 2343.6131535770837, "train_loss": 0.6625465714931488, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45753079652786255, "train_magma_inten_loss": 0.3946998119354248, "train_frag_loss": 3.5272271633148193, "train_loss": 0.6923431158065796, "val_loss": 0.6603178381919861}} +{"step": 8600, "epoch": 1, "elapsed_seconds": 2367.5502173440764, "train_loss": 0.6573769694566727, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48033440113067627, "train_magma_inten_loss": 0.37511056661605835, "train_frag_loss": 3.1454029083251953, "train_loss": 0.6498807668685913, "val_loss": 0.6603178381919861}} +{"step": 8700, "epoch": 1, "elapsed_seconds": 2391.486622779048, "train_loss": 0.6614613687992096, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46597951650619507, "train_magma_inten_loss": 0.4199109375476837, "train_frag_loss": 3.1063523292541504, "train_loss": 0.6802785396575928, "val_loss": 0.6603178381919861}} +{"step": 8800, "epoch": 1, "elapsed_seconds": 2415.8315432301024, "train_loss": 0.6594767081737518, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4539000988006592, "train_magma_inten_loss": 0.35289230942726135, "train_frag_loss": 2.859424591064453, "train_loss": 0.6036971807479858, "val_loss": 0.6603178381919861}} +{"step": 8900, "epoch": 1, "elapsed_seconds": 2439.941717819078, "train_loss": 0.6710029798746109, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4672943949699402, "train_magma_inten_loss": 0.4298226535320282, "train_frag_loss": 2.798079013824463, "train_loss": 0.6635866761207581, "val_loss": 0.6603178381919861}} +{"step": 9000, "epoch": 1, "elapsed_seconds": 2464.346633300069, "train_loss": 0.6608721488714218, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5032092928886414, "train_magma_inten_loss": 0.42719322443008423, "train_frag_loss": 3.1503453254699707, "train_loss": 0.696814239025116, "val_loss": 0.6603178381919861}} +{"step": 9100, "epoch": 1, "elapsed_seconds": 2488.8761157250265, "train_loss": 0.6579614025354386, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3967028260231018, "train_magma_inten_loss": 0.3224649727344513, "train_frag_loss": 2.8651204109191895, "train_loss": 0.5686449408531189, "val_loss": 0.6603178381919861}} +{"step": 9200, "epoch": 1, "elapsed_seconds": 2512.714158866089, "train_loss": 0.6573616778850555, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5055595636367798, "train_magma_inten_loss": 0.451413094997406, "train_frag_loss": 3.1815757751464844, "train_loss": 0.7194085121154785, "val_loss": 0.6603178381919861}} +{"step": 9300, "epoch": 1, "elapsed_seconds": 2536.9010336240754, "train_loss": 0.6644879990816116, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3984280228614807, "train_magma_inten_loss": 0.31369003653526306, "train_frag_loss": 3.148080825805664, "train_loss": 0.5847848057746887, "val_loss": 0.6603178381919861}} +{"step": 9400, "epoch": 1, "elapsed_seconds": 2560.824569339049, "train_loss": 0.6556038588285447, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43736398220062256, "train_magma_inten_loss": 0.36863458156585693, "train_frag_loss": 3.0412139892578125, "train_loss": 0.6280314922332764, "val_loss": 0.6603178381919861}} +{"step": 9500, "epoch": 1, "elapsed_seconds": 2585.8801688490203, "train_loss": 0.6492501258850097, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.36857354640960693, "train_magma_inten_loss": 0.33522671461105347, "train_frag_loss": 2.7690086364746094, "train_loss": 0.5658523440361023, "val_loss": 0.6603178381919861}} +{"step": 9600, "epoch": 1, "elapsed_seconds": 2610.2234519240446, "train_loss": 0.6560132455825806, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.439020037651062, "train_magma_inten_loss": 0.3878531754016876, "train_frag_loss": 3.584951162338257, "train_loss": 0.687955915927887, "val_loss": 0.6603178381919861}} +{"step": 9700, "epoch": 1, "elapsed_seconds": 2634.2107384280534, "train_loss": 0.6428052359819412, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4284519851207733, "train_magma_inten_loss": 0.35135430097579956, "train_frag_loss": 2.809473991394043, "train_loss": 0.5935702323913574, "val_loss": 0.6603178381919861}} +{"step": 9800, "epoch": 1, "elapsed_seconds": 2659.1186808500206, "train_loss": 0.6504414945840835, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.523177444934845, "train_magma_inten_loss": 0.4295350909233093, "train_frag_loss": 3.4743595123291016, "train_loss": 0.7287502288818359, "val_loss": 0.6603178381919861}} +{"step": 9900, "epoch": 1, "elapsed_seconds": 2683.553946916014, "train_loss": 0.6445344370603562, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.36587145924568176, "train_magma_inten_loss": 0.3583366274833679, "train_frag_loss": 2.3705050945281982, "train_loss": 0.5517791509628296, "val_loss": 0.6603178381919861}} +{"step": 10000, "epoch": 1, "elapsed_seconds": 2708.506315391045, "train_loss": 0.6529034721851349, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49838975071907043, "train_magma_inten_loss": 0.4063224792480469, "train_frag_loss": 3.349869966506958, "train_loss": 0.6754782199859619, "val_loss": 0.6603178381919861}} +{"step": 10100, "epoch": 1, "elapsed_seconds": 2744.413484027027, "train_loss": 0.6245475727319717, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3545510470867157, "train_magma_inten_loss": 0.3159932792186737, "train_frag_loss": 2.5116560459136963, "train_loss": 0.5095421075820923, "val_loss": 0.6090918779373169}} +{"step": 10200, "epoch": 1, "elapsed_seconds": 2769.0774977790425, "train_loss": 0.6255454576015472, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4160252809524536, "train_magma_inten_loss": 0.3428165316581726, "train_frag_loss": 3.511577606201172, "train_loss": 0.6186500787734985, "val_loss": 0.6090918779373169}} +{"step": 10300, "epoch": 1, "elapsed_seconds": 2794.1076884060167, "train_loss": 0.6268207895755767, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5134772062301636, "train_magma_inten_loss": 0.39628303050994873, "train_frag_loss": 2.7735273838043213, "train_loss": 0.6302328109741211, "val_loss": 0.6090918779373169}} +{"step": 10400, "epoch": 1, "elapsed_seconds": 2819.347529492108, "train_loss": 0.6210998946428299, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45524388551712036, "train_magma_inten_loss": 0.3653676211833954, "train_frag_loss": 2.868741512298584, "train_loss": 0.5988553166389465, "val_loss": 0.6090918779373169}} +{"step": 10500, "epoch": 1, "elapsed_seconds": 2844.674475623062, "train_loss": 0.6300353392958641, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45740270614624023, "train_magma_inten_loss": 0.3685269355773926, "train_frag_loss": 2.9555253982543945, "train_loss": 0.6080700755119324, "val_loss": 0.6090918779373169}} +{"step": 10600, "epoch": 1, "elapsed_seconds": 2869.9681860470446, "train_loss": 0.6234898179769516, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5088046193122864, "train_magma_inten_loss": 0.4342576265335083, "train_frag_loss": 3.144591808319092, "train_loss": 0.6837005615234375, "val_loss": 0.6090918779373169}} +{"step": 10700, "epoch": 1, "elapsed_seconds": 2895.2006214000285, "train_loss": 0.6182791328430176, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4218740463256836, "train_magma_inten_loss": 0.35437479615211487, "train_frag_loss": 2.8495121002197266, "train_loss": 0.5803965330123901, "val_loss": 0.6090918779373169}} +{"step": 10800, "epoch": 1, "elapsed_seconds": 2921.1300210281042, "train_loss": 0.627929225564003, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5732302665710449, "train_magma_inten_loss": 0.47749412059783936, "train_frag_loss": 3.577214479446411, "train_loss": 0.7642174959182739, "val_loss": 0.6090918779373169}} +{"step": 10900, "epoch": 1, "elapsed_seconds": 2946.9848397220485, "train_loss": 0.6278187876939774, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42471933364868164, "train_magma_inten_loss": 0.37987780570983887, "train_frag_loss": 3.0617806911468506, "train_loss": 0.6152336597442627, "val_loss": 0.6090918779373169}} +{"step": 11000, "epoch": 1, "elapsed_seconds": 2973.0553183971206, "train_loss": 0.6241975101828575, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40475744009017944, "train_magma_inten_loss": 0.3587166965007782, "train_frag_loss": 2.609511613845825, "train_loss": 0.561427116394043, "val_loss": 0.6090918779373169}} +{"step": 11100, "epoch": 1, "elapsed_seconds": 2999.489955129102, "train_loss": 0.6239779376983643, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39359530806541443, "train_magma_inten_loss": 0.34321749210357666, "train_frag_loss": 2.2696990966796875, "train_loss": 0.5223309397697449, "val_loss": 0.6090918779373169}} +{"step": 11200, "epoch": 1, "elapsed_seconds": 3025.2812322711106, "train_loss": 0.617706891298294, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4739641547203064, "train_magma_inten_loss": 0.3914884924888611, "train_frag_loss": 2.793130397796631, "train_loss": 0.6174585819244385, "val_loss": 0.6090918779373169}} +{"step": 11300, "epoch": 1, "elapsed_seconds": 3051.89394745708, "train_loss": 0.6073107266426087, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46595221757888794, "train_magma_inten_loss": 0.41359561681747437, "train_frag_loss": 2.9864015579223633, "train_loss": 0.6454929113388062, "val_loss": 0.6090918779373169}} +{"step": 11400, "epoch": 1, "elapsed_seconds": 3078.514830112108, "train_loss": 0.6122414642572402, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5048633217811584, "train_magma_inten_loss": 0.4307510256767273, "train_frag_loss": 3.9108588695526123, "train_loss": 0.7359369993209839, "val_loss": 0.6090918779373169}} +{"step": 11500, "epoch": 1, "elapsed_seconds": 3105.9798115351005, "train_loss": 0.6146764189004899, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.430597722530365, "train_magma_inten_loss": 0.38260048627853394, "train_frag_loss": 3.0950255393981934, "train_loss": 0.6212350726127625, "val_loss": 0.6090918779373169}} +{"step": 11600, "epoch": 1, "elapsed_seconds": 3134.153235068079, "train_loss": 0.6092351317405701, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5199259519577026, "train_magma_inten_loss": 0.4372897148132324, "train_frag_loss": 3.096736192703247, "train_loss": 0.6854361295700073, "val_loss": 0.6090918779373169}} +{"step": 11700, "epoch": 1, "elapsed_seconds": 3162.8760759740835, "train_loss": 0.6138489854335785, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4520334303379059, "train_magma_inten_loss": 0.34507137537002563, "train_frag_loss": 3.236429214477539, "train_loss": 0.6099937558174133, "val_loss": 0.6090918779373169}} +{"step": 11800, "epoch": 1, "elapsed_seconds": 3193.0255919550546, "train_loss": 0.610496997833252, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4378960430622101, "train_magma_inten_loss": 0.3544541001319885, "train_frag_loss": 3.256028175354004, "train_loss": 0.6144313216209412, "val_loss": 0.6090918779373169}} +{"step": 11900, "epoch": 2, "elapsed_seconds": 3287.6719376971014, "train_loss": 0.6044877633452416, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31763696670532227, "train_magma_inten_loss": 0.2963612675666809, "train_frag_loss": 2.924098253250122, "train_loss": 0.5152937173843384, "val_loss": 0.6090918779373169}} +{"step": 12000, "epoch": 2, "elapsed_seconds": 3323.3764635270927, "train_loss": 0.6021336930990219, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4531562328338623, "train_magma_inten_loss": 0.37910905480384827, "train_frag_loss": 2.9274277687072754, "train_loss": 0.6125853061676025, "val_loss": 0.6090918779373169}} +{"step": 12100, "epoch": 2, "elapsed_seconds": 3359.0479325030465, "train_loss": 0.6104111659526825, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4221374988555908, "train_magma_inten_loss": 0.3610767722129822, "train_frag_loss": 2.6396870613098145, "train_loss": 0.5700573921203613, "val_loss": 0.6090918779373169}} +{"step": 12200, "epoch": 2, "elapsed_seconds": 3381.356706467108, "train_loss": 0.6086306598782539, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3823114037513733, "train_magma_inten_loss": 0.30676278471946716, "train_frag_loss": 2.8429317474365234, "train_loss": 0.5344861745834351, "val_loss": 0.6090918779373169}} +{"step": 12300, "epoch": 2, "elapsed_seconds": 3401.0119190610712, "train_loss": 0.5923552358150482, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.44708243012428284, "train_magma_inten_loss": 0.35714003443717957, "train_frag_loss": 2.6674227714538574, "train_loss": 0.5759695768356323, "val_loss": 0.6090918779373169}} +{"step": 12400, "epoch": 2, "elapsed_seconds": 3420.1075299660442, "train_loss": 0.603131331205368, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4084203839302063, "train_magma_inten_loss": 0.34190696477890015, "train_frag_loss": 2.963775157928467, "train_loss": 0.5759912729263306, "val_loss": 0.6090918779373169}} +{"step": 12500, "epoch": 2, "elapsed_seconds": 3439.007853690069, "train_loss": 0.5964150914549827, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4082414507865906, "train_magma_inten_loss": 0.34738314151763916, "train_frag_loss": 3.346097946166992, "train_loss": 0.5878497958183289, "val_loss": 0.6090918779373169}} +{"step": 12600, "epoch": 2, "elapsed_seconds": 3458.2001459851163, "train_loss": 0.5826172739267349, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4174153208732605, "train_magma_inten_loss": 0.349586546421051, "train_frag_loss": 2.662630319595337, "train_loss": 0.5476080179214478, "val_loss": 0.6090918779373169}} +{"step": 12700, "epoch": 2, "elapsed_seconds": 3477.1971556671197, "train_loss": 0.5770653885602951, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45683982968330383, "train_magma_inten_loss": 0.3876663148403168, "train_frag_loss": 3.1859841346740723, "train_loss": 0.6204875111579895, "val_loss": 0.6090918779373169}} +{"step": 12800, "epoch": 2, "elapsed_seconds": 3496.3627227210673, "train_loss": 0.5869579070806503, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40478381514549255, "train_magma_inten_loss": 0.3034721910953522, "train_frag_loss": 3.002375841140747, "train_loss": 0.5352991223335266, "val_loss": 0.6090918779373169}} +{"step": 12900, "epoch": 2, "elapsed_seconds": 3515.3403446370503, "train_loss": 0.5824965190887451, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4761921763420105, "train_magma_inten_loss": 0.39405471086502075, "train_frag_loss": 3.157475709915161, "train_loss": 0.6294637322425842, "val_loss": 0.6090918779373169}} +{"step": 13000, "epoch": 2, "elapsed_seconds": 3534.7231009710813, "train_loss": 0.5768555063009262, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3791845142841339, "train_magma_inten_loss": 0.29483115673065186, "train_frag_loss": 2.8899316787719727, "train_loss": 0.5134486556053162, "val_loss": 0.6090918779373169}} +{"step": 13100, "epoch": 2, "elapsed_seconds": 3554.208661194076, "train_loss": 0.5762257668375969, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.36995047330856323, "train_magma_inten_loss": 0.2969297170639038, "train_frag_loss": 2.5457205772399902, "train_loss": 0.4890662729740143, "val_loss": 0.6090918779373169}} +{"step": 13200, "epoch": 2, "elapsed_seconds": 3573.6968833811115, "train_loss": 0.5835083559155464, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3998708724975586, "train_magma_inten_loss": 0.35494160652160645, "train_frag_loss": 3.1616156101226807, "train_loss": 0.5778263807296753, "val_loss": 0.6090918779373169}} +{"step": 13300, "epoch": 2, "elapsed_seconds": 3592.852219676017, "train_loss": 0.5729157385230065, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3685227334499359, "train_magma_inten_loss": 0.35480797290802, "train_frag_loss": 2.6216931343078613, "train_loss": 0.5315337777137756, "val_loss": 0.6090918779373169}} +{"step": 13400, "epoch": 2, "elapsed_seconds": 3611.886176112108, "train_loss": 0.5690650641918182, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5146365165710449, "train_magma_inten_loss": 0.42161136865615845, "train_frag_loss": 3.0823464393615723, "train_loss": 0.6558353900909424, "val_loss": 0.6090918779373169}} +{"step": 13500, "epoch": 2, "elapsed_seconds": 3630.9372751590563, "train_loss": 0.5738830891251564, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46115148067474365, "train_magma_inten_loss": 0.394461452960968, "train_frag_loss": 3.3484864234924316, "train_loss": 0.6370903253555298, "val_loss": 0.6090918779373169}} +{"step": 13600, "epoch": 2, "elapsed_seconds": 3650.4290337790735, "train_loss": 0.5828773584961892, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4628199636936188, "train_magma_inten_loss": 0.40826159715652466, "train_frag_loss": 2.668684482574463, "train_loss": 0.602116584777832, "val_loss": 0.6090918779373169}} +{"step": 13700, "epoch": 2, "elapsed_seconds": 3669.8189547550865, "train_loss": 0.5766520059108734, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4378123879432678, "train_magma_inten_loss": 0.36336955428123474, "train_frag_loss": 3.0291850566864014, "train_loss": 0.5877152681350708, "val_loss": 0.6090918779373169}} +{"step": 13800, "epoch": 2, "elapsed_seconds": 3689.430382600054, "train_loss": 0.5751876497268676, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49377039074897766, "train_magma_inten_loss": 0.45935964584350586, "train_frag_loss": 3.5548555850982666, "train_loss": 0.7044275999069214, "val_loss": 0.6090918779373169}} +{"step": 13900, "epoch": 2, "elapsed_seconds": 3708.4484087390592, "train_loss": 0.5632851228117943, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31513655185699463, "train_magma_inten_loss": 0.2687513828277588, "train_frag_loss": 3.0151820182800293, "train_loss": 0.48252934217453003, "val_loss": 0.6090918779373169}} +{"step": 14000, "epoch": 2, "elapsed_seconds": 3727.526218495099, "train_loss": 0.5808129510283471, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49575453996658325, "train_magma_inten_loss": 0.4708290994167328, "train_frag_loss": 3.23861026763916, "train_loss": 0.6918861269950867, "val_loss": 0.6090918779373169}} +{"step": 14100, "epoch": 2, "elapsed_seconds": 3747.0890984330326, "train_loss": 0.5665152817964554, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41434264183044434, "train_magma_inten_loss": 0.34172722697257996, "train_frag_loss": 2.963409423828125, "train_loss": 0.5611289143562317, "val_loss": 0.6090918779373169}} +{"step": 14200, "epoch": 2, "elapsed_seconds": 3766.247254727059, "train_loss": 0.5667635291814804, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3966042995452881, "train_magma_inten_loss": 0.3115726113319397, "train_frag_loss": 2.7747089862823486, "train_loss": 0.5228636264801025, "val_loss": 0.6090918779373169}} +{"step": 14300, "epoch": 2, "elapsed_seconds": 3785.6786325051216, "train_loss": 0.5742889019846916, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42470285296440125, "train_magma_inten_loss": 0.36331647634506226, "train_frag_loss": 2.7766194343566895, "train_loss": 0.5666012763977051, "val_loss": 0.6090918779373169}} +{"step": 14400, "epoch": 2, "elapsed_seconds": 3809.4534187780228, "train_loss": 0.5726606398820877, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4071040749549866, "train_magma_inten_loss": 0.3791307210922241, "train_frag_loss": 2.9295454025268555, "train_loss": 0.5809581875801086, "val_loss": 0.6090918779373169}} +{"step": 14500, "epoch": 2, "elapsed_seconds": 3829.125687150052, "train_loss": 0.5660424986481667, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.342337429523468, "train_magma_inten_loss": 0.2896849513053894, "train_frag_loss": 2.8582749366760254, "train_loss": 0.4953235387802124, "val_loss": 0.6090918779373169}} +{"step": 14600, "epoch": 2, "elapsed_seconds": 3848.551422922057, "train_loss": 0.5650607845187188, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46239978075027466, "train_magma_inten_loss": 0.39749670028686523, "train_frag_loss": 3.347407579421997, "train_loss": 0.6394402384757996, "val_loss": 0.6090918779373169}} +{"step": 14700, "epoch": 2, "elapsed_seconds": 3870.2366063420195, "train_loss": 0.568972641825676, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4931841790676117, "train_magma_inten_loss": 0.44598084688186646, "train_frag_loss": 3.579620122909546, "train_loss": 0.6970729231834412, "val_loss": 0.6090918779373169}} +{"step": 14800, "epoch": 2, "elapsed_seconds": 3895.49901934003, "train_loss": 0.563918114900589, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38780874013900757, "train_magma_inten_loss": 0.2884015738964081, "train_frag_loss": 2.911459445953369, "train_loss": 0.5136085152626038, "val_loss": 0.6090918779373169}} +{"step": 14900, "epoch": 2, "elapsed_seconds": 3920.879118305049, "train_loss": 0.5804772630333901, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40131014585494995, "train_magma_inten_loss": 0.3682548701763153, "train_frag_loss": 3.1036951541900635, "train_loss": 0.5832560062408447, "val_loss": 0.6090918779373169}} +{"step": 15000, "epoch": 2, "elapsed_seconds": 3946.741432613111, "train_loss": 0.562736265361309, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3642648756504059, "train_magma_inten_loss": 0.29748380184173584, "train_frag_loss": 3.2572033405303955, "train_loss": 0.5171658992767334, "val_loss": 0.6090918779373169}} +{"step": 15100, "epoch": 2, "elapsed_seconds": 3986.5044537490467, "train_loss": 0.5737253966927528, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.368498831987381, "train_magma_inten_loss": 0.302046537399292, "train_frag_loss": 2.9963347911834717, "train_loss": 0.5061899423599243, "val_loss": 0.5897637605667114}} +{"step": 15200, "epoch": 2, "elapsed_seconds": 4016.6656821790384, "train_loss": 0.5575582706928253, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4285452961921692, "train_magma_inten_loss": 0.39514732360839844, "train_frag_loss": 2.94584059715271, "train_loss": 0.5827730894088745, "val_loss": 0.5897637605667114}} +{"step": 15300, "epoch": 2, "elapsed_seconds": 4037.665567616117, "train_loss": 0.5525662508606911, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43372756242752075, "train_magma_inten_loss": 0.37263423204421997, "train_frag_loss": 2.576422929763794, "train_loss": 0.5497877597808838, "val_loss": 0.5897637605667114}} +{"step": 15400, "epoch": 2, "elapsed_seconds": 4057.0603645320516, "train_loss": 0.5489862561225891, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4496513605117798, "train_magma_inten_loss": 0.3748599588871002, "train_frag_loss": 2.6157641410827637, "train_loss": 0.5599460601806641, "val_loss": 0.5897637605667114}} +{"step": 15500, "epoch": 2, "elapsed_seconds": 4076.6868390170857, "train_loss": 0.5548800608515739, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45152443647384644, "train_magma_inten_loss": 0.37327080965042114, "train_frag_loss": 3.5093886852264404, "train_loss": 0.6125423312187195, "val_loss": 0.5897637605667114}} +{"step": 15600, "epoch": 2, "elapsed_seconds": 4095.828437519027, "train_loss": 0.5521950936317443, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3935379981994629, "train_magma_inten_loss": 0.28828591108322144, "train_frag_loss": 2.8378677368164062, "train_loss": 0.498960942029953, "val_loss": 0.5897637605667114}} +{"step": 15700, "epoch": 2, "elapsed_seconds": 4114.992431641091, "train_loss": 0.5503197219967843, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3352571129798889, "train_magma_inten_loss": 0.26994308829307556, "train_frag_loss": 3.0018038749694824, "train_loss": 0.4739433228969574, "val_loss": 0.5897637605667114}} +{"step": 15800, "epoch": 2, "elapsed_seconds": 4133.8943616680335, "train_loss": 0.5441053262352944, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42223578691482544, "train_magma_inten_loss": 0.37277793884277344, "train_frag_loss": 2.783092737197876, "train_loss": 0.5573702454566956, "val_loss": 0.5897637605667114}} +{"step": 15900, "epoch": 2, "elapsed_seconds": 4152.915592207108, "train_loss": 0.5560291275382042, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4038541316986084, "train_magma_inten_loss": 0.35607635974884033, "train_frag_loss": 3.137596368789673, "train_loss": 0.5609137415885925, "val_loss": 0.5897637605667114}} +{"step": 16000, "epoch": 2, "elapsed_seconds": 4173.088306336082, "train_loss": 0.5487608358263969, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49012327194213867, "train_magma_inten_loss": 0.4476666748523712, "train_frag_loss": 3.3039064407348633, "train_loss": 0.6601454615592957, "val_loss": 0.5897637605667114}} +{"step": 16100, "epoch": 2, "elapsed_seconds": 4194.309298334061, "train_loss": 0.5613656240701675, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.425685316324234, "train_magma_inten_loss": 0.3522612154483795, "train_frag_loss": 3.2640292644500732, "train_loss": 0.5750667452812195, "val_loss": 0.5897637605667114}} +{"step": 16200, "epoch": 2, "elapsed_seconds": 4213.496098290081, "train_loss": 0.5473866233229637, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4123963713645935, "train_magma_inten_loss": 0.352191686630249, "train_frag_loss": 2.755049705505371, "train_loss": 0.5395289659500122, "val_loss": 0.5897637605667114}} +{"step": 16300, "epoch": 2, "elapsed_seconds": 4232.583867747104, "train_loss": 0.5520920166373253, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39159467816352844, "train_magma_inten_loss": 0.3468935191631317, "train_frag_loss": 3.3267557621002197, "train_loss": 0.5616406798362732, "val_loss": 0.5897637605667114}} +{"step": 16400, "epoch": 2, "elapsed_seconds": 4251.801051527029, "train_loss": 0.5487824794650078, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40079066157341003, "train_magma_inten_loss": 0.2935985326766968, "train_frag_loss": 2.9208850860595703, "train_loss": 0.5099701285362244, "val_loss": 0.5897637605667114}} +{"step": 16500, "epoch": 2, "elapsed_seconds": 4270.994446405093, "train_loss": 0.5546088710427284, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4595259130001068, "train_magma_inten_loss": 0.4179454445838928, "train_frag_loss": 3.0011978149414062, "train_loss": 0.6121907830238342, "val_loss": 0.5897637605667114}} +{"step": 16600, "epoch": 2, "elapsed_seconds": 4289.952925513033, "train_loss": 0.5456376358866691, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39964693784713745, "train_magma_inten_loss": 0.3424133062362671, "train_frag_loss": 3.2327499389648438, "train_loss": 0.5567417144775391, "val_loss": 0.5897637605667114}} +{"step": 16700, "epoch": 2, "elapsed_seconds": 4309.031970506068, "train_loss": 0.5437228810787201, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3706987202167511, "train_magma_inten_loss": 0.3270111382007599, "train_frag_loss": 3.1266584396362305, "train_loss": 0.5295276641845703, "val_loss": 0.5897637605667114}} +{"step": 16800, "epoch": 2, "elapsed_seconds": 4328.810096260044, "train_loss": 0.5351234346628189, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3473510146141052, "train_magma_inten_loss": 0.2986113131046295, "train_frag_loss": 2.9837517738342285, "train_loss": 0.4947582483291626, "val_loss": 0.5897637605667114}} +{"step": 16900, "epoch": 2, "elapsed_seconds": 4348.020783349057, "train_loss": 0.5350987395644188, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3534426689147949, "train_magma_inten_loss": 0.3275851607322693, "train_frag_loss": 2.9100823402404785, "train_loss": 0.5100114941596985, "val_loss": 0.5897637605667114}} +{"step": 17000, "epoch": 2, "elapsed_seconds": 4368.124061644077, "train_loss": 0.5472677132487297, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4822303056716919, "train_magma_inten_loss": 0.4281231164932251, "train_frag_loss": 3.2694458961486816, "train_loss": 0.6433380842208862, "val_loss": 0.5897637605667114}} +{"step": 17100, "epoch": 2, "elapsed_seconds": 4389.295356307062, "train_loss": 0.5506650695204734, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34489044547080994, "train_magma_inten_loss": 0.3179165720939636, "train_frag_loss": 2.0881853103637695, "train_loss": 0.4522678852081299, "val_loss": 0.5897637605667114}} +{"step": 17200, "epoch": 2, "elapsed_seconds": 4409.213807006017, "train_loss": 0.5510259789228439, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38235950469970703, "train_magma_inten_loss": 0.3116229176521301, "train_frag_loss": 2.9949989318847656, "train_loss": 0.5174419283866882, "val_loss": 0.5897637605667114}} +{"step": 17300, "epoch": 2, "elapsed_seconds": 4429.021704839077, "train_loss": 0.5410856592655182, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40643322467803955, "train_magma_inten_loss": 0.362867534160614, "train_frag_loss": 2.4490966796875, "train_loss": 0.525324821472168, "val_loss": 0.5897637605667114}} +{"step": 17400, "epoch": 2, "elapsed_seconds": 4448.861340212054, "train_loss": 0.5316133219003677, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.32936859130859375, "train_magma_inten_loss": 0.26685571670532227, "train_frag_loss": 3.3345885276794434, "train_loss": 0.48935943841934204, "val_loss": 0.5897637605667114}} +{"step": 17500, "epoch": 2, "elapsed_seconds": 4469.095687481109, "train_loss": 0.5453567388653755, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.32435449957847595, "train_magma_inten_loss": 0.29796889424324036, "train_frag_loss": 2.9423766136169434, "train_loss": 0.46670207381248474, "val_loss": 0.5897637605667114}} +{"step": 17600, "epoch": 2, "elapsed_seconds": 4489.59667897108, "train_loss": 0.5188296243548394, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43798017501831055, "train_magma_inten_loss": 0.4040873646736145, "train_frag_loss": 3.542816638946533, "train_loss": 0.6082479357719421, "val_loss": 0.5897637605667114}} +{"step": 17700, "epoch": 2, "elapsed_seconds": 4508.986677935114, "train_loss": 0.5192879599332809, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48798272013664246, "train_magma_inten_loss": 0.3765164613723755, "train_frag_loss": 2.837815761566162, "train_loss": 0.5795581340789795, "val_loss": 0.5897637605667114}} +{"step": 17800, "epoch": 3, "elapsed_seconds": 4588.829971179017, "train_loss": 0.5200666779279709, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4036872982978821, "train_magma_inten_loss": 0.30965813994407654, "train_frag_loss": 2.6294631958007812, "train_loss": 0.49345678091049194, "val_loss": 0.5897637605667114}} +{"step": 17900, "epoch": 3, "elapsed_seconds": 4607.9486266110325, "train_loss": 0.5126471629738808, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.412481427192688, "train_magma_inten_loss": 0.32567110657691956, "train_frag_loss": 3.1097540855407715, "train_loss": 0.5316119194030762, "val_loss": 0.5897637605667114}} +{"step": 18000, "epoch": 3, "elapsed_seconds": 4627.104634641088, "train_loss": 0.5151486256718636, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.30958884954452515, "train_magma_inten_loss": 0.2493489384651184, "train_frag_loss": 2.8584256172180176, "train_loss": 0.4294833540916443, "val_loss": 0.5897637605667114}} +{"step": 18100, "epoch": 3, "elapsed_seconds": 4646.472477668081, "train_loss": 0.5055655363202095, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3742437958717346, "train_magma_inten_loss": 0.33327218890190125, "train_frag_loss": 3.0017080307006836, "train_loss": 0.511992871761322, "val_loss": 0.5897637605667114}} +{"step": 18200, "epoch": 3, "elapsed_seconds": 4665.233410459012, "train_loss": 0.5058267742395401, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3354323208332062, "train_magma_inten_loss": 0.27152571082115173, "train_frag_loss": 2.047760248184204, "train_loss": 0.41029611229896545, "val_loss": 0.5897637605667114}} +{"step": 18300, "epoch": 3, "elapsed_seconds": 4684.119382401113, "train_loss": 0.5117549875378609, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4600326418876648, "train_magma_inten_loss": 0.37178242206573486, "train_frag_loss": 2.7883124351501465, "train_loss": 0.5613151788711548, "val_loss": 0.5897637605667114}} +{"step": 18400, "epoch": 3, "elapsed_seconds": 4702.8081024531275, "train_loss": 0.5114110779762268, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40825706720352173, "train_magma_inten_loss": 0.3578416109085083, "train_frag_loss": 2.99373197555542, "train_loss": 0.5405634045600891, "val_loss": 0.5897637605667114}} +{"step": 18500, "epoch": 3, "elapsed_seconds": 4721.526479942026, "train_loss": 0.5155820912122726, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43280160427093506, "train_magma_inten_loss": 0.3468475639820099, "train_frag_loss": 2.678865432739258, "train_loss": 0.5294879674911499, "val_loss": 0.5897637605667114}} +{"step": 18600, "epoch": 3, "elapsed_seconds": 4740.764966292074, "train_loss": 0.5148847717046737, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41184374690055847, "train_magma_inten_loss": 0.362336665391922, "train_frag_loss": 2.695073127746582, "train_loss": 0.5287608504295349, "val_loss": 0.5897637605667114}} +{"step": 18700, "epoch": 3, "elapsed_seconds": 4765.138745438075, "train_loss": 0.5234010174870491, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48186734318733215, "train_magma_inten_loss": 0.42856472730636597, "train_frag_loss": 3.376715660095215, "train_loss": 0.632992684841156, "val_loss": 0.5897637605667114}} +{"step": 18800, "epoch": 3, "elapsed_seconds": 4799.135258994065, "train_loss": 0.5110410025715828, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3660750091075897, "train_magma_inten_loss": 0.33710765838623047, "train_frag_loss": 2.8240373134613037, "train_loss": 0.5007615089416504, "val_loss": 0.5897637605667114}} +{"step": 18900, "epoch": 3, "elapsed_seconds": 4833.623906714027, "train_loss": 0.5055047371983528, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3076499402523041, "train_magma_inten_loss": 0.27126407623291016, "train_frag_loss": 2.888106346130371, "train_loss": 0.4417988061904907, "val_loss": 0.5897637605667114}} +{"step": 19000, "epoch": 3, "elapsed_seconds": 4868.401422588038, "train_loss": 0.5170303031802177, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46338003873825073, "train_magma_inten_loss": 0.444900780916214, "train_frag_loss": 3.1200594902038574, "train_loss": 0.6193721294403076, "val_loss": 0.5897637605667114}} +{"step": 19100, "epoch": 3, "elapsed_seconds": 4903.4312323060585, "train_loss": 0.5150322887301445, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3603139817714691, "train_magma_inten_loss": 0.30974259972572327, "train_frag_loss": 2.6444573402404785, "train_loss": 0.47397559881210327, "val_loss": 0.5897637605667114}} +{"step": 19200, "epoch": 3, "elapsed_seconds": 4938.820428637089, "train_loss": 0.5187412533164024, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49333107471466064, "train_magma_inten_loss": 0.3921741247177124, "train_frag_loss": 3.0619397163391113, "train_loss": 0.6022961139678955, "val_loss": 0.5897637605667114}} +{"step": 19300, "epoch": 3, "elapsed_seconds": 4978.588997652056, "train_loss": 0.5131948399543762, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3836503028869629, "train_magma_inten_loss": 0.31085312366485596, "train_frag_loss": 2.7182185649871826, "train_loss": 0.48942017555236816, "val_loss": 0.5897637605667114}} +{"step": 19400, "epoch": 3, "elapsed_seconds": 5009.467818982084, "train_loss": 0.5155525264143944, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3434453010559082, "train_magma_inten_loss": 0.31090518832206726, "train_frag_loss": 2.7479286193847656, "train_loss": 0.4721883535385132, "val_loss": 0.5897637605667114}} +{"step": 19500, "epoch": 3, "elapsed_seconds": 5028.445388503023, "train_loss": 0.5107825702428818, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2852606177330017, "train_magma_inten_loss": 0.25365379452705383, "train_frag_loss": 2.4871773719787598, "train_loss": 0.4006422162055969, "val_loss": 0.5897637605667114}} +{"step": 19600, "epoch": 3, "elapsed_seconds": 5047.609040577081, "train_loss": 0.5120307141542435, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39241641759872437, "train_magma_inten_loss": 0.337372362613678, "train_frag_loss": 3.044461250305176, "train_loss": 0.5249589085578918, "val_loss": 0.5897637605667114}} +{"step": 19700, "epoch": 3, "elapsed_seconds": 5066.81536401005, "train_loss": 0.5158857488632203, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43053609132766724, "train_magma_inten_loss": 0.35876113176345825, "train_frag_loss": 2.729970693588257, "train_loss": 0.537473738193512, "val_loss": 0.5897637605667114}} +{"step": 19800, "epoch": 3, "elapsed_seconds": 5085.8996661680285, "train_loss": 0.5181703209877014, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3964073061943054, "train_magma_inten_loss": 0.3546866774559021, "train_frag_loss": 2.809640645980835, "train_loss": 0.5235510468482971, "val_loss": 0.5897637605667114}} +{"step": 19900, "epoch": 3, "elapsed_seconds": 5105.153339471086, "train_loss": 0.5163676711916924, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4167405962944031, "train_magma_inten_loss": 0.37296828627586365, "train_frag_loss": 2.869624376296997, "train_loss": 0.545981764793396, "val_loss": 0.5897637605667114}} +{"step": 20000, "epoch": 3, "elapsed_seconds": 5136.2172065590275, "train_loss": 0.5071610575914383, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34282201528549194, "train_magma_inten_loss": 0.3097573518753052, "train_frag_loss": 2.4598751068115234, "train_loss": 0.4446623623371124, "val_loss": 0.5897637605667114}} +{"step": 20100, "epoch": 3, "elapsed_seconds": 5167.742985604098, "train_loss": 0.49651871621608734, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2860291600227356, "train_magma_inten_loss": 0.27290821075439453, "train_frag_loss": 2.8870677947998047, "train_loss": 0.41784101724624634, "val_loss": 0.5806041955947876}} +{"step": 20200, "epoch": 3, "elapsed_seconds": 5186.858301438042, "train_loss": 0.5016731026768685, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4180721044540405, "train_magma_inten_loss": 0.36541032791137695, "train_frag_loss": 2.8505988121032715, "train_loss": 0.5292273759841919, "val_loss": 0.5806041955947876}} +{"step": 20300, "epoch": 3, "elapsed_seconds": 5205.765877261059, "train_loss": 0.4964729285240173, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3597725033760071, "train_magma_inten_loss": 0.295658141374588, "train_frag_loss": 2.6730847358703613, "train_loss": 0.45695960521698, "val_loss": 0.5806041955947876}} +{"step": 20400, "epoch": 3, "elapsed_seconds": 5226.138909682049, "train_loss": 0.50895726531744, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.37768277525901794, "train_magma_inten_loss": 0.34854787588119507, "train_frag_loss": 2.8239634037017822, "train_loss": 0.49881696701049805, "val_loss": 0.5806041955947876}} +{"step": 20500, "epoch": 3, "elapsed_seconds": 5250.420901201083, "train_loss": 0.4969913011789322, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41027700901031494, "train_magma_inten_loss": 0.3518894612789154, "train_frag_loss": 2.6483726501464844, "train_loss": 0.5090212821960449, "val_loss": 0.5806041955947876}} +{"step": 20600, "epoch": 3, "elapsed_seconds": 5275.5004839650355, "train_loss": 0.5001100704073906, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.44135916233062744, "train_magma_inten_loss": 0.3947176933288574, "train_frag_loss": 3.4805960655212402, "train_loss": 0.5855265259742737, "val_loss": 0.5806041955947876}} +{"step": 20700, "epoch": 3, "elapsed_seconds": 5300.347624594113, "train_loss": 0.5073206594586372, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.32124945521354675, "train_magma_inten_loss": 0.23599866032600403, "train_frag_loss": 3.2096099853515625, "train_loss": 0.43398892879486084, "val_loss": 0.5806041955947876}} +{"step": 20800, "epoch": 3, "elapsed_seconds": 5325.644554622122, "train_loss": 0.4824454540014267, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.381364107131958, "train_magma_inten_loss": 0.3034590780735016, "train_frag_loss": 2.688312292098999, "train_loss": 0.47268354892730713, "val_loss": 0.5806041955947876}} +{"step": 20900, "epoch": 3, "elapsed_seconds": 5350.634573629126, "train_loss": 0.5015432170033455, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39579537510871887, "train_magma_inten_loss": 0.3745104670524597, "train_frag_loss": 2.5131402015686035, "train_loss": 0.5058175921440125, "val_loss": 0.5806041955947876}} +{"step": 21000, "epoch": 3, "elapsed_seconds": 5375.899278796045, "train_loss": 0.4981835672259331, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31916913390159607, "train_magma_inten_loss": 0.27439799904823303, "train_frag_loss": 2.38435435295105, "train_loss": 0.4117981791496277, "val_loss": 0.5806041955947876}} +{"step": 21100, "epoch": 3, "elapsed_seconds": 5400.9777956340695, "train_loss": 0.496694438457489, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.35066163539886475, "train_magma_inten_loss": 0.28514420986175537, "train_frag_loss": 2.6369760036468506, "train_loss": 0.4454506039619446, "val_loss": 0.5806041955947876}} +{"step": 21200, "epoch": 3, "elapsed_seconds": 5426.1772806870285, "train_loss": 0.4855167007446289, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.36348965764045715, "train_magma_inten_loss": 0.303561806678772, "train_frag_loss": 2.516751766204834, "train_loss": 0.45520180463790894, "val_loss": 0.5806041955947876}} +{"step": 21300, "epoch": 3, "elapsed_seconds": 5451.5968740921235, "train_loss": 0.4957015123963356, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4135788679122925, "train_magma_inten_loss": 0.35037142038345337, "train_frag_loss": 2.947934865951538, "train_loss": 0.5243457555770874, "val_loss": 0.5806041955947876}} +{"step": 21400, "epoch": 3, "elapsed_seconds": 5476.737410742091, "train_loss": 0.4941124227643013, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.475434809923172, "train_magma_inten_loss": 0.38951507210731506, "train_frag_loss": 2.436330556869507, "train_loss": 0.5508686304092407, "val_loss": 0.5806041955947876}} +{"step": 21500, "epoch": 3, "elapsed_seconds": 5502.2911126341205, "train_loss": 0.49288838684558867, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3422529697418213, "train_magma_inten_loss": 0.3052777051925659, "train_frag_loss": 3.144346237182617, "train_loss": 0.47496092319488525, "val_loss": 0.5806041955947876}} +{"step": 21600, "epoch": 3, "elapsed_seconds": 5527.434427703032, "train_loss": 0.49443577110767367, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3434355556964874, "train_magma_inten_loss": 0.327766090631485, "train_frag_loss": 2.3276805877685547, "train_loss": 0.4472731351852417, "val_loss": 0.5806041955947876}} +{"step": 21700, "epoch": 3, "elapsed_seconds": 5556.273708624067, "train_loss": 0.4928674507141113, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4121719002723694, "train_magma_inten_loss": 0.28175652027130127, "train_frag_loss": 2.5871050357818604, "train_loss": 0.47353506088256836, "val_loss": 0.5806041955947876}} +{"step": 21800, "epoch": 3, "elapsed_seconds": 5586.517096380121, "train_loss": 0.4992925098538399, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3847574293613434, "train_magma_inten_loss": 0.3182506561279297, "train_frag_loss": 2.9279532432556152, "train_loss": 0.49299055337905884, "val_loss": 0.5806041955947876}} +{"step": 21900, "epoch": 3, "elapsed_seconds": 5617.025084148045, "train_loss": 0.4884082466363907, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4406365156173706, "train_magma_inten_loss": 0.38504886627197266, "train_frag_loss": 2.5512328147888184, "train_loss": 0.5360738039016724, "val_loss": 0.5806041955947876}} +{"step": 22000, "epoch": 3, "elapsed_seconds": 5647.21413243108, "train_loss": 0.4924587106704712, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3814678192138672, "train_magma_inten_loss": 0.3343728184700012, "train_frag_loss": 3.1189446449279785, "train_loss": 0.508120596408844, "val_loss": 0.5806041955947876}} +{"step": 22100, "epoch": 3, "elapsed_seconds": 5685.907187483041, "train_loss": 0.4836292886734009, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4047917425632477, "train_magma_inten_loss": 0.3183877468109131, "train_frag_loss": 2.9881362915039062, "train_loss": 0.5063866376876831, "val_loss": 0.5806041955947876}} +{"step": 22200, "epoch": 3, "elapsed_seconds": 5717.15325087111, "train_loss": 0.4936942660808563, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4649597406387329, "train_magma_inten_loss": 0.3965235948562622, "train_frag_loss": 2.9504685401916504, "train_loss": 0.5733469724655151, "val_loss": 0.5806041955947876}} +{"step": 22300, "epoch": 3, "elapsed_seconds": 5747.870940907043, "train_loss": 0.4875636380910873, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.29482316970825195, "train_magma_inten_loss": 0.263574481010437, "train_frag_loss": 2.739814519882202, "train_loss": 0.41092151403427124, "val_loss": 0.5806041955947876}} +{"step": 22400, "epoch": 3, "elapsed_seconds": 5779.071940630092, "train_loss": 0.4805921784043312, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4544876217842102, "train_magma_inten_loss": 0.40367329120635986, "train_frag_loss": 3.1016111373901367, "train_loss": 0.5785323977470398, "val_loss": 0.5806041955947876}} +{"step": 22500, "epoch": 3, "elapsed_seconds": 5809.941510096076, "train_loss": 0.48761937141418454, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3816421926021576, "train_magma_inten_loss": 0.32077181339263916, "train_frag_loss": 3.150986433029175, "train_loss": 0.4910791218280792, "val_loss": 0.5806041955947876}} +{"step": 22600, "epoch": 3, "elapsed_seconds": 5841.229244648013, "train_loss": 0.4774904328584671, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39382946491241455, "train_magma_inten_loss": 0.3609548807144165, "train_frag_loss": 2.5493011474609375, "train_loss": 0.4894171357154846, "val_loss": 0.5806041955947876}} +{"step": 22700, "epoch": 3, "elapsed_seconds": 5872.948089408106, "train_loss": 0.4735760480165482, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.33137819170951843, "train_magma_inten_loss": 0.26411014795303345, "train_frag_loss": 2.8783626556396484, "train_loss": 0.42632558941841125, "val_loss": 0.5806041955947876}} +{"step": 22800, "epoch": 3, "elapsed_seconds": 5912.679165986017, "train_loss": 0.4769589900970459, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4610050916671753, "train_magma_inten_loss": 0.41784530878067017, "train_frag_loss": 3.2319228649139404, "train_loss": 0.5815499424934387, "val_loss": 0.5806041955947876}} +{"step": 22900, "epoch": 3, "elapsed_seconds": 5951.669807050028, "train_loss": 0.469877202808857, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.37351059913635254, "train_magma_inten_loss": 0.3176786005496979, "train_frag_loss": 2.3517065048217773, "train_loss": 0.4507099986076355, "val_loss": 0.5806041955947876}} +{"step": 23000, "epoch": 3, "elapsed_seconds": 5988.605207567103, "train_loss": 0.4782065895199776, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3589666783809662, "train_magma_inten_loss": 0.30050697922706604, "train_frag_loss": 2.667391061782837, "train_loss": 0.4486241638660431, "val_loss": 0.5806041955947876}} +{"step": 23100, "epoch": 3, "elapsed_seconds": 6026.366667380091, "train_loss": 0.471178697347641, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46657854318618774, "train_magma_inten_loss": 0.39888349175453186, "train_frag_loss": 3.103421211242676, "train_loss": 0.5710301399230957, "val_loss": 0.5806041955947876}} +{"step": 23200, "epoch": 3, "elapsed_seconds": 6067.049249664065, "train_loss": 0.47351177990436555, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31375765800476074, "train_magma_inten_loss": 0.2808348536491394, "train_frag_loss": 2.837130546569824, "train_loss": 0.4217146337032318, "val_loss": 0.5806041955947876}} +{"step": 23300, "epoch": 3, "elapsed_seconds": 6103.770325140096, "train_loss": 0.480333491563797, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3470383286476135, "train_magma_inten_loss": 0.30329349637031555, "train_frag_loss": 3.0322415828704834, "train_loss": 0.4587356746196747, "val_loss": 0.5806041955947876}} +{"step": 23400, "epoch": 3, "elapsed_seconds": 6140.059089296032, "train_loss": 0.4803445637226105, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4356827735900879, "train_magma_inten_loss": 0.3904951810836792, "train_frag_loss": 2.6418075561523438, "train_loss": 0.5299521684646606, "val_loss": 0.5806041955947876}} +{"step": 23500, "epoch": 3, "elapsed_seconds": 6180.015993191046, "train_loss": 0.48644364923238753, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.491951048374176, "train_magma_inten_loss": 0.38504159450531006, "train_frag_loss": 2.705338954925537, "train_loss": 0.5623860359191895, "val_loss": 0.5806041955947876}} +{"step": 23600, "epoch": 3, "elapsed_seconds": 6212.0239244160475, "train_loss": 0.4624307790398598, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.28894224762916565, "train_magma_inten_loss": 0.25011831521987915, "train_frag_loss": 2.6855297088623047, "train_loss": 0.3878330588340759, "val_loss": 0.5806041955947876}} +{"step": 23700, "epoch": 4, "elapsed_seconds": 6310.937079625088, "train_loss": 0.46690492689609525, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.36579960584640503, "train_magma_inten_loss": 0.3277171850204468, "train_frag_loss": 2.5028293132781982, "train_loss": 0.45714494585990906, "val_loss": 0.5806041955947876}} +{"step": 23800, "epoch": 4, "elapsed_seconds": 6343.708632714115, "train_loss": 0.471238871216774, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.484932005405426, "train_magma_inten_loss": 0.44117438793182373, "train_frag_loss": 3.119462251663208, "train_loss": 0.6003783941268921, "val_loss": 0.5806041955947876}} +{"step": 23900, "epoch": 4, "elapsed_seconds": 6376.817719096085, "train_loss": 0.47476265370845794, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48157647252082825, "train_magma_inten_loss": 0.4388091564178467, "train_frag_loss": 2.765362024307251, "train_loss": 0.5822063088417053, "val_loss": 0.5806041955947876}} +{"step": 24000, "epoch": 4, "elapsed_seconds": 6409.679812341114, "train_loss": 0.467492378950119, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4232651889324188, "train_magma_inten_loss": 0.3582703769207001, "train_frag_loss": 2.736339807510376, "train_loss": 0.5130774974822998, "val_loss": 0.5806041955947876}} +{"step": 24100, "epoch": 4, "elapsed_seconds": 6444.038372712093, "train_loss": 0.46735560536384585, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3509533405303955, "train_magma_inten_loss": 0.30852147936820984, "train_frag_loss": 2.7576112747192383, "train_loss": 0.4513939619064331, "val_loss": 0.5806041955947876}} +{"step": 24200, "epoch": 4, "elapsed_seconds": 6479.175203820108, "train_loss": 0.46217472523450853, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3977910578250885, "train_magma_inten_loss": 0.29163843393325806, "train_frag_loss": 2.678736448287964, "train_loss": 0.46740666031837463, "val_loss": 0.5806041955947876}} +{"step": 24300, "epoch": 4, "elapsed_seconds": 6515.292949100025, "train_loss": 0.4741316732764244, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.35104870796203613, "train_magma_inten_loss": 0.3118003308773041, "train_frag_loss": 3.1879334449768066, "train_loss": 0.4713836908340454, "val_loss": 0.5806041955947876}} +{"step": 24400, "epoch": 4, "elapsed_seconds": 6552.9655538541265, "train_loss": 0.4618647983670235, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40765729546546936, "train_magma_inten_loss": 0.3937269151210785, "train_frag_loss": 3.1043694019317627, "train_loss": 0.535293698310852, "val_loss": 0.5806041955947876}} +{"step": 24500, "epoch": 4, "elapsed_seconds": 6592.214879584033, "train_loss": 0.46722199499607087, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.406832218170166, "train_magma_inten_loss": 0.330416202545166, "train_frag_loss": 2.6207475662231445, "train_loss": 0.4867522120475769, "val_loss": 0.5806041955947876}} +{"step": 24600, "epoch": 4, "elapsed_seconds": 6634.224923553062, "train_loss": 0.4656296381354332, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.33468228578567505, "train_magma_inten_loss": 0.2679898738861084, "train_frag_loss": 3.095853805541992, "train_loss": 0.4392397701740265, "val_loss": 0.5806041955947876}} +{"step": 24700, "epoch": 4, "elapsed_seconds": 6678.335252042045, "train_loss": 0.47659034579992293, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4114609956741333, "train_magma_inten_loss": 0.3499036431312561, "train_frag_loss": 2.8851943016052246, "train_loss": 0.5091607570648193, "val_loss": 0.5806041955947876}} +{"step": 24800, "epoch": 4, "elapsed_seconds": 6721.639841519063, "train_loss": 0.46787255495786667, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31203117966651917, "train_magma_inten_loss": 0.31499242782592773, "train_frag_loss": 2.7654147148132324, "train_loss": 0.43234795331954956, "val_loss": 0.5806041955947876}} +{"step": 24900, "epoch": 4, "elapsed_seconds": 6760.326956855017, "train_loss": 0.46665942162275315, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38498419523239136, "train_magma_inten_loss": 0.3494355082511902, "train_frag_loss": 2.900402545928955, "train_loss": 0.4945344626903534, "val_loss": 0.5806041955947876}} +{"step": 25000, "epoch": 4, "elapsed_seconds": 6782.710570300114, "train_loss": 0.45986410140991213, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3187238872051239, "train_magma_inten_loss": 0.29222604632377625, "train_frag_loss": 3.046814441680908, "train_loss": 0.4264979362487793, "val_loss": 0.5806041955947876}} +{"step": 25100, "epoch": 4, "elapsed_seconds": 6813.332605753094, "train_loss": 0.4611159539222717, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31445997953414917, "train_magma_inten_loss": 0.28619223833084106, "train_frag_loss": 2.687422752380371, "train_loss": 0.407624751329422, "val_loss": 0.5665907859802246}} +{"step": 25200, "epoch": 4, "elapsed_seconds": 6833.281554858084, "train_loss": 0.46063179105520247, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3624201714992523, "train_magma_inten_loss": 0.2918645143508911, "train_frag_loss": 2.8236894607543945, "train_loss": 0.4444809556007385, "val_loss": 0.5665907859802246}} +{"step": 25300, "epoch": 4, "elapsed_seconds": 6853.523211450083, "train_loss": 0.4566918584704399, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41075217723846436, "train_magma_inten_loss": 0.3642117381095886, "train_frag_loss": 2.8696725368499756, "train_loss": 0.5038985013961792, "val_loss": 0.5665907859802246}} +{"step": 25400, "epoch": 4, "elapsed_seconds": 6876.03448438202, "train_loss": 0.4536673426628113, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39783814549446106, "train_magma_inten_loss": 0.330083429813385, "train_frag_loss": 2.959017515182495, "train_loss": 0.48622697591781616, "val_loss": 0.5665907859802246}} +{"step": 25500, "epoch": 4, "elapsed_seconds": 6900.977795499028, "train_loss": 0.4583693218231201, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.37487226724624634, "train_magma_inten_loss": 0.3239908814430237, "train_frag_loss": 2.9324259757995605, "train_loss": 0.4687679409980774, "val_loss": 0.5665907859802246}} +{"step": 25600, "epoch": 4, "elapsed_seconds": 6925.727525049122, "train_loss": 0.4498951652646065, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4485735297203064, "train_magma_inten_loss": 0.3519156575202942, "train_frag_loss": 2.980375289916992, "train_loss": 0.5265921354293823, "val_loss": 0.5665907859802246}} +{"step": 25700, "epoch": 4, "elapsed_seconds": 6950.489961130079, "train_loss": 0.451932327747345, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.35688602924346924, "train_magma_inten_loss": 0.2882094383239746, "train_frag_loss": 2.860767364501953, "train_loss": 0.44111132621765137, "val_loss": 0.5665907859802246}} +{"step": 25800, "epoch": 4, "elapsed_seconds": 6975.388104471029, "train_loss": 0.45630904197692873, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43029671907424927, "train_magma_inten_loss": 0.3939295709133148, "train_frag_loss": 3.0292344093322754, "train_loss": 0.5335661172866821, "val_loss": 0.5665907859802246}} +{"step": 25900, "epoch": 4, "elapsed_seconds": 7000.214015768026, "train_loss": 0.46361907124519347, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34618228673934937, "train_magma_inten_loss": 0.3162977695465088, "train_frag_loss": 2.7646145820617676, "train_loss": 0.4417112469673157, "val_loss": 0.5665907859802246}} +{"step": 26000, "epoch": 4, "elapsed_seconds": 7024.699507553014, "train_loss": 0.4514603763818741, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3712596893310547, "train_magma_inten_loss": 0.33110713958740234, "train_frag_loss": 2.833341360092163, "train_loss": 0.4654732346534729, "val_loss": 0.5665907859802246}} +{"step": 26100, "epoch": 4, "elapsed_seconds": 7049.638991376036, "train_loss": 0.46053037911653516, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2998800277709961, "train_magma_inten_loss": 0.25753748416900635, "train_frag_loss": 3.134645938873291, "train_loss": 0.40491828322410583, "val_loss": 0.5665907859802246}} +{"step": 26200, "epoch": 4, "elapsed_seconds": 7074.215162573033, "train_loss": 0.4512724933028221, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.379657506942749, "train_magma_inten_loss": 0.32772088050842285, "train_frag_loss": 2.669240713119507, "train_loss": 0.4629480242729187, "val_loss": 0.5665907859802246}} +{"step": 26300, "epoch": 4, "elapsed_seconds": 7098.424966404098, "train_loss": 0.45545999228954315, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38352933526039124, "train_magma_inten_loss": 0.35191142559051514, "train_frag_loss": 2.5333168506622314, "train_loss": 0.4694257974624634, "val_loss": 0.5665907859802246}} +{"step": 26400, "epoch": 4, "elapsed_seconds": 7122.5960900650825, "train_loss": 0.4578387486934662, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39980947971343994, "train_magma_inten_loss": 0.3331802189350128, "train_frag_loss": 2.6686596870422363, "train_loss": 0.4773852825164795, "val_loss": 0.5665907859802246}} +{"step": 26500, "epoch": 4, "elapsed_seconds": 7147.419455419062, "train_loss": 0.45918197214603423, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2645111680030823, "train_magma_inten_loss": 0.21773073077201843, "train_frag_loss": 2.3986682891845703, "train_loss": 0.33931678533554077, "val_loss": 0.5665907859802246}} +{"step": 26600, "epoch": 4, "elapsed_seconds": 7169.879635342048, "train_loss": 0.45691845268011094, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3728761076927185, "train_magma_inten_loss": 0.32933032512664795, "train_frag_loss": 2.941404104232788, "train_loss": 0.46996161341667175, "val_loss": 0.5665907859802246}} +{"step": 26700, "epoch": 4, "elapsed_seconds": 7192.31864772609, "train_loss": 0.45943625777959823, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4301684498786926, "train_magma_inten_loss": 0.3531811237335205, "train_frag_loss": 2.847368001937866, "train_loss": 0.510654866695404, "val_loss": 0.5665907859802246}} +{"step": 26800, "epoch": 4, "elapsed_seconds": 7212.953407434048, "train_loss": 0.4426770395040512, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3884146213531494, "train_magma_inten_loss": 0.35758453607559204, "train_frag_loss": 2.857617139816284, "train_loss": 0.48718035221099854, "val_loss": 0.5665907859802246}} +{"step": 26900, "epoch": 4, "elapsed_seconds": 7232.6939843770815, "train_loss": 0.4647687590122223, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.29197269678115845, "train_magma_inten_loss": 0.23359334468841553, "train_frag_loss": 3.3335721492767334, "train_loss": 0.39850473403930664, "val_loss": 0.5665907859802246}} +{"step": 27000, "epoch": 4, "elapsed_seconds": 7254.4571174470475, "train_loss": 0.45082607984542844, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31955233216285706, "train_magma_inten_loss": 0.29693669080734253, "train_frag_loss": 2.8888185024261475, "train_loss": 0.42270931601524353, "val_loss": 0.5665907859802246}} +{"step": 27100, "epoch": 4, "elapsed_seconds": 7276.51482484804, "train_loss": 0.4608785125613213, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.29046332836151123, "train_magma_inten_loss": 0.25979405641555786, "train_frag_loss": 2.6664469242095947, "train_loss": 0.3818850517272949, "val_loss": 0.5665907859802246}} +{"step": 27200, "epoch": 4, "elapsed_seconds": 7297.946571822045, "train_loss": 0.4540299141407013, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38477784395217896, "train_magma_inten_loss": 0.31719303131103516, "train_frag_loss": 2.9571423530578613, "train_loss": 0.47315987944602966, "val_loss": 0.5665907859802246}} +{"step": 27300, "epoch": 4, "elapsed_seconds": 7319.203121695085, "train_loss": 0.4478107479214668, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3151901066303253, "train_magma_inten_loss": 0.2676432132720947, "train_frag_loss": 2.982015371322632, "train_loss": 0.41229885816574097, "val_loss": 0.5665907859802246}} +{"step": 27400, "epoch": 4, "elapsed_seconds": 7341.020198640064, "train_loss": 0.45390737175941465, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34522774815559387, "train_magma_inten_loss": 0.28875282406806946, "train_frag_loss": 2.431539535522461, "train_loss": 0.41755104064941406, "val_loss": 0.5665907859802246}} +{"step": 27500, "epoch": 4, "elapsed_seconds": 7365.0572275870945, "train_loss": 0.44974269181489945, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.36038362979888916, "train_magma_inten_loss": 0.3123127818107605, "train_frag_loss": 2.753312110900879, "train_loss": 0.4396244287490845, "val_loss": 0.5665907859802246}} +{"step": 27600, "epoch": 4, "elapsed_seconds": 7394.980740503059, "train_loss": 0.44652427315711973, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.447966605424881, "train_magma_inten_loss": 0.37080472707748413, "train_frag_loss": 3.0067341327667236, "train_loss": 0.5259002447128296, "val_loss": 0.5665907859802246}} +{"step": 27700, "epoch": 4, "elapsed_seconds": 7425.40222124604, "train_loss": 0.445411189198494, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3655756115913391, "train_magma_inten_loss": 0.3108639419078827, "train_frag_loss": 2.514861822128296, "train_loss": 0.4341866374015808, "val_loss": 0.5665907859802246}} +{"step": 27800, "epoch": 4, "elapsed_seconds": 7456.084287426085, "train_loss": 0.43441449165344237, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46162235736846924, "train_magma_inten_loss": 0.4064839482307434, "train_frag_loss": 2.6039514541625977, "train_loss": 0.5331909656524658, "val_loss": 0.5665907859802246}} +{"step": 27900, "epoch": 4, "elapsed_seconds": 7488.428304707049, "train_loss": 0.4384012398123741, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4405832886695862, "train_magma_inten_loss": 0.36139923334121704, "train_frag_loss": 2.73567533493042, "train_loss": 0.5083606243133545, "val_loss": 0.5665907859802246}} +{"step": 28000, "epoch": 4, "elapsed_seconds": 7536.759676447022, "train_loss": 0.4399713799357414, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3416287302970886, "train_magma_inten_loss": 0.2919066846370697, "train_frag_loss": 2.518620491027832, "train_loss": 0.4121105670928955, "val_loss": 0.5665907859802246}} +{"step": 28100, "epoch": 4, "elapsed_seconds": 7577.892234232044, "train_loss": 0.4258372443914413, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3756677508354187, "train_magma_inten_loss": 0.3301860988140106, "train_frag_loss": 2.808748960494995, "train_loss": 0.457744300365448, "val_loss": 0.5665907859802246}} +{"step": 28200, "epoch": 4, "elapsed_seconds": 7616.965752189048, "train_loss": 0.4394468155503273, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.35155025124549866, "train_magma_inten_loss": 0.3156128525733948, "train_frag_loss": 3.005289077758789, "train_loss": 0.44380760192871094, "val_loss": 0.5665907859802246}} +{"step": 28300, "epoch": 4, "elapsed_seconds": 7657.708477408043, "train_loss": 0.4294490575790405, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.27164411544799805, "train_magma_inten_loss": 0.2502647042274475, "train_frag_loss": 2.538905143737793, "train_loss": 0.35271573066711426, "val_loss": 0.5665907859802246}} +{"step": 28400, "epoch": 4, "elapsed_seconds": 7699.492738165078, "train_loss": 0.4371525859832764, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3592643737792969, "train_magma_inten_loss": 0.30052879452705383, "train_frag_loss": 2.8351640701293945, "train_loss": 0.43764057755470276, "val_loss": 0.5665907859802246}} +{"step": 28500, "epoch": 4, "elapsed_seconds": 7741.757204050082, "train_loss": 0.44243044435977935, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3574904799461365, "train_magma_inten_loss": 0.3330249786376953, "train_frag_loss": 2.756798267364502, "train_loss": 0.44508349895477295, "val_loss": 0.5665907859802246}} +{"step": 28600, "epoch": 4, "elapsed_seconds": 7785.86382827803, "train_loss": 0.43150952965021133, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2606739401817322, "train_magma_inten_loss": 0.22435350716114044, "train_frag_loss": 2.4791030883789062, "train_loss": 0.33445075154304504, "val_loss": 0.5665907859802246}} +{"step": 28700, "epoch": 4, "elapsed_seconds": 7838.325803055079, "train_loss": 0.43298866868019104, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4000093340873718, "train_magma_inten_loss": 0.3328971266746521, "train_frag_loss": 2.66876220703125, "train_loss": 0.46966275572776794, "val_loss": 0.5665907859802246}} +{"step": 28800, "epoch": 4, "elapsed_seconds": 7872.911705946084, "train_loss": 0.4454204511642456, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3568287491798401, "train_magma_inten_loss": 0.302804172039032, "train_frag_loss": 2.8889245986938477, "train_loss": 0.4387221038341522, "val_loss": 0.5665907859802246}} +{"step": 28900, "epoch": 4, "elapsed_seconds": 7907.660207260051, "train_loss": 0.444457603096962, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2915092706680298, "train_magma_inten_loss": 0.24982154369354248, "train_frag_loss": 2.4581613540649414, "train_loss": 0.362684428691864, "val_loss": 0.5665907859802246}} +{"step": 29000, "epoch": 4, "elapsed_seconds": 7943.929914383101, "train_loss": 0.43405705779790876, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3561202883720398, "train_magma_inten_loss": 0.3202437460422516, "train_frag_loss": 3.030215263366699, "train_loss": 0.4492679536342621, "val_loss": 0.5665907859802246}} +{"step": 29100, "epoch": 4, "elapsed_seconds": 7986.550183402025, "train_loss": 0.4271855533123016, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3530176281929016, "train_magma_inten_loss": 0.2949998378753662, "train_frag_loss": 2.778625011444092, "train_loss": 0.4296727478504181, "val_loss": 0.5665907859802246}} +{"step": 29200, "epoch": 4, "elapsed_seconds": 8029.061147903092, "train_loss": 0.44224502801895144, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3992525339126587, "train_magma_inten_loss": 0.3227684497833252, "train_frag_loss": 2.529406785964966, "train_loss": 0.4607791304588318, "val_loss": 0.5665907859802246}} +{"step": 29300, "epoch": 4, "elapsed_seconds": 8053.710378572112, "train_loss": 0.4338686737418175, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31325653195381165, "train_magma_inten_loss": 0.27985817193984985, "train_frag_loss": 2.8253085613250732, "train_loss": 0.400123655796051, "val_loss": 0.5665907859802246}} +{"step": 29400, "epoch": 4, "elapsed_seconds": 8077.509145764052, "train_loss": 0.42852667570114134, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3352247476577759, "train_magma_inten_loss": 0.27087917923927307, "train_frag_loss": 2.8396387100219727, "train_loss": 0.41180092096328735, "val_loss": 0.5665907859802246}} +{"step": 29500, "epoch": 4, "elapsed_seconds": 8101.928125544102, "train_loss": 0.43267951637506485, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34450340270996094, "train_magma_inten_loss": 0.2969067096710205, "train_frag_loss": 2.4209511280059814, "train_loss": 0.4123207926750183, "val_loss": 0.5665907859802246}} +{"step": 29600, "epoch": 5, "elapsed_seconds": 8203.758931340068, "train_loss": 0.4328996899724007, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34562477469444275, "train_magma_inten_loss": 0.2696530520915985, "train_frag_loss": 2.9489986896514893, "train_loss": 0.4219602942466736, "val_loss": 0.5665907859802246}} +{"step": 29700, "epoch": 5, "elapsed_seconds": 8228.514756374061, "train_loss": 0.43605826526880265, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42702925205230713, "train_magma_inten_loss": 0.3624250292778015, "train_frag_loss": 2.6534345149993896, "train_loss": 0.4970226585865021, "val_loss": 0.5665907859802246}} +{"step": 29800, "epoch": 5, "elapsed_seconds": 8259.156506354106, "train_loss": 0.42824377983808515, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3357776403427124, "train_magma_inten_loss": 0.30388206243515015, "train_frag_loss": 2.7857747077941895, "train_loss": 0.4217902719974518, "val_loss": 0.5665907859802246}} +{"step": 29900, "epoch": 5, "elapsed_seconds": 8290.148672751035, "train_loss": 0.4210662642121315, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.30078649520874023, "train_magma_inten_loss": 0.24015389382839203, "train_frag_loss": 2.6513030529022217, "train_loss": 0.3720904290676117, "val_loss": 0.5665907859802246}} +{"step": 30000, "epoch": 5, "elapsed_seconds": 8314.79353913304, "train_loss": 0.4371717435121536, "lr": 0.00023619600000000004, "magma_weight": 0.31381059609000006, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.35996055603027344, "train_magma_inten_loss": 0.30305179953575134, "train_frag_loss": 2.563981533050537, "train_loss": 0.42256245017051697, "val_loss": 0.5665907859802246}} diff --git a/shared/package-files/22/2247cadad1b57623c51a598fcfda8f22afa41d0669fdea95f3f36210effc3d2a/fuse.py b/shared/package-files/22/2247cadad1b57623c51a598fcfda8f22afa41d0669fdea95f3f36210effc3d2a/fuse.py new file mode 100644 index 0000000000000000000000000000000000000000..522861b5d26a94723a6c2f05aa7b0c57b8a8e654 --- /dev/null +++ b/shared/package-files/22/2247cadad1b57623c51a598fcfda8f22afa41d0669fdea95f3f36210effc3d2a/fuse.py @@ -0,0 +1,73 @@ +"""Fusion of the simulator distance with the inverse-branch distance (validation study). + +fuse.py INPUT_ROOT VARIANT INVERSE.pkl[,INVERSE2.pkl...] NAME=CACHE.pkl [NAME=CACHE.pkl ...] [--key cos] [--weights ...] + +Simulator distance = mean over the member caches (scorelab format) of VARIANT; inverse distance += mean over the given inverse pickles (``inv/eval_inv.py``). Fused distance per query and +candidate: simulator + w * inverse, then the usual pool mean. One global w for every query. +Reports per-spectrum (ind) and pool-aggregated (agg) Hit@1 with the paired molecule-group +bootstrap difference to the simulator alone. +""" +import argparse +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import scorelab +from scorelab import infer + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('root', type=Path) + p.add_argument('variant') + p.add_argument('inverse') + p.add_argument('members', nargs='+') + p.add_argument('--key', default='cos') + p.add_argument('--weights', type=float, nargs='*', default=[0.05, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0, 1.5, 2.0, 4.0]) + p.add_argument('--strata', action='store_true') + args = p.parse_args() + queries = list(infer.read_jsonl(args.root / 'queries.jsonl')) + pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(args.root / 'candidate_pools.jsonl')} + ev = scorelab.Evaluator(queries, pools) + member = [] + for spec in args.members: + name, path = spec.split('=', 1) + results = pickle.load(open(path, 'rb')) + first = results[next(iter(results))] + member.append([d if d is not None else f for d, f in zip(results[args.variant], first)]) + del results + sim = [None if any(m[i] is None for m in member) else np.mean([m[i] for m in member], axis=0) for i in range(len(queries))] + parts = [pickle.load(open(path, 'rb'))[args.key] for path in args.inverse.split(',')] + inv = [np.mean([part[i] for part in parts], axis=0).astype(np.float64) for i in range(len(queries))] + base = ev.ranks(sim, 0.0), ev.ranks(sim, 1.0) + print('simulator ' + ev.line('ind', base[0])) + print('simulator ' + ev.line('agg', base[1])) + own = ev.ranks(inv, 0.0), ev.ranks(inv, 1.0) + print('inverse ' + ev.line('ind', own[0], base[0])) + print('inverse ' + ev.line('agg', own[1], base[1]), flush=True) + best = None + for w in args.weights: + fused = [None if s is None else s + w * d for s, d in zip(sim, inv)] + ind, agg = ev.ranks(fused, 0.0, fallback=inv), ev.ranks(fused, 1.0, fallback=inv) + print(f'w={w:<6g} ' + ev.line('ind', ind, base[0])) + print(f'w={w:<6g} ' + ev.line('agg', agg, base[1]), flush=True) + if best is None or (agg == 0).mean() > (best[1] == 0).mean(): + best = (w, agg) + if args.strata: + w, agg = best + mz = np.array([q['precursor_mz'] for q in queries]) + adduct = np.array([q['adduct'] for q in queries]) + ce = np.array([q['collision_energy'] is not None for q in queries]) + print(f'strata at w={w}: agg Hit@1 simulator -> fused (queries)') + for name, mask in [('[M+H]+', adduct == '[M+H]+'), ('[M+Na]+', adduct == '[M+Na]+'), ('CE given', ce), ('CE missing', ~ce), + ('m/z < 300', mz < 300), ('300-500', (mz >= 300) & (mz < 500)), ('500-700', (mz >= 500) & (mz < 700)), + ('>= 700', mz >= 700)]: + print(f' {name:12s} {np.mean(base[1][mask] == 0):.4f} -> {np.mean(agg[mask] == 0):.4f} ({mask.sum()})') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/22/22482fc489c97e37de1c2177cf654374cc958c1f72a788269591849d757134a0/validation.jsonl b/shared/package-files/22/22482fc489c97e37de1c2177cf654374cc958c1f72a788269591849d757134a0/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..d2b0a7f4a502c44e7b7f1e2063dd288cc96c8a19 --- /dev/null +++ b/shared/package-files/22/22482fc489c97e37de1c2177cf654374cc958c1f72a788269591849d757134a0/validation.jsonl @@ -0,0 +1,10 @@ +{"step": 5000, "elapsed": 121.40688379108906, "val_loss": 0.036577283928070234, "val_cos": 0.6400906965646553, "val_loss_ema": 0.035260315114185786, "val_cos_ema": 0.6527446739168897} +{"step": 10000, "elapsed": 218.64231286710128, "val_loss": 0.03294205904878218, "val_cos": 0.6823312719247806, "val_loss_ema": 0.03166316966646287, "val_cos_ema": 0.6933056688374981, "ind_cos": 0.4269391116372433, "agg_cos": 0.45632816923156105, "ind_nll": 0.2793247207782181, "agg_nll": 0.25863400072057235, "retrieval_seconds": 11.530367560917512} +{"step": 15000, "elapsed": 330.3985719040502, "val_loss": 0.031660898400933564, "val_cos": 0.703660842743933, "val_loss_ema": 0.03031666026419009, "val_cos_ema": 0.7126848477147563} +{"step": 20000, "elapsed": 442.6312280650018, "val_loss": 0.03025526776844637, "val_cos": 0.7159169559477778, "val_loss_ema": 0.029355065184126942, "val_cos_ema": 0.7258356447674867, "ind_cos": 0.495290545061506, "agg_cos": 0.5195841268207319, "ind_nll": 0.3696021411292398, "agg_nll": 0.35524216377579904, "retrieval_seconds": 11.309179823030718} +{"step": 25000, "elapsed": 551.3109733470483, "val_loss": 0.029532987266814227, "val_cos": 0.726935590704456, "val_loss_ema": 0.02929995126109207, "val_cos_ema": 0.7297817157382328} +{"step": 30000, "elapsed": 650.677494857111, "val_loss": 0.02974170062611785, "val_cos": 0.7290448330097727, "val_loss_ema": 0.028814111307391456, "val_cos_ema": 0.7371385678303052, "ind_cos": 0.5120181172474136, "agg_cos": 0.549642287302486, "ind_nll": 0.4011529157445056, "agg_nll": 0.38663853003242576, "retrieval_seconds": 11.366464950027876} +{"step": 35000, "elapsed": 759.0612655470613, "val_loss": 0.029209357060457908, "val_cos": 0.7338960676935895, "val_loss_ema": 0.028294090064053333, "val_cos_ema": 0.7418983361695146} +{"step": 40000, "elapsed": 856.2324718420859, "val_loss": 0.02859549846606957, "val_cos": 0.7419642311428792, "val_loss_ema": 0.028326214099177013, "val_cos_ema": 0.7435733175319432, "ind_cos": 0.5247825415615832, "agg_cos": 0.562509650522415, "ind_nll": 0.41669669051417985, "agg_nll": 0.4035205105769726, "retrieval_seconds": 11.363689224002883} +{"step": 45000, "elapsed": 964.9528176950989, "val_loss": 0.02769213755037874, "val_cos": 0.7494391387793375, "val_loss_ema": 0.02820316287013272, "val_cos_ema": 0.7460510137672745} +{"step": 50000, "elapsed": 1065.981066885055, "val_loss": 0.02860307288529409, "val_cos": 0.743471534678348, "val_loss_ema": 0.02836841589338505, "val_cos_ema": 0.7449706453223918, "ind_cos": 0.5250398888259817, "agg_cos": 0.5633331617684904, "ind_nll": 0.4202480827628802, "agg_nll": 0.41036594780997476, "retrieval_seconds": 11.291447255993262} diff --git a/shared/package-files/22/226b69a1f981df4100272d5626afef8cc961c8ad0f6ef2d4353d4b170744e58e/recur-weighted-10.log b/shared/package-files/22/226b69a1f981df4100272d5626afef8cc961c8ad0f6ef2d4353d4b170744e58e/recur-weighted-10.log new file mode 100644 index 0000000000000000000000000000000000000000..f629dd90ea8e63a87642fc846c41af6d8b2fff57 --- /dev/null +++ b/shared/package-files/22/226b69a1f981df4100272d5626afef8cc961c8ad0f6ef2d4353d4b170744e58e/recur-weighted-10.log @@ -0,0 +1,2 @@ +weighted tol 10 mDa: 17307 of 19429 spectra in groups of >= 3; peaks 432025 -> 432025; 1 s +wrote /workspace/research/inv/recur/weighted-10.npz 154 s diff --git a/shared/package-files/22/227d6102bbb5328f8d88440470e4b3b83d5ab292a603bcb12d20481a517f0349/build-5Ms-I1+I3x2g07-L.log b/shared/package-files/22/227d6102bbb5328f8d88440470e4b3b83d5ab292a603bcb12d20481a517f0349/build-5Ms-I1+I3x2g07-L.log new file mode 100644 index 0000000000000000000000000000000000000000..b6690164de6e4d9aad91e33ab0c5d9fbf3076841 --- /dev/null +++ b/shared/package-files/22/227d6102bbb5328f8d88440470e4b3b83d5ab292a603bcb12d20481a517f0349/build-5Ms-I1+I3x2g07-L.log @@ -0,0 +1,290 @@ +{ + "built": "/run-state/workspace/research/builds/5Ms-I1+I3x2g07-L", + "checkpoint_sha256": "4ffa8ea9f5153437613890358e2cb23410064c1daa236232f75f828b30842e75", + "members": [ + { + "source": "runs/B-all-b32/checkpoints/step-0020000-ema.ckpt", + "sha256": "80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 5136.2172065590275, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B-all-b32/checkpoints/step-0030000-ema.ckpt", + "sha256": "0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8314.79353913304, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0020000-ema.ckpt", + "sha256": "ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 6945.18486677701, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0030000-ema.ckpt", + "sha256": "f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 9298.063542745003, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/S2-B20k-synth/checkpoints/step-0030000-ema.ckpt", + "sha256": "44742fa31f337e59b543d903018780560569c2e8e50a008ba008859c8440e3a2", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8906.84206694903, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "own-checkpoint:6c5a43fada335e5f4e9f8265ec6cfd54a8f317eb8d2100d96ea3731809005be2", + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus (auxiliary intensity term)", + "synthetic": { + "manifest_sha256": "431454e702f8da3194684fc9a565135d29a38a407aaa31e9399d871360c6e962", + "per_item": 1, + "weight": 1.0, + "schedule": "e2e", + "instrument": "flag" + } + } + ], + "config": { + "sparse_k": 100, + "inference_batch_size": 128, + "workers": 14, + "num_bins": 150000, + "upper_limit": 1500, + "max_observed_peaks": 50, + "observed_intensity_threshold": 0.001, + "ensemble": "prediction", + "pool_aggregation": 1.0, + "autocast": false, + "model": { + "pe_embed_k": 14, + "embed_elem_group": true, + "multi_hop_max_dist": 10 + }, + "checkpoint": "model.pt", + "views": [ + { + "precursor_window": 0.5, + "pred_power": 0.75, + "match_ppm": 20, + "match_floor_mda": 4, + "match_by_instrument": { + "Orbitrap": [ + 10, + 1 + ] + } + } + ], + "inverse": { + "pooled": true, + "score": { + "members": "probability", + "power": 0.7 + }, + "weight_domain": 0.75, + "weight_other": 0.05, + "weight_other_single": 0.5, + "batch": 2048 + }, + "library": { + "kind": "sum", + "k": 20, + "top": 32, + "power": 6, + "debias": true, + "weight_domain": 0.0, + "weight_other": 0.4, + "weight_other_single": 0.0 + }, + "inverse_members": [ + { + "source": "runs/I1-ff512x6/step-0050000-ema.pt", + "sha256": "c131cac451c9d360d13a7576304a4f3ce59c4e542d10ec5e8e4b943838ba385b", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I1-ff512x6", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.2, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I3-ff512x6-real08/step-0030000-ema.pt", + "sha256": "27125fd05eb958236b7f815eb97d8ae9b148aedd5c552067361a7bc116dffbae", + "step": 30000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I3-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I3-ff512x6-real08/step-0100000-ema.pt", + "sha256": "d3a914a9bf011751408a2739cb18b0312df430fd31447b9115b0010861ab08e3", + "step": 100000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I3-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + } + ], + "library_asset": { + "schema": "train-library/v1", + "fold": "train", + "spectra": 194119, + "molecules": 25046, + "bin": 0.01, + "prior_sample": 1024, + "prior_seed": 0, + "fragment_entries": 6765621, + "loss_entries": 6763777, + "source": "/workspace/data/train.jsonl", + "source_sha256": "de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc", + "structure_store": "/run-state/workspace/research/inv/real-train.npz", + "structure_store_sha256": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "sha256": "22d1ddb216eef78d5040209ff6526371e5fcd8aac88e68a36823b6d5e73b3712", + "elapsed_seconds": 13.499361125999712, + "training_data": "MassSpecGym v1.5 train fold" + }, + "method": "native-glacier-all-conditions-forward-simulation+formula-transformer-inverse-fusion+train-library-neighbour-fusion", + "inference_runtime": "/opt/glacier/bin/python" + } +} diff --git a/shared/package-files/28/2804e7b9760bb69c26eeee10e497c40277d8399398fe6288cc2dec108433c325/netprop-neigh-inv-s0.8.log b/shared/package-files/28/2804e7b9760bb69c26eeee10e497c40277d8399398fe6288cc2dec108433c325/netprop-neigh-inv-s0.8.log new file mode 100644 index 0000000000000000000000000000000000000000..26411e6e4454694f587fa331ffb57eff942293d4 --- /dev/null +++ b/shared/package-files/28/2804e7b9760bb69c26eeee10e497c40277d8399398fe6288cc2dec108433c325/netprop-neigh-inv-s0.8.log @@ -0,0 +1,10 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4041 (domain 0.3638 / other 0.4447) macro 0.3275 + lam 1.00/1.00: Hit@1 0.7655 (-0.0059 [-0.0389, +0.0257]) macro +0.0006 [-0.0062, +0.0062] pools +66 -64 | no top 20 -0.0058 cap30 -0.0071 [-0.0263, +0.0107] | Hit@5 -0.0405 macro@5 -0.0041 cap30@5 -0.0145 + +k=10 p=2.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4084 (domain 0.3679 / other 0.4490) macro 0.3305 + lam 1.00/1.00: Hit@1 0.7690 (-0.0023 [-0.0354, +0.0292]) macro +0.0030 [-0.0038, +0.0089] pools +69 -59 | no top 20 -0.0018 cap30 -0.0030 [-0.0220, +0.0151] | Hit@5 -0.0395 macro@5 -0.0032 cap30@5 -0.0133 + +k=10 p=1.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4113 (domain 0.3677 / other 0.4551) macro 0.3328 + lam 1.00/1.00: Hit@1 0.7694 (-0.0020 [-0.0349, +0.0296]) macro +0.0032 [-0.0035, +0.0095] pools +69 -58 | no top 20 -0.0014 cap30 -0.0026 [-0.0214, +0.0151] | Hit@5 -0.0401 macro@5 -0.0038 cap30@5 -0.0140 diff --git a/shared/package-files/28/282255e7b2da7a61b86b091c34fd2e5bbeea2a5b789e571e9d3f9a8b17cae659/recur-ms10-p48.log b/shared/package-files/28/282255e7b2da7a61b86b091c34fd2e5bbeea2a5b789e571e9d3f9a8b17cae659/recur-ms10-p48.log new file mode 100644 index 0000000000000000000000000000000000000000..b3de1e1e72b3c70f3e54a4855d3c690276d1d941 --- /dev/null +++ b/shared/package-files/28/282255e7b2da7a61b86b091c34fd2e5bbeea2a5b789e571e9d3f9a8b17cae659/recur-ms10-p48.log @@ -0,0 +1,3 @@ +merged tol 10 mDa: 17307 of 19429 spectra in groups of >= 3; peaks 432025 -> 1838331; energy set missing for 0; 0 s +select_peaks (100,) annotate (48,) +wrote /workspace/research/inv/recur/ms10-p48.npz 99 s diff --git a/shared/package-files/28/284950469ffa8b8a1c7f89264927cb6c0b03707c5bf13af087abd2cba78ada90/replays-5Ms-I9b+I13-L-ion-net.sh b/shared/package-files/28/284950469ffa8b8a1c7f89264927cb6c0b03707c5bf13af087abd2cba78ada90/replays-5Ms-I9b+I13-L-ion-net.sh new file mode 100644 index 0000000000000000000000000000000000000000..2079ef50902ab6fdbf8aa91e05f37196f98efc1b --- /dev/null +++ b/shared/package-files/28/284950469ffa8b8a1c7f89264927cb6c0b03707c5bf13af087abd2cba78ada90/replays-5Ms-I9b+I13-L-ion-net.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +cd /workspace/research +N=5Ms-I9b+I13-L-ion-net +for pair in val-tiny:tiny edge-input:edge val-sub:sub; do + input=${pair%%:*}; tag=${pair##*:}; name=$input; [ "$input" = edge-input ] && name=edge + bash allcond/checks/replay.sh builds/$N /workspace/research/$input net-$tag 8-21 > logs/replay-$N-$name.log 2>&1 + mkdir -p evals/replay/$N-$tag; cp /tmp/reloc-net-$tag/out/rankings.jsonl evals/replay/$N-$tag/rankings.jsonl +done +date -u +%H:%M:%S > logs/replays-$N.done diff --git a/shared/package-files/28/2868f987d0f0f48e55f3687a9a8133074a57ebb7e24c03175925940a1c29bb38/anchor_fused.py b/shared/package-files/28/2868f987d0f0f48e55f3687a9a8133074a57ebb7e24c03175925940a1c29bb38/anchor_fused.py new file mode 100644 index 0000000000000000000000000000000000000000..e79bccf8abcfab5f380e5f77a2ccdd965c677199 --- /dev/null +++ b/shared/package-files/28/2868f987d0f0f48e55f3687a9a8133074a57ebb7e24c03175925940a1c29bb38/anchor_fused.py @@ -0,0 +1,67 @@ +"""Tolerance-matched forward distance inside the fused rule (development only). + +anchor_fused.py INVERSE.pkl:KEY[+...] MEMBER=ANCHOR.pkl[,MEMBER=ANCHOR.pkl...] VARIANT[,VARIANT...] [--grid] + +Reference: the released fused rule on the released forward view (fixed 0.01 Da bins). For every +variant the forward distance is replaced by the tolerance-matched distance of the same members; +fusion constants as released unless --grid. Paired bootstrap over pools; validation labels: +evaluation only. +""" +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from fuselab import Lab +from fusion_rule import MEMBERS + + +def main(): + inverse, member_spec, variants = sys.argv[1], sys.argv[2].split(','), sys.argv[3].split(',') + grid = '--grid' in sys.argv + ref_lab = Lab('/workspace/research/validation-input', 'noprec_pp0.75', MEMBERS).setup() + pools = len(ref_lab.members) + parts = [] + for item in inverse.split('+'): + path, key = item.rsplit(':', 1) + loaded = pickle.load(open(path, 'rb'))[key] + parts.append([ref_lab.matrix(loaded, s) for s in range(pools)]) + inv = [np.mean([part[s] for part in parts], axis=0) for s in range(pools)] + dom = [ref_lab.domain[m] for m in ref_lab.members] + mixed = np.array([d.any() and not d.all() for d in dom]) + alldom = np.array([d.all() for d in dom]) + size = np.array([len(m) for m in ref_lab.members], dtype=float) + + def fused(lab, wd=0.75, wn=0.05, c=0.5): + sim = [lab.matrix(lab.sim, s).mean(0) for s in range(pools)] + def rule(s): + w = np.where(dom[s], wd, max(wn, c / len(dom[s]))) + return sim[s] + (w[:, None] * inv[s]).mean(0) + return lab.pool_rule(lambda s: sim[s]), lab.pool_rule(rule) + + def strata(rank): + hit = np.array([rank[m[0]] == 0 for m in ref_lab.members]) + f = lambda mask: (hit[mask] * size[mask]).sum() / size[mask].sum() + return f'pools: domain {f(alldom):.4f} mixed {f(mixed):.4f} other {f(~alldom & ~mixed):.4f}' + + ref_forward, ref_fused = fused(ref_lab) + print(ref_lab.line('released forward', ref_forward)) + print(ref_lab.line('released fused', ref_fused), '|', strata(ref_fused)) + for variant in variants: + lab = Lab('/workspace/research/validation-input', variant, member_spec).setup() + forward, rank = fused(lab) + print(ref_lab.line(f'{variant} forward', forward, ref_forward), flush=True) + print(ref_lab.line(f'{variant} fused', rank, ref_fused), '|', strata(rank), flush=True) + if grid: + for wd in (0.5, 0.6, 0.9, 1.0): + print(ref_lab.line(f'{variant} fused wd={wd}', fused(lab, wd=wd)[1], ref_fused), flush=True) + for wn in (0.035, 0.07, 0.1): + print(ref_lab.line(f'{variant} fused wn={wn}', fused(lab, wn=wn)[1], ref_fused), flush=True) + for c in (0.25, 1.0): + print(ref_lab.line(f'{variant} fused c={c}', fused(lab, c=c)[1], ref_fused), flush=True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/28/2877620d291592f08b06d878f89de2e7fee81bc252b17e82776f01632ac9a4f7/swap-quick-N5-recur-ms10-p48.log b/shared/package-files/28/2877620d291592f08b06d878f89de2e7fee81bc252b17e82776f01632ac9a4f7/swap-quick-N5-recur-ms10-p48.log new file mode 100644 index 0000000000000000000000000000000000000000..97410f6768c5b716dc4fd9755d452b9405d3beb2 --- /dev/null +++ b/shared/package-files/28/2877620d291592f08b06d878f89de2e7fee81bc252b17e82776f01632ac9a4f7/swap-quick-N5-recur-ms10-p48.log @@ -0,0 +1,4 @@ +released rule without consensus: Hit@1 0.7685 domain 0.9301 other 0.6062 macro 0.8650 Hit@5 0.8793 Hit@20 0.9358 +lin w 0.05: Hit@1 0.7698 (+0.0013 [-0.0074, +0.0102]) macro 0.8680 (+0.0030 [-0.0006, +0.0068]) pools +23 -13 | other 0.6064 Hit@5 0.8830 Hit@20 0.9366 +lin w 0.10: Hit@1 0.7708 (+0.0023 [-0.0065, +0.0101]) macro 0.8683 (+0.0032 [-0.0006, +0.0068]) pools +24 -13 | other 0.6085 Hit@5 0.8819 Hit@20 0.9357 +lin w 0.20: Hit@1 0.7738 (+0.0053 [-0.0067, +0.0172]) macro 0.8683 (+0.0032 [-0.0003, +0.0071]) pools +26 -15 | other 0.6140 Hit@5 0.8771 Hit@20 0.9314 diff --git a/shared/package-files/28/287b24b9360df3266453e3c37811bc64f4728bd23a1c63b69d78274fc9c00b15/netprop-released.log b/shared/package-files/28/287b24b9360df3266453e3c37811bc64f4728bd23a1c63b69d78274fc9c00b15/netprop-released.log new file mode 100644 index 0000000000000000000000000000000000000000..f3584d71c9527abe3f16601f95311235b3910a2c --- /dev/null +++ b/shared/package-files/28/287b24b9360df3266453e3c37811bc64f4728bd23a1c63b69d78274fc9c00b15/netprop-released.log @@ -0,0 +1,4 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4493 (domain 0.4187 / other 0.4799) macro 0.3804 + lam 1.00/1.00: Hit@1 0.8022 (+0.0308 [+0.0100, +0.0559]) macro +0.0148 [+0.0089, +0.0213] pools +83 -33 | no top 20 +0.0245 cap30 +0.0244 [+0.0102, +0.0396] | Hit@5 -0.0078 macro@5 +0.0077 cap30@5 +0.0117 | twin +32 -7 other +51 -26 | dom +0.0050 oth +0.0567 diff --git a/shared/package-files/28/2892229f977c3a60b2ac81ca7b676d00441aa1ad1368a3b23e4a07193c07dcda/eval-score-I16+I18+I20.log b/shared/package-files/28/2892229f977c3a60b2ac81ca7b676d00441aa1ad1368a3b23e4a07193c07dcda/eval-score-I16+I18+I20.log new file mode 100644 index 0000000000000000000000000000000000000000..6e96358df0426174ad6fffa9662826ff18d857d9 --- /dev/null +++ b/shared/package-files/28/2892229f977c3a60b2ac81ca7b676d00441aa1ad1368a3b23e4a07193c07dcda/eval-score-I16+I18+I20.log @@ -0,0 +1,41 @@ +19429 queries, 3 members, 82.9 s +cos pool rule all=0.6109 dom=0.8498 non=0.3711 h5=0.7125 macro=0.7298 +cen pool rule all=0.5946 dom=0.8275 non=0.3608 h5=0.7099 macro=0.7067 +cos_pm pool rule all=0.6117 dom=0.8487 non=0.3737 h5=0.7142 macro=0.7292 +dot pool rule all=0.5976 dom=0.8128 non=0.3815 h5=0.7499 macro=0.7159 +geo pool rule all=0.5966 dom=0.8364 non=0.3558 h5=0.7058 macro=0.7165 +idf05 pool rule all=0.6143 dom=0.8522 non=0.3755 h5=0.7256 macro=0.7295 +idf1 pool rule all=0.6130 dom=0.8469 non=0.3781 h5=0.7305 macro=0.7298 +lin pool rule all=0.5702 dom=0.8011 non=0.3384 h5=0.6876 macro=0.6887 +log01 pool rule all=0.6169 dom=0.8526 non=0.3802 h5=0.7596 macro=0.7289 +log05 pool rule all=0.6178 dom=0.8573 non=0.3774 h5=0.7600 macro=0.7369 +log20 pool rule all=0.6160 dom=0.8565 non=0.3745 h5=0.7305 macro=0.7357 +nll02 pool rule all=0.4635 dom=0.7411 non=0.1848 h5=0.6048 macro=0.6004 +nll10 pool rule all=0.4247 dom=0.6735 non=0.1749 h5=0.5663 macro=0.5481 +poolcen pool rule all=0.5950 dom=0.8178 non=0.3714 h5=0.7208 macro=0.7079 +pow020 pool rule all=0.5809 dom=0.8126 non=0.3482 h5=0.7465 macro=0.6994 +pow030 pool rule all=0.5983 dom=0.8285 non=0.3672 h5=0.7505 macro=0.7123 +pow040 pool rule all=0.6082 dom=0.8413 non=0.3741 h5=0.7632 macro=0.7236 +pow05 pool rule all=0.6114 dom=0.8500 non=0.3718 h5=0.7312 macro=0.7321 +pow05idf025 pool rule all=0.6146 dom=0.8528 non=0.3755 h5=0.7622 macro=0.7327 +pow05idf05 pool rule all=0.6142 dom=0.8528 non=0.3746 h5=0.7673 macro=0.7324 +pow05m pool rule all=0.6151 dom=0.8507 non=0.3784 h5=0.7312 macro=0.7327 +pow05s pool rule all=0.6119 dom=0.8502 non=0.3727 h5=0.7231 macro=0.7301 +pow060 pool rule all=0.6200 dom=0.8545 non=0.3845 h5=0.7273 macro=0.7380 +pow060idf025 pool rule all=0.6186 dom=0.8571 non=0.3791 h5=0.7310 macro=0.7377 +pow060idf050 pool rule all=0.6186 dom=0.8566 non=0.3796 h5=0.7353 macro=0.7366 +pow060m pool rule all=0.6193 dom=0.8531 non=0.3845 h5=0.7308 macro=0.7360 +pow065 pool rule all=0.6175 dom=0.8525 non=0.3816 h5=0.7266 macro=0.7351 +pow070 pool rule all=0.6165 dom=0.8524 non=0.3797 h5=0.7296 macro=0.7345 +pow070idf025 pool rule all=0.6188 dom=0.8550 non=0.3816 h5=0.7326 macro=0.7374 +pow070idf050 pool rule all=0.6174 dom=0.8562 non=0.3776 h5=0.7340 macro=0.7369 +pow070m pool rule all=0.6191 dom=0.8538 non=0.3835 h5=0.7241 macro=0.7354 +pow075 pool rule all=0.6173 dom=0.8532 non=0.3804 h5=0.7268 macro=0.7348 +pow080 pool rule all=0.6148 dom=0.8528 non=0.3759 h5=0.7249 macro=0.7348 +pow080m pool rule all=0.6157 dom=0.8533 non=0.3771 h5=0.7201 macro=0.7339 +pow085 pool rule all=0.6123 dom=0.8516 non=0.3722 h5=0.7236 macro=0.7327 +pow085idf025 pool rule all=0.6159 dom=0.8527 non=0.3781 h5=0.7279 macro=0.7342 +pow085idf050 pool rule all=0.6141 dom=0.8543 non=0.3729 h5=0.7304 macro=0.7324 +pow090 pool rule all=0.6099 dom=0.8494 non=0.3695 h5=0.7194 macro=0.7301 +pow2 pool rule all=0.5809 dom=0.8146 non=0.3463 h5=0.7014 macro=0.6991 +tani pool rule all=0.5925 dom=0.8242 non=0.3598 h5=0.7126 macro=0.7120 diff --git a/shared/package-files/28/28f24d6c9e036f2dd4fbc1a8eb9d5408568f9d9b2503f3a37264c7211a05a294/norm_fusion.py b/shared/package-files/28/28f24d6c9e036f2dd4fbc1a8eb9d5408568f9d9b2503f3a37264c7211a05a294/norm_fusion.py new file mode 100644 index 0000000000000000000000000000000000000000..ce48f233b2bf52edaa167c06e42cc287e3228f1f --- /dev/null +++ b/shared/package-files/28/28f24d6c9e036f2dd4fbc1a8eb9d5408568f9d9b2503f3a37264c7211a05a294/norm_fusion.py @@ -0,0 +1,91 @@ +"""Pool-normalized fusion of the forward and inverse distances (development only). + +norm_fusion.py INVERSE.pkl:KEY[+...] + +Question: the released rule adds raw distances (forward JS distance + w * inverse cosine +distance). In large non-domain pools the forward distances are almost flat, so any inverse +weight above 0.05 overrides a forward ranking that is consistent over hundreds of spectra. +Does normalizing each branch within the pool (z-score, min-max to the median, or ranks) before +the addition remove the need for the size-dependent weight and gain accuracy? +Forward: pool mean of the released pair; inverse: pool mean of the pooled inverse distances. +w = w_d for all-domain pools, w_n for pools without a domain spectrum, the spectrum-weighted +mean of both for mixed pools. Validation labels: evaluation only. +""" +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from fuselab import Lab +from fusion_rule import MEMBERS + + +def main(): + inverse = sys.argv[1] + lab = Lab('/workspace/research/validation-input', 'noprec_pp0.75', MEMBERS).setup() + pools = len(lab.members) + parts = [] + for item in inverse.split('+'): + path, key = item.rsplit(':', 1) + loaded = pickle.load(open(path, 'rb'))[key] + parts.append([lab.matrix(loaded, s) for s in range(pools)]) + inv = [np.mean([part[s] for part in parts], axis=0) for s in range(pools)] + sim = [lab.matrix(lab.sim, s) for s in range(pools)] + dom = [lab.domain[m] for m in lab.members] + share = np.array([d.mean() for d in dom]) + size = np.array([len(d) for d in dom]) + + def released(s): + w = np.where(dom[s], 0.75, max(0.05, 0.5 / len(dom[s]))) + return sim[s].mean(0) + (w[:, None] * inv[s]).mean(0) + + reference = lab.pool_rule(released) + print(lab.line('released', reference)) + forward = [m.mean(0) for m in sim] + backward = [m.mean(0) for m in inv] + + def zscore(v): + return (v - v.mean()) / (v.std() + 1e-9) + + def robust(v): + return (v - np.median(v)) / (np.median(v) - v.min() + 1e-9) + + def ranks(v): + return np.argsort(np.argsort(v)) / max(len(v) - 1, 1) + + def logrank(v): + return np.log1p(np.argsort(np.argsort(v))) + + best = {} + for name, norm in (('zscore', zscore), ('robust', robust), ('rank', ranks), ('logrank', logrank)): + nf = [norm(v) for v in forward] + nb = [norm(v) for v in backward] + rows = [] + for wd in (0.25, 0.5, 0.75, 1.0, 1.5, 2.0): + for wn in (0.05, 0.1, 0.2, 0.35, 0.5, 0.75, 1.0): + rank = lab.pool_rule(lambda s: nf[s] + (share[s] * wd + (1 - share[s]) * wn) * nb[s]) + rows.append(((rank == 0).mean(), wd, wn, rank)) + rows.sort(key=lambda r: -r[0]) + for hit, wd, wn, rank in rows[:4]: + print(lab.line(f'{name} wd={wd} wn={wn}', rank, reference), flush=True) + # the same with the size rule of the release on the non-domain weight + rows = [] + for wd in (0.5, 0.75, 1.0, 1.5): + for wn in (0.05, 0.1, 0.2, 0.35): + for c in (0.5, 1.0, 2.0): + rank = lab.pool_rule(lambda s: nf[s] + (share[s] * wd + (1 - share[s]) * max(wn, c / size[s])) * nb[s]) + rows.append(((rank == 0).mean(), wd, wn, c, rank)) + rows.sort(key=lambda r: -r[0]) + for hit, wd, wn, c, rank in rows[:3]: + print(lab.line(f'{name} wd={wd} wn=max({wn},{c}/N)', rank, reference), flush=True) + # forward normalized only (keeps the inverse cosine scale): forward z-score times a scale + for scale in (0.01, 0.02, 0.05, 0.1): + nf = [zscore(v) * scale for v in forward] + rank = lab.pool_rule(lambda s: nf[s] + (np.where(dom[s], 0.75, max(0.05, 0.5 / len(dom[s])))[:, None] * inv[s]).mean(0)) + print(lab.line(f'forward z x {scale} + released inverse term', rank, reference), flush=True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/2a/2a77f7c2c883edb38fc1d43b69f1b8ce4a4ffb20b189d8c4e3ef8340d5b73c9a/compositions.sh b/shared/package-files/2a/2a77f7c2c883edb38fc1d43b69f1b8ce4a4ffb20b189d8c4e3ef8340d5b73c9a/compositions.sh new file mode 100644 index 0000000000000000000000000000000000000000..ca973325f573c1fbb76114b6309b31b359b6d442 --- /dev/null +++ b/shared/package-files/2a/2a77f7c2c883edb38fc1d43b69f1b8ce4a4ffb20b189d8c4e3ef8340d5b73c9a/compositions.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# compositions.sh - forward member sets with the dropout-0.2 run B3 (E46): distance of the mean +# prediction, forward only and in the released fused rule, against the released four members. +set -uo pipefail +cd /workspace/research +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps GLACIER_SOURCE=/workspace/research/ms-pred/src OMP_NUM_THREADS=6 +py=/opt/glacier/bin/python +A=evals/anchor +B3=evals/B3-30k-full/pred/scorelab-v7.pkl +taskset -c 16-21 $py allcond/analysis/stack_members.py evals/stack/5M-B3-30k evals/stack/4M evals/B3-30k-full/pred +taskset -c 16-21 $py allcond/analysis/ensemble_mean.py validation-input evals/stack/5M-B3-30k evals/anchor2/5M-B3-30k-ensmean.pkl \ + --binned $A/B20k-v1.pkl,$A/B30k-v1.pkl,$A/B2-20k-v1.pkl,$A/B2-30k-v1.pkl,$B3 > logs/ensemble-mean-5M-B3-30k.log 2>&1 +rm -f evals/stack/5M-B3-30k/masses.npy evals/stack/5M-B3-30k/intens.npy +taskset -c 16-21 $py allcond/analysis/stack_members.py evals/stack/3S-30k evals/B30k-full/pred evals/B2-30k-full/pred evals/B3-30k-full/pred +taskset -c 16-21 $py allcond/analysis/ensemble_mean.py validation-input evals/stack/3S-30k evals/anchor2/3S-30k-ensmean.pkl \ + --binned $A/B30k-v1.pkl,$A/B2-30k-v1.pkl,$B3 > logs/ensemble-mean-3S-30k.log 2>&1 +rm -f evals/stack/3S-30k/masses.npy evals/stack/3S-30k/intens.npy +INV="evals/I1/inv-50k.pkl:pooled+evals/I3/inv-30k.pkl:pooled+evals/I3/inv-100k.pkl:pooled" +taskset -c 16-21 $py allcond/analysis/big_pools.py "$INV" "4Mp:ENS=evals/anchor2/4M-ensmean.pkl:Dmean:1" \ + "6Mp:ENS=evals/anchor2/6M-ensmean.pkl:Dmean:1" "5Mp:ENS=evals/anchor2/5M-B3-30k-ensmean.pkl:Dmean:1" \ + "3Sp:ENS=evals/anchor2/3S-30k-ensmean.pkl:Dmean:1" --reference 4Mp > logs/big-pools-B3-compositions.log 2>&1 +taskset -c 16-21 $py allcond/analysis/anchor_mix.py "$INV" ENS=evals/anchor2/6M-ensmean.pkl Dmean --lambdas 1 > logs/anchor-mix-6M.log 2>&1 +taskset -c 16-21 $py allcond/analysis/anchor_mix.py "$INV" ENS=evals/anchor2/5M-B3-30k-ensmean.pkl Dmean --lambdas 1 > logs/anchor-mix-5M-B3-30k.log 2>&1 +taskset -c 16-21 $py allcond/analysis/anchor_mix.py "$INV" ENS=evals/anchor2/3S-30k-ensmean.pkl Dmean --lambdas 1 > logs/anchor-mix-3S-30k.log 2>&1 +echo finished at $(date -u) diff --git a/shared/package-files/2a/2a89f10a8437d0a5f352caee40dfb6e4e986539d52ee64899ad12f55ee43c1f8/validation.jsonl b/shared/package-files/2a/2a89f10a8437d0a5f352caee40dfb6e4e986539d52ee64899ad12f55ee43c1f8/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..d4ff956589cd505e869e31f9193c52d80686c72c --- /dev/null +++ b/shared/package-files/2a/2a89f10a8437d0a5f352caee40dfb6e4e986539d52ee64899ad12f55ee43c1f8/validation.jsonl @@ -0,0 +1,10 @@ +{"step": 5000, "elapsed": 137.327715260908, "val_loss": 0.03825731398706006, "val_cos": 0.6265085098507708, "val_loss_ema": 0.03638853210263873, "val_cos_ema": 0.643288694975938} +{"step": 10000, "elapsed": 230.09623041702434, "val_loss": 0.03358956645769432, "val_cos": 0.6793401880022293, "val_loss_ema": 0.03217789875116711, "val_cos_ema": 0.6911908473239101, "ind_cos": 0.4276082145246796, "agg_cos": 0.4473210149776108, "ind_nll": 0.2935817592258994, "agg_nll": 0.2734572031499305, "retrieval_seconds": 12.938931708224118} +{"step": 15000, "elapsed": 392.723735709209, "val_loss": 0.032221055152308366, "val_cos": 0.696992400867019, "val_loss_ema": 0.030288570631218554, "val_cos_ema": 0.7139636927241495} +{"step": 20000, "elapsed": 549.0737253781408, "val_loss": 0.03140134859013909, "val_cos": 0.7082678739738277, "val_loss_ema": 0.02992658101191357, "val_cos_ema": 0.7220565982029119, "ind_cos": 0.48823923001698494, "agg_cos": 0.510679911472541, "ind_nll": 0.3741314529826548, "agg_nll": 0.3596170672705749, "retrieval_seconds": 17.850752762053162} +{"step": 25000, "elapsed": 727.263432093896, "val_loss": 0.030450521601940478, "val_cos": 0.7198551041914631, "val_loss_ema": 0.030128434238299345, "val_cos_ema": 0.7246812450038441} +{"step": 30000, "elapsed": 892.9024051148444, "val_loss": 0.031199457273719377, "val_cos": 0.7188015762620471, "val_loss_ema": 0.029993678373772373, "val_cos_ema": 0.7286393728447167, "ind_cos": 0.503988882598178, "agg_cos": 0.5368778629883164, "ind_nll": 0.40310875495393483, "agg_nll": 0.3877193885428998, "retrieval_seconds": 16.868900523055345} +{"step": 35000, "elapsed": 1084.165204016026, "val_loss": 0.030071805352883414, "val_cos": 0.7286959691376294, "val_loss_ema": 0.02975455228210729, "val_cos_ema": 0.7315889268498443} +{"step": 40000, "elapsed": 1272.171685251873, "val_loss": 0.030754531906687893, "val_cos": 0.7256915466349433, "val_loss_ema": 0.03004943079572679, "val_cos_ema": 0.7318316601069921, "ind_cos": 0.5075402748468784, "agg_cos": 0.5417159915590097, "ind_nll": 0.40964537546965873, "agg_nll": 0.40511606361624375, "retrieval_seconds": 19.416106624063104} +{"step": 45000, "elapsed": 1509.080314695835, "val_loss": 0.029798325584726157, "val_cos": 0.7338287150892352, "val_loss_ema": 0.029937206167980613, "val_cos_ema": 0.7330116123932009} +{"step": 50000, "elapsed": 1652.409701031167, "val_loss": 0.0297921930892609, "val_cos": 0.7341781821190295, "val_loss_ema": 0.029818668411618506, "val_cos_ema": 0.7340048748206611, "ind_cos": 0.5113490143599774, "agg_cos": 0.5509804930773586, "ind_nll": 0.4153070152864275, "agg_nll": 0.40841010860054555, "retrieval_seconds": 13.464250650256872} diff --git a/shared/package-files/2a/2a8b9cd1e8b577593478920a107c8fa8298544a769f25899f4141ec0d1260b73/model_manifest.json b/shared/package-files/2a/2a8b9cd1e8b577593478920a107c8fa8298544a769f25899f4141ec0d1260b73/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..4aa616c7b63f6d53fc1cc5612c299a4cecf15fd6 --- /dev/null +++ b/shared/package-files/2a/2a8b9cd1e8b577593478920a107c8fa8298544a769f25899f4141ec0d1260b73/model_manifest.json @@ -0,0 +1,13 @@ +{ + "schema": "massspecgym-retrieval-model/v1", + "checkpoint": { + "path": "model.pt", + "sha256": "bc29883ac0ede841c2b12e7dc46e410b754f068ed9be3ae6abce49ffe514ac26", + "format": "pytorch" + }, + "model_config": "model_config.json", + "training_provenance": { + "data": "MassSpecGym v1.5 train fold", + "pretrained_assets": [] + } +} diff --git a/shared/package-files/2d/2d0a97550bc24c00d6cb02ea54e76b58fcafe4362deaab47097074442b3d3acc/infer.sh b/shared/package-files/2d/2d0a97550bc24c00d6cb02ea54e76b58fcafe4362deaab47097074442b3d3acc/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..513e599dc9f3c5ac586a38662a0aa68ab67dacf7 --- /dev/null +++ b/shared/package-files/2d/2d0a97550bc24c00d6cb02ea54e76b58fcafe4362deaab47097074442b3d3acc/infer.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +package_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +scratch="$(mktemp -d)" +trap 'rm -rf "$scratch"' EXIT +export PYTHONDONTWRITEBYTECODE=1 DGLBACKEND=pytorch MPLCONFIGDIR="$scratch/mpl" NUMBA_CACHE_DIR="$scratch/numba" +if [ ! -w "${HOME:-/nonexistent}" ]; then export HOME="$scratch"; fi +"${MASSSPECGYM_GLACIER_PYTHON:-/opt/glacier/bin/python}" "$package_root/infer.py" "$@" diff --git a/shared/package-files/2d/2d9945383a41f527445ccf314cea743b230e46fd9f4976f13bed13898d31d013/train-C1.log b/shared/package-files/2d/2d9945383a41f527445ccf314cea743b230e46fd9f4976f13bed13898d31d013/train-C1.log new file mode 100644 index 0000000000000000000000000000000000000000..e70a892e610f904086833ecf5cda4595e55b0c83 --- /dev/null +++ b/shared/package-files/2d/2d9945383a41f527445ccf314cea743b230e46fd9f4976f13bed13898d31d013/train-C1.log @@ -0,0 +1,8 @@ +{"event": "resumed", "source": "/workspace/research/forks/B-step0035000-resume.ckpt", "step": 35000, "epoch": 5, "batch_in_epoch": 5460, "elapsed": 9512.104094705079, "skipped": 0} +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "own-checkpoint:0739bdd163a52753b55f2558914ac1fb8383b00c0436512105f4f0e28d55a5a8", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 37500, "elapsed_seconds": 11359.873801814043, "validation_loss": 0.5803505964577198, "validation_loss_ema": 0.5706611545756459} +{"step": 40000, "elapsed_seconds": 13108.830896281055, "validation_loss": 0.5801039915531874, "validation_loss_ema": 0.5671867122873664} +{"step": 42500, "elapsed_seconds": 14707.310217396123, "validation_loss": 0.5794179178774357, "validation_loss_ema": 0.5685662860050797} +{"step": 45000, "elapsed_seconds": 17942.007455065148, "validation_loss": 0.5805243328213692, "validation_loss_ema": 0.5672206301242113} diff --git a/shared/package-files/31/31075d81a432fb76f8f169050b4ad0688bc8ce4c55d8bd85ed27f51636b523cf/rank_keep.json b/shared/package-files/31/31075d81a432fb76f8f169050b4ad0688bc8ce4c55d8bd85ed27f51636b523cf/rank_keep.json new file mode 100644 index 0000000000000000000000000000000000000000..0c67b1392a8886d2de79a9a448f78beedb3cc281 --- /dev/null +++ b/shared/package-files/31/31075d81a432fb76f8f169050b4ad0688bc8ce4c55d8bd85ed27f51636b523cf/rank_keep.json @@ -0,0 +1,95 @@ +{ + "schema": "allcond-inverse-rank-keep/v1", + "groups": [ + "recorded energy", + "no energy [M+H]+", + "[M+Na]+" + ], + "peaks": 24, + "source": "inv/selfsim/cal2-train.npz against inv/real-train.npz (train fold)", + "pairs": [ + 5985, + 1902, + 1213 + ], + "keep": [ + [ + 0.9126, + 0.8224, + 0.7025, + 0.5909, + 0.5026, + 0.4413, + 0.3945, + 0.3525, + 0.3231, + 0.3074, + 0.2968, + 0.2687, + 0.2535, + 0.2366, + 0.2312, + 0.2374, + 0.2149, + 0.2106, + 0.2044, + 0.2016, + 0.1979, + 0.181, + 0.1643, + 0.1698 + ], + [ + 0.8181, + 0.7576, + 0.7007, + 0.6222, + 0.5522, + 0.5243, + 0.4662, + 0.4384, + 0.4024, + 0.3735, + 0.3422, + 0.3273, + 0.3102, + 0.3037, + 0.2801, + 0.2576, + 0.2803, + 0.2664, + 0.2402, + 0.2052, + 0.2233, + 0.1985, + 0.1782, + 0.1724 + ], + [ + 0.7634, + 0.459, + 0.2961, + 0.2124, + 0.1622, + 0.1251, + 0.1136, + 0.0909, + 0.1014, + 0.0728, + 0.0665, + 0.089, + 0.075, + 0.0569, + 0.0535, + 0.0329, + 0.0397, + 0.0435, + 0.0386, + 0.0267, + 0.0379, + 0.0524, + 0.0339, + 0.026 + ] + ] +} \ No newline at end of file diff --git a/shared/package-files/31/31110f816fe96c276ab8c30743b873bb0433a03beae7a2a12809ac3bc26ce992/README.md b/shared/package-files/31/31110f816fe96c276ab8c30743b873bb0433a03beae7a2a12809ac3bc26ce992/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d801ce5142a2e27260f2cb3ec3c97d3a1103a62f --- /dev/null +++ b/shared/package-files/31/31110f816fe96c276ab8c30743b873bb0433a03beae7a2a12809ac3bc26ce992/README.md @@ -0,0 +1,606 @@ +# MassSpecGym v1.5 retrieval package: five scratch-trained GLACIER simulators (tolerance-matched distance of their mean prediction) + formula-transformer inverse branch (two networks) + train-fold library-neighbour branch + measured intact-ion term + pool aggregation + +Interim release (the research loop continues; see `EXPERIMENTS.md` at the package root). + +## What it does + +`bash infer.sh INPUT_ROOT OUTPUT_ROOT` reads `queries.jsonl` and `candidate_pools.jsonl` and +writes `OUTPUT_ROOT/rankings.jsonl` with one complete ranking per query. Four +components score every candidate and their distances are added. + +1. **Forward branch (spectrum simulation).** Every supported candidate SMILES is simulated + with a GLACIER forward model (ms-pred commit `ed8311f2`, vendored under `vendor/ms_pred`) + under the query's adduct, instrument and rounded collision energy (missing energy -> the + model's "no energy" embedding; missing instrument -> `Unknown`). Simulations are + deduplicated across queries. Each observed spectrum (top-50 peaks, square-root + intensities) is compared with each simulated candidate spectrum (top-100 predicted + fragments) by a Jensen-Shannon distance, with three global, label-free choices selected + on validation (`views` in `model_config.json`): + - **fragment-only view**: observed and predicted peaks at or above `precursor_mz - 0.5` + are left out before normalization; a spectrum with no fragment peak falls back to the + binned full-spectrum distance; + - predicted intensities are raised to the power 0.75 before normalization; + - **tolerance-matched comparison** instead of fixed 0.01 Da bins: + every predicted peak is assigned to the nearest observed peak if it lies within + `max(ppm x m/z, floor)` of it; the divergence is taken over the observed peaks and the + predicted intensity that matches no observed peak counts as its own outcome. The + tolerance depends only on the query's `instrument_type`: max(10 ppm, 1 mDa) for + `Orbitrap`, max(20 ppm, 4 mDa) for every other or missing instrument + (`match_ppm`, `match_floor_mda`, `match_by_instrument`). + Unsupported candidates get distance 1. The package holds **five** simulators (see + Model). For every candidate the five members' matched + predictions (the predicted probability assigned to each observed peak and, with it, the + unmatched remainder) are averaged and compared once with the observed spectrum + (`"ensemble": "prediction"`). +2. **Inverse branch (fingerprint prediction;** `inverse.py`, `invrun.py`**).** For every pool and every *distinct molecular formula among its + candidates* (computed from the candidate SMILES), each spectrum of the pool is annotated + under that formula: the 50 strongest peaks are matched to heavy-atom sub-compositions of + the candidate formula (adduct-shifted, tolerance `max(20 ppm, 0.004 Da)`, RDBE >= 0) and + the 24 strongest explained peaks are kept. A 25.0 M-parameter transformer + (`FormulaFormer`: root-formula token with adduct / instrument / collision-energy context, + peak tokens with sub-formula, neutral loss and intensity, pairwise formula-difference + attention biases) predicts a 4096-bit Morgan fingerprint (radius 2). The predicted bit + probabilities are averaged over all spectra of the pool (`"pooled": true`), and the + inverse distance of a candidate is the cosine distance between that mean probability + vector **under the candidate's own formula**, raised element-wise to the power 0.7, and + the candidate's fingerprint (`"score": {"members": "probability", "power": 0.7}`). The + power lifts bits the network predicts with a low but non-zero probability; it is one + global constant selected on validation. The branch holds **two networks** of one recipe + trained from different random seeds (the second is new in this release); their pooled + probability vectors are averaged before the power is applied. Their training data + include spectra that this project's own forward models simulated for the structures + of the supplied corpus (see Model). The hypothesized formula is always + the formula of the candidate being scored; no label, no true formula and no + precursor-m/z error enters the branch (the precursor m/z is not an input of the network + or of the annotation). Candidates with elements outside the supported list or with more + than 4 M heavy-atom sub-compositions get inverse distance 1. +3. **Library-neighbour branch (**`library.py`**).** A memory-based + component: `model.pt` holds a library of the **train fold** (194,119 spectra as binned + fragment and neutral-loss vectors, and the 4096-bit Morgan fingerprints of their 25,046 + structures). A query spectrum is compared with every library spectrum, + `similarity = 0.5 x (fragment cosine + neutral-loss cosine)` (0.01 Da bins, square-root + intensities, peaks at or above `precursor_mz - 0.5` dropped, query peaks spread to the + two adjacent bins; the neutral-loss view bins `precursor_mz - m/z`); the similarity of a + library molecule is the maximum over its spectra. The 20 most similar library molecules + (plus every molecule tied with the 20th among the 32 most similar, so that the vote does + not depend on the library order) vote for the candidates that resemble them: + `score(c) = sum_j s_j^6 x Tanimoto(c, m_j) / sum_j s_j^6 - prior(c)`; the library + distance is `-score(c)`. `prior(c)` is the mean Tanimoto similarity of the candidate to a + fixed sample of 1,024 library molecules: it removes the part of the score that does not + depend on the query spectrum (how much a candidate resembles train-fold molecules in + general), so the branch carries spectrum-specific evidence only. Train-fold molecules + are not candidates' answers: the benchmark split keeps train, validation and test + molecules apart, the neighbours act as structural analogues (median Tanimoto of the best + neighbour to the validation label 0.16), and with neighbours taken from a *different* + query the branch gives nothing (control below). No query, pool, label or fold other than + train is in the library, and nothing is fitted at inference. +4. **Measured intact-ion term (**`ionterm.py`**; new in this release).** An MS/MS spectrum + often still contains the unfragmented ion (53 % of the train-fold spectra have a peak + within 20 mDa of it). For every candidate the term asks whether the spectrum has a peak + at *that candidate's own* ion mass - the monoisotopic mass of the candidate's formula + (from its SMILES) plus the adduct shift - and how far the nearest observed peak is from + it. The signed distance `e` is scored with an error model fitted on the train fold (see + Model): per acquisition class - (`[M+H]+` with energy, `[M+H]+` without, `[M+Na]+`) x + (`Orbitrap`, `QTOF`, other) - a Gaussian core with a relative width and offset plus a + uniform background over the window `W` = 20 mDa, + `term = -log((1 - b) exp(-z^2 / 2) + b sqrt(2 pi) sigma / (2 W))`, + `z = (e - offset_ppm x m) / sigma`, `sigma = sigma_ppm x m`. A candidate with a peak at + its ion mass gets a term near 0, one without gets the "no peak" value (3.4 - 7.4 on + validation, depending on class and mass). The term depends on the candidate only through + its formula: it separates candidates of *different formulae* and gives isomers the same + value. On validation 40 % of the queries have at least one candidate with such a peak. + Only measured peaks are read: **the reported `precursor_mz` field is not an input of + this term** (see Limits). Queries with an adduct other than `[M+H]+` / `[M+Na]+` or + without peaks get no term; a candidate whose formula the candidate store cannot + represent gets the "no peak" value. +5. **Fusion.** `distance = forward + w x inverse + u x library + v x ion` with fixed rules on + acquisition metadata and pool structure (`inverse`, `library` and `ion` in `model_config.json`): + `w = 0.75` for `[M+H]+` spectra with a recorded collision energy, otherwise + `w = max(0.05, 0.5 / n)`, where `n` is the number of query spectra that name the same + `candidate_pool_id`; `u = 0` for `[M+H]+` spectra with a recorded collision energy, + otherwise `u = 0.4`; `v = 0.05` for `[M+H]+` spectra with a recorded collision energy, + otherwise `v = 0.01`. Global constants selected on validation; nothing is fitted per + query. +6. **Pool aggregation (multi-spectrum evidence).** Queries that name the same + `candidate_pool_id` are spectra of the same unknown, so the final distance of a candidate + is the mean of its fused distances over all scored spectra of that pool + (`pool_aggregation: 1.0`). This uses only the supplied inputs: no labels, no formulae, no + candidate positions. With weight 1 all spectra of a pool receive the same ranking. +7. Candidates are sorted by distance, ties by candidate id. + +## Model + +- **Forward members**: five GLACIER networks (15.1 M parameters each), all descending from + **random initialization**, trained under all acquisition conditions (194,119 train + spectra), batch 32, stock cosine intensity loss; EMA weights. Source checkpoint sha256: + - run B, seed 1 (`research/runs/B-all-b32`), train fold only: step 20,000 + `80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c`, step 30,000 + `0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798`; + - run B2, seed 2 (`research/runs/B2-all-b32-seed2`), train fold only: step 20,000 + `ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c`, step 30,000 + `f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1`; + - **fork S2** (`research/runs/S2-B20k-synth`): run B's own training state at step + 20,000 continued to step 30,000 with an additional auxiliary intensity loss on 32 + spectra per step of the task-supplied `synthetic_augmentation` corpus; step 30,000 + `44742fa31f337e59b543d903018780560569c2e8e50a008ba008859c8440e3a2` (E47). +- **Inverse members**: two `FormulaFormer` networks (dim 512, 6 layers, 8 heads, + 24,997,832 parameters each), **randomly initialized**, binary cross-entropy on Morgan + bits, batch 512, 50,000 steps, EMA weights; same recipe and training data, different + seeds: run I9b, seed 1 (`research/runs/I9b-ff512x6-real08-corpus2+train3`), step 50,000 + (sha256 `f2741a9676a4743fa586d3effe8753d6eade9356fb2ceac8055ff50baf34195f`), and run + I13, seed 2 (`research/runs/I13-ff512x6-real08-corpus2+train3-seed2`; new in this + release, E63), step 50,000 (sha256 + `bd0f9c965cf7e0101877c780d9f3592e6fc07b4b20cdfc35adb9f60e3aa295a7`). Their training + data have three sources: + - the MassSpecGym v1.5 train fold (194,119 spectra annotated under their label formula, + sampled with weight `spectra_of_molecule ** -0.5`): 8 % of every batch; + - the task-supplied `synthetic_augmentation` corpus (2,333,477 ICEBERG-simulated spectra of + 435,076 structures): 46 % of every batch. The task documents describe this corpus as + held-out-clean optional training data available to every method; our check found 0 + structures (2D InChIKey block) shared with validation labels; + - **self-simulated spectra (E60)**: 46 % of every batch. The + structures are those of the same supplied corpus and no others. They were simulated + with this package's own simulation code by two of its forward members - run B step + 30,000 and run B2 step 30,000, both trained on the train fold only; the fork member S2 + is left out because its auxiliary loss saw corpus rows - under (adduct, instrument, + collision energy) conditions copied (a) from two of the structure's own corpus rows + (868,083 spectra) and (b) from three train-fold rows of similar precursor mass + (1,163,218 spectra), which brings in `[M+Na]+` and spectra without a recorded energy, + conditions the corpus does not contain. A simulated spectrum (mean of the two members' + predictions; peaks at or above 2 % of the base peak, at most 24, annotated under the + structure's formula) is a training row like any other. 2,031,301 rows of 434,950 + structures; store manifests `research/inv/selfsim/*.manifest.json`, source + `training/inv/selfsim.py`. This is data generated from supplied structures by networks + that were themselves fitted to the train fold only: no validation or test spectrum, + label, structure or candidate pool was simulated or otherwise read for training. +- **Train-fold library** (`research/library/manifest.json`, asset sha256 + `22d1ddb216eef78d5040209ff6526371e5fcd8aac88e68a36823b6d5e73b3712`): built by + `training/build_library.py` from `train.jsonl` only (source sha256 + `de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc`): 194,119 spectra, + 25,046 molecules, 6.77 M fragment and 6.76 M neutral-loss entries, 1,024 prior-sample rows + (`numpy.random.default_rng(0)`). It is fitted data of the model in the same sense as + network weights - a nearest-neighbour model over the training fold - and is declared + here because it is not a gradient-trained tensor. It contains no validation or test + record. `model_config.json` -> `library_asset` repeats the manifest. +- **Intact-ion error model** (`research/inv/ion_error_table.json`, sha256 + `39aca3a714fd25a20cbaba4d46942764b52d730828a4b8205bf46ac5fc2a6225`; repeated in + `model_config.json` -> `ion_asset` and stored in `model.pt`): fitted by + `training/analysis/ion_fit.py` on the **train fold only**. For each of the 194,119 train + spectra: the signed distance between the ion mass of the spectrum's label formula and the + nearest observed peak, kept if within 20 mDa; per acquisition class a two-component + mixture (Gaussian core with relative width and offset + uniform background) by 200 EM + iterations. 27 fitted numbers: + + | class | train spectra | peak within 20 mDa | offset (ppm) | sigma (ppm) | background share | + |---|---|---|---|---|---| + | `[M+H]+` with energy, Orbitrap | 64,738 | 0.507 | +0.36 | 1.51 | 0.020 | + | `[M+H]+` with energy, QTOF | 34,603 | 0.511 | +0.03 | 4.35 | 0.087 | + | `[M+H]+` with energy, other instrument | 36 | - | (row of QTOF) | | | + | `[M+H]+` without energy, Orbitrap | 51,704 | 0.548 | -0.94 | 2.94 | 0.120 | + | `[M+H]+` without energy, QTOF | 11,931 | 0.626 | +0.67 | 4.58 | 0.080 | + | `[M+H]+` without energy, other instrument | 3,467 | 0.670 | +0.85 | 4.27 | 0.102 | + | `[M+Na]+`, Orbitrap | 24,454 | 0.495 | -0.87 | 2.94 | 0.183 | + | `[M+Na]+`, QTOF | 2,361 | 0.860 | +1.12 | 4.10 | 0.080 | + | `[M+Na]+`, other instrument | 825 | 0.931 | +3.00 | 2.97 | 0.032 | + + Like the library it is fitted data of the model, declared here because it is not a + gradient-trained tensor. No validation or test record entered the fit; validation chose + only the two weights `v`. + **Provenance note:** `model_manifest.json` keeps the contract's literal + `training_provenance.data` value ("MassSpecGym v1.5 train fold") because the contract fixes + the manifest fields; the additional supplied synthetic training corpus (inverse members, + forward member S2) and the self-simulated spectra of its structures (inverse members) are + declared here and in `model_config.json` (`members[].training_data`, + `inverse_members[].training_data`, `inverse_members[].self_simulated_store`), the + train-fold library and the train-fold intact-ion table in `library_asset` and + `ion_asset`. All of these are training *data* or statistics of it - supplied with the + task, or generated from supplied structures by networks of this project that were trained + from random initialization on the train fold - and not pretrained assets: no pretrained + weights, no published GLACIER / MIST / ICEBERG weights and no external model are used at + any point. +- Validation never contributed a gradient or a library entry. Validation labels selected: + the checkpoint steps and the member combinations, the matching tolerance per instrument + class, the ensemble rule, pooled scoring, the three inverse fusion constants (unchanged + since release `1yfse16j`), the inverse score (mean probability, power 0.7; about forty + scoring functions were compared on the full fold, E59), the training recipe of the inverse + members (which simulated rows enter; seven runs and their pairs compared, E60 / E61 / E63), the two weights + of the intact-ion term (twelve weight pairs, after about 230 scored variants of the term's form and weights + showed one plateau, E64), and for the library branch its similarity (fragment + + neutral-loss sum; fragment-only and loss-only were tried), `k = 20`, the power 6, the + prior correction and the two weights (`u = 0 / 0.4`) - more than a hundred fused settings + were scored on the full validation fold (E48), so the reported gain carries selection + noise. +- `model.pt` (627 MB, sha256 + `7d474babce9102814c0f5d4064f9936e8754fecf6f5bc10abc7910c5ce5f1c09`) is a single PyTorch + file holding the forward member list, the inverse member list, the library tensors and + the intact-ion table. The forward members, the library and the first inverse network are + those of the previous release `2neva96r`; the second inverse network and the table are + new. Inference code: `ionterm.py` is new and `infer.py` gained the term (loading, one + log line, one fusion step); `infer.sh`, `fastfeat.py`, `inverse.py`, `invrun.py`, + `library.py` and `vendor/` are byte-identical to `2neva96r`. + +## Validation (selection evidence; not comparable to the test reference) + +Full validation fold, 19,429 queries / 3,386 pools, query-set sha256 +`7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6`. Official scorer +(`/workspace/evaluation/score.py`), report `research/logs/fullfold-5Ms-I9b+I13-L-ion.report.json`. + +| ranking | Hit@1 | Hit@5 | Hit@20 | 95 % CI Hit@1 (molecule-group bootstrap) | +|---|---|---|---|---| +| **released** (five forward members, two inverse networks, library branch, intact-ion term) | **0.7713** | 0.8797 | 0.9377 | 0.7153 - 0.8193 | +| previous release `2neva96r` (one inverse network trained with self-simulated spectra; no intact-ion term) | 0.7591 | 0.8761 | 0.9364 | 0.7022 - 0.8064 | +| release `hun9z36i` (three inverse networks; inverse score = power 0.7 of the mean probability) | 0.7525 | 0.8728 | 0.9292 | 0.6961 - 0.8005 | +| release `z3hoccsj` (five forward members + inverse + library branch) | 0.7481 | 0.8744 | 0.9313 | 0.6932 - 0.7960 | +| release `q4j2rs0g` (four forward members + inverse) | 0.7327 | 0.8565 | 0.9156 | 0.6762 - 0.7808 | +| release `ue3i0ea7` (same four members, mean of member distances) | 0.7316 | 0.8563 | 0.9152 | 0.6760 - 0.7796 | +| release `meqq___h` (forward pair of run B, 0.01 Da bins) | 0.7384 | 0.8418 | 0.9104 | 0.7015 - 0.7736 | +| release `1yfse16j` (same forward pair, inverse I1 50k only) | 0.7265 | 0.8372 | 0.9033 | 0.6895 - 0.7628 | +| release `xjj2vs5c` (forward pair only) | 0.6539 | 0.8177 | 0.8925 | 0.6164 - 0.6942 | + +Paired difference to `2neva96r` by the official scorer (molecule groups resampled): +**+0.0122 [+0.0054, +0.0207]** - the interval excludes zero. Strata of the official +report: `[M+H]+` 0.839, `[M+Na]+` 0.560; recorded collision energy 0.848-0.945, missing +energy 0.607; Orbitrap 0.763, QTOF 0.831, no instrument 0.741; stock GLACIER domain (`[M+H]+` +with energy) 0.931, other 0.611 (`2neva96r`: 0.923 / 0.595). + +### The two changes against `2neva96r` (E63, E64): a second inverse network and the measured intact-ion term + +Forward members, library, inverse score and the inverse / library fusion constants are +those of `2neva96r`. Evidence on the full validation fold, every variant inside the release +rule, paired bootstrap over pools against `2neva96r` (`research/logs/fused-I13-vs-I9b.log`, +`research/logs/ion-term-package-I9b.log`, `research/logs/ion-term-package-I9b+I13.log`; the +last two use the packaged `ionterm.py` itself): + +| measure | `2neva96r` | + second inverse network | + intact-ion term (one network) | **this release** (both) | +|---|---|---|---|---| +| official Hit@1 | 0.7591 | 0.7638, +0.0047 [-0.0025, +0.0121] | 0.7659, +0.0068 [+0.0021, +0.0143] | **0.7713, +0.0122 [+0.0057, +0.0206]** | +| pool-macro Hit@1 (every pool counts once) | 0.8535 | 0.8544, +0.0009 [-0.0024, +0.0038] | 0.8571, +0.0035 [+0.0012, +0.0062] | **0.8591, +0.0056 [+0.0018, +0.0095]** | +| pools gained / lost | - | 15 / 12 | 16 / 4 | 31 / 12 | +| query-weighted Hit@1 without the 20 largest pools | - | +0.0053 [-0.0031, +0.0135] | +0.0077 [+0.0023, +0.0156] | +0.0138 [+0.0062, +0.0229] | +| Hit@1 with pool weight min(n, 30) | - | +0.0060 [-0.0015, +0.0138] | +0.0071 [+0.0023, +0.0137] | +0.0134 [+0.0062, +0.0219] | +| fused Hit@1 per spectrum (no pool mean) | 0.6158 | 0.6172, +0.0013 [-0.0005, +0.0033] | 0.6168, +0.0009 [-0.0002, +0.0021] | 0.6184, +0.0025 [+0.0005, +0.0049] | +| Hit@5 / Hit@20 (official) | 0.8761 / 0.9364 | 0.8788 / 0.9377 | 0.8766 / 0.9361 | 0.8797 / 0.9377 | +| domain / other Hit@1 | 0.9227 / 0.5947 | 0.9274 / 0.5995 | 0.9268 / 0.6044 | 0.9314 / 0.6106 | + +**Second inverse network (E63).** Three further networks were trained from the recipe of +the released one, each with one factor changed: six instead of three train-like +self-simulated conditions per structure (I11), a larger self-simulated share (I12), and +seed 2 with nothing else changed (I13). None beats the released network; the seed twin +differs from it by -0.010 alone and by +0.002 official / -0.003 pool-macro in the fused +ranking with 30 pools gained and 41 lost. So a single retrained network moves the fused +Hit@1 by about +/- 0.003, and the differences between the recent recipes are inside that +spread. Averaging two networks is the only step with a consistent sign (pairs: +0.0035 and ++0.0047 official, 15 - 18 pools gained against 12 lost; a third member adds nothing). Alone +this step is **not** significant on any measure; it enters because it adds to the second +change (0.0047 + 0.0068 separately, 0.0122 together) and costs about a minute per 20,000 +queries. The pair of the two seeds was preferred over the pair with I11 (equal within +noise) because it changes nothing but the seed. + +**Measured intact-ion term (E64).** Candidates of a pool have a median of 55 distinct +formulae; when the unfragmented ion is still in the spectrum, its measured mass says which +of them are possible - evidence neither network branch is built to read at the ppm level +(the forward comparison drops the precursor region, the inverse annotation uses a 20 ppm +tolerance, the library bins are 0.01 Da). The shape of the term is fitted on the train +fold; validation chose two weights. Evidence beyond the table: +- **Form does not matter, weight plateau.** Hand-set kernels, kernels with the train-fold + widths (x 1 to x 3), normalized likelihoods and the released mixture give the same + result at the same weights: with one inverse network official +0.001 to +0.007 and + pool-macro +0.002 to +0.004, with two networks official 0.765 - 0.771 and pool-macro + 0.857 - 0.859. Released mixture, two networks, `v` domain / other: 0.02 / 0.01 -> 0.7706, + pool-macro 0.8585; **0.05 / 0.01 -> 0.7713, 0.8591**; 0.05 / 0.02 -> 0.7714, 0.8594; + 0.1 / 0.01 -> 0.7709, 0.8579; 0.05 / 0.05 -> 0.7679, 0.8582; 0.05 / 0 -> 0.7678, 0.8579. + At a domain weight of 0.5 with the kernel form the term overrides the models (11 pools + lost, pool-macro -0.005 to -0.011). The released pair is an interior point, with the + smaller non-domain weight chosen away from the downturn at 0.05. +- **Where the gain is** (this release against `2neva96r`, points of the official metric): + `[M+H]+` with energy below 400 m/z +0.22, 700 - 850 m/z +0.13 (0.643 -> 0.732); without + energy, `[M+H]+` 400 - 500 m/z +0.18, 500 - 600 +0.10, `[M+Na]+` 400 - 500 +0.15, + 500 - 600 +0.09; positive in 20 of 24 stratum x mass cells, largest loss -0.01. +- **Ceiling.** If every candidate with a formula other than the label's were removed (an + oracle, analysis only), `2neva96r` would reach 0.7854: formula errors are 2.6 of its 24.1 + lost points, and the term recovers about a quarter of them. The remaining errors are + isomers of the correct formula, which this term cannot touch. + +**What is and is not shown.** For the two changes together every pool-level interval +excludes zero, and so does the official scorer's molecule-group interval; this is the +first release since `z3hoccsj` for which that holds. For the term alone the intervals +exclude zero with only 4 pools lost; for the second network alone nothing is significant. +The weights were picked among twelve pairs and the member set among four ensembles, on this fold, +so part of the difference is selection; the neighbouring settings lie within 0.001 - 0.004 +of the released one. Whether test spectra contain the intact ion as often as validation +spectra do cannot be measured here; where it is absent the term is constant and changes +nothing. + +### The change of `2neva96r` against `hun9z36i` (E60, E62; kept in this release): an inverse network trained with spectra simulated by the package's own forward models + +This section describes release `2neva96r`, whose inverse branch was the single network +I9b. Forward members, library, inverse score and fusion constants were those of `hun9z36i`. Its +three inverse networks (trained on the train fold and the supplied ICEBERG corpus) are +replaced by one network of the same architecture and schedule; half of its simulated +training rows are spectra that our forward members simulated for the corpus structures +(see Model). Why it should help: E59 showed the inverse branch limited by its simulated +rows; the supplied rows come from a different simulator and cover only `[M+H]+` with an +energy, while our forward members were fitted to the train fold under all conditions, so +their output looks like the real rows the inverse network meets at inference and can be +produced under the conditions the corpus lacks. Controlled steps (E60; same recipe, seed +and schedule; member alone, Hit@1 per spectrum / after the pool mean, trainer metric): +corpus rows only 0.432 / 0.488; plus the corpus structures self-simulated under two of +their corpus conditions 0.489 / 0.537; plus three train-like conditions per structure +(network I9b) 0.511 / 0.551. A quarter of the corpus rows plus self-simulated +rows for the other three quarters of the structures (0.477 / 0.521) beats the full +corpus. Evidence on the full validation fold with the release rule +(`research/logs/eval-score-I9b.log`, `research/logs/fused-I9b-vs-hun9z36i.log`, +`research/logs/inv-strata-I9b.log`, `research/logs/fused-I9b-bins-vs-hun9z36i.log`; paired +bootstrap over pools): + +| measure | `hun9z36i` | `2neva96r` | +|---|---|---| +| inverse branch alone, Hit@1 after pooling (official weighting / pool-macro) | 0.5272 / 0.6007 | 0.5887 / 0.7011 | +| official Hit@1 of the fused ranking | 0.7525 | **0.7591, +0.0066 [-0.0013, +0.0143]** | +| pool-macro Hit@1 (every pool counts once) | 0.8414 | 0.8535, +0.0121 [+0.0068, +0.0177] | +| pools gained / lost | - | 68 / 27 | +| query-weighted Hit@1 without the 20 largest pools | - | +0.0074 [-0.0016, +0.0169] | +| Hit@1 with pool weight min(n, 30) | - | +0.0076 [-0.0016, +0.0172] | +| fused Hit@1 per spectrum (no pool mean) | 0.6053 | 0.6158, +0.0105 [+0.0065, +0.0147] | +| Hit@5 / Hit@20 (official) | 0.8728 / 0.9292 | 0.8761 / 0.9364 | +| domain / other Hit@1 | 0.9136 / 0.5907 | 0.9227 / 0.5947 | + +**What is and is not shown.** The branch alone improves by 0.06 on the official measure +and 0.10 pool-macro, one network against an ensemble of three. About a tenth of that +arrives in the fused ranking, because the forward branch already ranks most of the pools +the inverse branch gains. The pool-macro and the per-spectrum interval exclude zero; the +official interval and the two query-weighted measures that single pools cannot decide +include it narrowly. Every Hit@k is higher. Where the gain is (inverse branch alone, +`hun9z36i` -> `2neva96r`): precursor m/z below 300: 0.613 -> 0.763, 300-450: 0.690 -> +0.792, 450-700: 0.553 -> 0.652, **700-850: 0.350 -> 0.305, above 850: 0.276 -> 0.257** - +all of it lies below 700 m/z; for the 31 % of validation queries above 700 m/z the new +network is slightly worse alone (only 4 % of the corpus rows are that heavy), and the +fused ranking barely moves there (0.510 -> 0.509; below 700 m/z 0.860 -> 0.870). By condition (alone): `[M+H]+` with energy 0.729 -> +0.824, `[M+H]+` without 0.382 -> 0.418, `[M+Na]+` with 0.349 -> 0.519 (241 queries), +`[M+Na]+` without 0.260 -> 0.271. Selection on this fold: four training recipes were +compared (two smaller self-simulation stores, this one, and one with generated +structures, which was worse, E61); the fusion constants were re-scanned with the new +network and stay where they were. A caveat on independence: the self-simulated rows carry +the forward models' view of fragmentation (out of sample a simulated spectrum shares +22-32 % of the real peaks of its structure, E60), so the two branches may err together +more often than before; the fused gain is positive in both condition classes, but this +was not measured directly. + +### The change of `hun9z36i` against `z3hoccsj` (E59 c; score kept in this release): how the inverse prediction is compared with a candidate + +This section describes release `hun9z36i`, which still had three inverse networks; the +score it introduced is kept. Its networks and library were those of `z3hoccsj`. Only the comparison between the +predicted fingerprint and a candidate fingerprint changed: one cosine distance of the three +networks' mean bit probability raised to the power 0.7, instead of the mean of three plain +cosine distances. Why it should help: the networks are trained with a bit-wise +cross-entropy and spread probability mass over many bits at low values when a spectrum is +uninformative; the plain cosine is dominated by the few confident bits and nearly ignores +that low-probability evidence, a concave transform restores it. Evidence on the full +validation fold (`research/logs/fused-score.log`, `research/logs/fused-score-gamma.log`, +`research/logs/score-scan.log`, `research/logs/score-scan-idf.log`; paired bootstrap over +pools): + +| measure | `z3hoccsj` | `hun9z36i` | +|---|---|---| +| inverse branch alone, Hit@1 after pooling (official weighting / pool-macro) | 0.5139 / 0.5898 | 0.5272 / 0.6007 | +| official Hit@1 of the fused ranking | 0.7481 | **0.7525, +0.0044 [-0.0020, +0.0114]** | +| pool-macro Hit@1 (every pool counts once) | 0.8379 | 0.8414, +0.0035 [+0.0003, +0.0071] | +| pools gained / lost | - | 23 / 11 | +| query-weighted Hit@1 without the 20 largest pools | - | +0.0049 [-0.0018, +0.0127] | +| Hit@1 with pool weight min(n, 30) | - | +0.0046 [-0.0020, +0.0121] | +| fused Hit@1 per spectrum (no pool mean) | 0.6012 | 0.6053, +0.0041 [+0.0025, +0.0058] | +| Hit@5 / Hit@20 (official) | 0.8744 / 0.9313 | 0.8728 / 0.9292 | +| domain / other Hit@1 | 0.9089 / 0.5867 | 0.9136 / 0.5907 | + +The power is on a plateau: fused official difference +0.0019 / +0.0019 / +0.0015 / +0.0039 / +**+0.0044** / +0.0040 / +0.0038 for powers 0.9 / 0.85 / 0.8 / 0.75 / **0.7** / 0.65 / 0.6 +(pool-macro +0.0015 ... +0.0035, pools gained > lost for every one), -0.0013 at 0.5; the +mean probability without a power gives +0.0008. The fusion constants were re-scanned with +the new score and stay where they were. **What is and is not shown:** the gain is small. +The pool-macro and the per-spectrum interval exclude zero, the official one does not, and +Hit@5 / Hit@20 are 0.002 lower. The variant was picked among about forty scoring functions +(powers, logarithms, bit-frequency weights, centred cosines, Tanimoto, likelihoods) of +which the concave ones cluster at +0.001 to +0.005 official, so part of +0.0044 is +selection. It was released because every Hit@1 measure agrees in sign, the branch alone +improved clearly, and the change costs nothing at inference. + +### The two changes of `z3hoccsj` against `q4j2rs0g` (E47, E48; unchanged in this release) + +The official Hit@1 is query-weighted and all spectra of a pool receive one ranking, so a +few very large pools can decide it (one validation pool is 2.8 % of the fold). Every change +is therefore also read on measures that single pools cannot decide. Paired bootstrap over +pools against `q4j2rs0g` (`research/logs/knn-evaluate-inclusive.log`, +`research/logs/knn-evaluate-inclusive-5Ms.log`, `research/logs/big-pools-S2-compositions.log`): + +| measure | `q4j2rs0g` | + fifth member (S2 30k) | + library branch (four members) | `z3hoccsj` (both) | +|---|---|---|---|---| +| official Hit@1 | 0.7327 | 0.7371, +0.0044 [+0.0003, +0.0089] | 0.7465, +0.0137 [+0.0027, +0.0256] | **0.7481, +0.0154 [+0.0032, +0.0282]** | +| pool-macro Hit@1 (every pool counts once) | 0.8317 | 0.8349, +0.0032 [+0.0000, +0.0065] | 0.8361, +0.0044 [+0.0018, +0.0071] | **0.8379, +0.0062 [+0.0021, +0.0103]** | +| pools gained / lost | - | 23 / 12 | 19 / 4 | 37 / 16 | +| query-weighted Hit@1 without the 20 largest pools | 0.7681 | +0.0050 [+0.0002, +0.0102] | +0.0115 [+0.0010, +0.0225] | +0.0133 [+0.0014, +0.0250] | +| Hit@1 with pool weight min(n, 30) | - | +0.0051 [+0.0002, +0.0104] | +0.0115 [+0.0020, +0.0206] | +0.0133 [+0.0024, +0.0243] | +| fused Hit@1 per spectrum (no pool mean) | 0.5908 | 0.5939, +0.0031 [+0.0007, +0.0053] | 0.5990, +0.0082 [+0.0035, +0.0132] | 0.6012, +0.0104 [+0.0056, +0.0156] | +| Hit@5 / Hit@20 (official) | 0.8565 / 0.9156 | 0.8575 / 0.9158 | 0.8711 / 0.9260 | 0.8744 / 0.9313 | +| domain / other Hit@1 | 0.9072 / 0.5575 | 0.9072 / 0.5664 | - | 0.9089 / 0.5867 | + +**Fifth forward member (E47).** The simulator's weakness on unseen molecules is its +intensity model; the auxiliary loss on the synthetic corpus shows that model seventeen +times more structures. The fork member is the best single simulator so far (per spectrum +0.4910 against 0.4862 for its twin without the term, +0.0048 [-0.0044, +0.0142]; the gain +sits in `[M+H]+` with energy, where the corpus has data), and adding it is a small step +whose pool-level intervals all sit at or above zero. It costs 25 % more simulation time. + +**Library-neighbour branch (E48).** Alone it is a weak ranker (Hit@1 0.168 per spectrum, +0.254 after the pool mean), but it is independent of both models +and helps exactly where they are weakest: spectra without a recorded collision energy and +`[M+Na]+` spectra (other-conditions Hit@1 0.558 -> 0.587). For `[M+H]+` spectra with an +energy the forward model is strong and any library weight was neutral or negative, so its +weight there is 0. Evidence that the gain is spectrum-specific and not a "resembles the +train fold" prior (which the split construction could reward, and which this project +excludes on principle, E21): +- with the neighbours of a *randomly chosen other query* the branch alone scores 0.010 per + spectrum (0.020 after the pool mean), and fused at `u` = 0.25 / 0.5 it changes the + per-spectrum Hit@1 by -0.0013 / -0.0051, pool-macro by +0.0006 [-0.0006, +0.0018] / + +0.0000 [-0.0021, +0.0021] with 3 / 7 pools gained and 1 / 7 lost, and the official Hit@1 + by +0.0017 [-0.0001, +0.0044] / +0.0027 [-0.0071, +0.0130] + (`research/logs/knn-evaluate-shuffled-debias.log`); the real neighbours give +0.0081 per + spectrum and 12 pools gained / 4 lost at 0.25; +- the prior term removes the spectrum-free "resembles the library" component of the vote. + It also makes the branch better (alone, k = 10, power 3: 0.153 -> 0.171 per spectrum, + 0.204 -> 0.253 after the pool mean) and the control tighter (without it: official +0.0037 + [-0.0031, +0.0115] at 0.25 and -0.0116 [-0.0338, +0.0041] at 0.5). + +Weight plateau (four released members + library, `u` for other conditions): 0.25 -> 0.7416, +0.35 -> 0.7442, **0.4 -> 0.7465**, 0.45 -> 0.7466, 0.5 -> 0.7483, 0.6 -> 0.7435, 0.65 -> +0.7345, 0.8 -> 0.7302; pool-macro +0.0024 / +0.0038 / +0.0044 / +0.0038 / +0.0044 / +0.0032 +for 0.25 ... 0.6. With five members the official value falls from 0.7486 at 0.45 to 0.7445 +at 0.5 because two more pools (about 80 spectra net) become misses, while pool-macro stays +flat (0.8385 / 0.8382). 0.4 was chosen as an interior point of the plateau, not as its +maximum. + +**What is and is not shown.** Pool-macro, the trimmed and the capped measure and the +per-spectrum score all move in the same direction with intervals above zero, for each +change and for both together; the official difference (+0.0154) rests partly on large +pools and its interval nearly reaches zero. The library settings were chosen among more +than a hundred on this fold; the neighbouring settings (k 10-32, power 3-10, weight +0.25-0.5) give +0.007 to +0.016 on the official measure and +0.002 to +0.005 pool-macro, +so we expect a real but smaller gain on unseen data. Test molecules may have fewer close analogues in the +train fold than validation molecules do, or more; this was not and cannot be measured +here. + +How the numbers of this release were produced: the packaged `infer.py` of this exact build +ran the complete inverse branch (both networks), the library branch (neighbour search over +the packaged library included), the intact-ion term, the matched scoring of all five +members and the fusion on the full fold, taking the forward simulations of the five +members from their saved full-fold prediction files (`--load-predictions`; 245 s; +`research/logs/fullfold-5Ms-I9b+I13-L-ion-saved-simulations.log`), and the official scorer +produced the released row and the paired difference against the rankings of the same run +of the previous build. Agreement with the analysis code on the full fold +(`research/logs/check-package-5Ms-I9b+I13-L-ion.log`): inverse distances of the +two-network ensemble - largest difference 0 on supported candidates, same best candidate +for 19,429 / 19,429 queries; intact-ion terms - largest absolute difference 2.5e-10, +19,429 / 19,429 queries covered; rank of the label in the package's rankings equal to the +analysis value for 19,429 / 19,429 queries (hence 0.7713 / 0.8797 / 0.9377 on both sides). +The library branch is unchanged since `z3hoccsj`, where it was checked against the analysis +code (`research/logs/check-library-equivalence.log`). +End-to-end replays of this build (forward simulation included) from a read-only copy +outside the workspace with an `env -i` environment and a free GPU, each with exit status 0, +0 unscored queries, unchanged file hashes of the copy (276 files) and no process left +behind (comparison with the full-fold run: `research/logs/replay-5Ms-I9b+I13-L-ion-compare.log`): +- `val-tiny` (180 queries, 40 complete pools; + `research/logs/replay-5Ms-I9b+I13-L-ion-val-tiny.log`): 180 / 180 rankings, 80 s wall, + 2.49 GiB peak resident memory; top candidate and top five identical to the full-fold run + for all 180 queries, complete ranking identical for 96 (the rest first differ at rank 29 + or later, median rank 81; the simulations are batch-order dependent in the last float + digits). +- edge-case input (24 hand-built queries: single candidate, 256 candidates, duplicate, + unparsable, charged and unsupported candidates, missing metadata, adducts outside the + supported two, empty and one-peak spectra, added to 180 validation queries; + `research/logs/replay-5Ms-I9b+I13-L-ion-edge.log`): 204 / 204 complete rankings, 87 s + wall, 2.58 GiB peak resident memory; the intact-ion term scored 199 queries and skipped + the 5 it does not cover (three unsupported adducts, two empty spectra). Of the 180 + validation queries 177 keep their full-fold top candidate; the other three are the + spectra of one pool that received a hand-built `[M+Na]+` spectrum (the full-fold top + candidate is second there), and the top five differ for 23 queries, all in 4 of the 5 + validation pools that received hand-built queries - a pool's mean changes when spectra + are added to it. +- `val-sub` (2,147 queries, 413 complete pools, 295,422 simulations x 5 members; + `research/logs/replay-5Ms-I9b+I13-L-ion-val-sub.log`): 2,147 / 2,147 rankings, 642 s + wall (640 s inside `infer.py`), 3.40 GiB peak resident memory; top candidate and top + five identical to the full-fold run for 2,147 / 2,147 queries, complete ranking for + 1,896 (first difference at rank 8 or later); official scorer on the subset: Hit@1 0.7718 + (0.6730 - 0.8661), Hit@5 0.8407, Hit@20 0.8840 + (`research/logs/replay-5Ms-I9b+I13-L-ion-val-sub.report.json`; previous release on the + same subset: 0.7708 / 0.8421 / 0.8840, paired difference +0.0009 [-0.0014, +0.0046] - + the subset holds too few of the changed pools to show the full-fold difference). + +**Not run:** an end-to-end replay on the full fold with all simulations recomputed (about +1.3 h of the single GPU; the simulation code and the forward weights are those of the +previous releases, whose four-member path was replayed in E45). + +## Limits + +- Non-domain conditions (`[M+Na]+`, missing collision energy; half of the validation queries) + remain much weaker than the stock GLACIER domain (0.611 vs 0.931). The largest single + class of misses is still Orbitrap pools of many `[M+H]+` / `[M+Na]+` spectra without a + recorded energy and with few peaks per spectrum (E33). On unseen molecules the simulator's + intensity model is the weak part (E42 d). +- The validation estimate depends on a few very large pools (47 % of validation queries sit + in pools with >= 16 spectra and are hit or missed as a whole; one pool is 2.8 % of the + fold); the molecule-group interval is wide (0.715 - 0.819), and member sets, the ensemble + rule, the fusion constants, the inverse score, the inverse training recipe, the + intact-ion weights and the library settings were chosen inside that noise. +- The library branch depends on the train fold containing structural analogues of the + query molecule with similar spectra. Where it has none, its vote is diffuse and, after + the prior correction, close to uninformative; it cannot identify a molecule by itself. Its + weight is a constant; a confidence-dependent weight was not explored. +- The inverse networks are trained mostly on simulated spectra, half of them simulated by + this package's own forward members. They therefore inherit what those simulators get + wrong, and the two branches are less independent than their architectures suggest. Their + gain over the earlier networks lies entirely below 700 m/z; heavy molecules (31 % of + the validation queries, 4 % of the corpus rows) did not improve, and adding generated + heavy structures to the training data made it worse (E61). The two networks differ only + in their seed, and one retrained network moves the fused Hit@1 by about +/- 0.003 + (E63). Three of the five forward members share run B's first 20,000 steps. +- The intact-ion term can only tell formulae apart. It is silent when the spectrum does + not contain the unfragmented ion (60 % of the validation queries have no candidate + with a peak at its ion mass) and it never separates isomers, which are the bulk of the + remaining errors: with perfect formula knowledge the previous release would gain 2.6 + points, the term gains about 0.7 (E64). A fragment or noise peak that happens to lie at + a wrong candidate's ion mass counts for that candidate; the small weights bound the + damage. Its error model has one row per coarse acquisition class; instruments or + calibrations unlike the train fold's would be scored with the wrong width. +- Candidates that RDKit cannot parse, contain unsupported elements or have more than 100 + heavy atoms get forward distance 1; elements outside + `C N P O S Si I H Cl F Br B Se Fe Co As Na K` get inverse distance 1. A candidate without + a fingerprint has library distance 0 (no vote, no prior); queries with an adduct other + than `[M+H]+` / `[M+Na]+` get no inverse, no library and no intact-ion term. +- The reported `precursor_mz` field is used by the forward scoring view and by the library vectors to + separate fragment peaks from the precursor region, and by the library's neutral-loss view + (`precursor_mz - m/z` of the *query's own* peaks, compared with library spectra; it is + never compared with a candidate's mass). A mass-error term on that field was evaluated + (E21) and deliberately **not** enabled: for a large part of the benchmark the field is + not a measurement but a value computed from the reference formula (in the train fold it + equals the label's theoretical ion mass within 0.05 mDa for 96 % of the Orbitrap + `[M+H]+` spectra with an energy). The inverse branch and the intact-ion term do not + read the field. The intact-ion term compares candidate masses with *peaks of the + spectrum*, whose errors in the same class are Gaussian with a width of 0.7 - 1.5 ppm, + as measured values are; one small class (365 train spectra, `[M+Na]+` Orbitrap with + four-decimal peak lists) looks recalibrated (0.1 ppm) and is not treated differently. +- The same fixed weights and library handle every query; acquisition metadata (adduct, + presence of a collision energy) and the number of spectra per pool select the fusion + weights; candidate order, labels and popularity are never read. + +## Runtime + +`/opt/glacier/bin/python` (override with `MASSSPECGYM_GLACIER_PYTHON`), one GPU, <= 14 CPU +workers, no network, no writes inside the package. Forward branch: every candidate is +featurized once and simulated by all five members; the simulation is GPU-bound and linear +in the number of members (about 2,850 simulations / s per member on an H100, E45). +Everything else on the full validation fold with the five members' simulations loaded from +disk, 13 workers, free GPU and cores: 245 s for this build (canonicalization and planning +74 s, candidate store with fingerprints 58 s, intact-ion term 0.5 s, library branch 85 s +of which the neighbour search on the CPU 80 s, inverse branch with two networks 22 s, +scoring 21 s). End to end with 13 workers on a free GPU: `val-tiny` (180 queries, 29,258 +simulations x 5 members) 80 s; `val-sub` (2,147 queries, 295,422 simulations x 5 +members) 642 s, the simulation at about 610 candidates / s for the five members. +**Expected total for a fold of +the size of validation or test on a free H100: about 4,200 - 4,500 s of simulation (2.54 M +candidates x 5 members) plus about 300 s; about 8,500 s if every pool had 256 candidates; +inside the 18,000 s limit; not measured end to end on a full fold.** Host memory, measured +on the full validation fold: 10.8 GiB peak resident in the largest process (the neighbour +search holds a dense 400 x 194,119 similarity block per chunk); the annotation workers are +forks of about 1.7 GiB each (mostly shared pages). + +## Files + +`infer.sh`, `infer.py`, `fastfeat.py` (compact featurization, tensor-equal to the stock one), +`inverse.py` (formula annotation, `FormulaFormer`), `invrun.py` (inference-side candidate +store, pooled scoring and the ensemble score), `library.py` (library-neighbour branch), +`ionterm.py` (measured intact-ion term), `model.pt`, +`model_config.json`, `model_manifest.json`, `vendor/ms_pred` (+ `LICENSE.ms-pred`), +`training/` (training, preparation, publication and analysis source used for this release; +`training/inv/` holds the inverse-branch preparation and training code, +`training/build_library.py` builds the library, `training/analysis/ion_fit.py` fits the +intact-ion table). Experiment records: `EXPERIMENTS.md` and +`research/` at the package root. diff --git a/shared/package-files/31/3128ecdea40a5a401d07dea1549ecb877e3f35f0af07563c934e73327c3ba10f/eval_inv.py b/shared/package-files/31/3128ecdea40a5a401d07dea1549ecb877e3f35f0af07563c934e73327c3ba10f/eval_inv.py new file mode 100644 index 0000000000000000000000000000000000000000..e624d72c5e886cd371ebf1ba073b25935593b38b --- /dev/null +++ b/shared/package-files/31/3128ecdea40a5a401d07dea1549ecb877e3f35f0af07563c934e73327c3ba10f/eval_inv.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 +"""Inverse-branch distances of a query set (inference-style store of ``prepare_inv.py pools``). + +eval_inv.py CHECKPOINT POOLS.npz OUT.pkl [--blank] [--max-peaks K] + +Writes {'cos': [...], 'nll': [...]} - one candidate-ordered distance vector per query - for +fusion studies (``analysis/fuse.py``). ``--blank`` hides every peak (formula-only control). +""" +import argparse +import pickle +import sys +import time +from pathlib import Path + +import torch + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +sys.path.insert(0, str(HERE)) +import numpy as np +import inverse +import invrun + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('checkpoint', type=Path) + p.add_argument('pools', type=Path) + p.add_argument('out', type=Path) + p.add_argument('--blank', action='store_true') + p.add_argument('--max-peaks', type=int, default=0) + p.add_argument('--batch', type=int, default=4096) + p.add_argument('--cand-fps', type=Path, help='E56: candidate fingerprints of an alternative target (altfp.py), aligned with the store') + args = p.parse_args() + device = torch.device('cuda') + model = invrun.load_model(args.checkpoint, device) + tick = time.monotonic() + out = {} + if isinstance(model, inverse.SetFormer): + store = invrun.SetPools(args.pools, device) + merged = store.run(model, [(s, None) for s in range(len(store.members))]) + singles = store.run(model, [(s, np.array([n])) for s in range(len(store.members)) for n in range(len(store.members[s]))]) + out['set'], out['cos'] = [None] * store.queries, [None] * store.queries + low = 0 + for s, vector in enumerate(merged): + for qi in store.members[s]: + out['set'][qi] = vector + out['cos'][qi] = singles[low] + low += 1 + else: + store = invrun.PoolStore(args.pools, device) + if args.cand_fps: + fps = torch.from_numpy(np.load(args.cand_fps)).to(device) + assert fps.shape[0] == store.cand_fps.shape[0] + store.cand_fps = fps + out['cos'], out['nll'] = store.distances(model, max_peaks=args.max_peaks or None, blank=args.blank, batch=args.batch) + out['pooled'], _ = store.distances(model, max_peaks=args.max_peaks or None, blank=args.blank, pooled=True, batch=args.batch) + print(f'{store.queries} queries, {store.pair_start[-1]} pairs, {time.monotonic() - tick:.1f} s') + with args.out.open('wb') as stream: + pickle.dump(out, stream) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/31/3155130e95b7f0ed472a773844e24729473814982b793ed693d488bd2a2dbc38/validation.jsonl b/shared/package-files/31/3155130e95b7f0ed472a773844e24729473814982b793ed693d488bd2a2dbc38/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..f5fb840c8d8a8e2d0d2e8e31a541da9d7f06bdcd --- /dev/null +++ b/shared/package-files/31/3155130e95b7f0ed472a773844e24729473814982b793ed693d488bd2a2dbc38/validation.jsonl @@ -0,0 +1,10 @@ +{"step": 5000, "elapsed": 133.64315328502562, "val_loss": 0.036205494174979855, "val_cos": 0.6460887475612326, "val_loss_ema": 0.03399699827285807, "val_cos_ema": 0.6651474549561867} +{"step": 10000, "elapsed": 249.1235861290479, "val_loss": 0.03151948424140058, "val_cos": 0.6954758928944812, "val_loss_ema": 0.029935348395294045, "val_cos_ema": 0.7103893553531447, "ind_cos": 0.46482062895671417, "agg_cos": 0.5079520304699161, "ind_nll": 0.3264192701631582, "agg_nll": 0.3053167944824747, "retrieval_seconds": 11.574011491960846} +{"step": 15000, "elapsed": 417.5194956959458, "val_loss": 0.02927922988994484, "val_cos": 0.7212478517534999, "val_loss_ema": 0.02847903799094017, "val_cos_ema": 0.729312999414535} +{"step": 20000, "elapsed": 574.464228873956, "val_loss": 0.029228342782635655, "val_cos": 0.726608151494705, "val_loss_ema": 0.027952518273666297, "val_cos_ema": 0.7387111757472721, "ind_cos": 0.5164959596479489, "agg_cos": 0.5584435637449174, "ind_nll": 0.41057182562149364, "agg_nll": 0.3914251891502393, "retrieval_seconds": 11.491130881942809} +{"step": 25000, "elapsed": 759.3793747440213, "val_loss": 0.02888980837794522, "val_cos": 0.7347285760412914, "val_loss_ema": 0.028027093847962856, "val_cos_ema": 0.7423353364534009} +{"step": 30000, "elapsed": 927.1543955350062, "val_loss": 0.02922437788497844, "val_cos": 0.7359125996416439, "val_loss_ema": 0.02805266757529016, "val_cos_ema": 0.7456933915434081, "ind_cos": 0.5269442585825312, "agg_cos": 0.5630243450512121, "ind_nll": 0.43620361315559214, "agg_nll": 0.4369756549487879, "retrieval_seconds": 14.846692395047285} +{"step": 35000, "elapsed": 1108.2125012530014, "val_loss": 0.02854514422655486, "val_cos": 0.7440987558063976, "val_loss_ema": 0.028093127044955753, "val_cos_ema": 0.7476223399742331} +{"step": 40000, "elapsed": 1266.0046689569717, "val_loss": 0.027803080468116685, "val_cos": 0.7507588979827191, "val_loss_ema": 0.027863918891304757, "val_cos_ema": 0.750498220785456, "ind_cos": 0.5338411652684132, "agg_cos": 0.5799063255957589, "ind_nll": 0.4459828092027382, "agg_nll": 0.4363580215142313, "retrieval_seconds": 12.535959998029284} +{"step": 45000, "elapsed": 1434.3376057159621, "val_loss": 0.02770436013178693, "val_cos": 0.7518840760147524, "val_loss_ema": 0.027620042540457804, "val_cos_ema": 0.7525687479090535} +{"step": 50000, "elapsed": 196.33350355003495, "val_loss": 0.02773355280501984, "val_cos": 0.7525975486868856, "val_loss_ema": 0.027715912407133825, "val_cos_ema": 0.7525127799053606, "ind_cos": 0.5360028822893612, "agg_cos": 0.5746049719491482, "ind_nll": 0.44989448762159656, "agg_nll": 0.44026969993308973, "retrieval_seconds": 12.932473139022477} diff --git a/shared/package-files/31/3181e41c103ba761cbe18a47fa6fd49f47552783e00143bd2ca757cdd634a991/model_config.json b/shared/package-files/31/3181e41c103ba761cbe18a47fa6fd49f47552783e00143bd2ca757cdd634a991/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..fe4b6c0f5ce01495fb7b48323ebf497fcf201cf3 --- /dev/null +++ b/shared/package-files/31/3181e41c103ba761cbe18a47fa6fd49f47552783e00143bd2ca757cdd634a991/model_config.json @@ -0,0 +1,286 @@ +{ + "sparse_k": 100, + "inference_batch_size": 128, + "workers": 14, + "num_bins": 150000, + "upper_limit": 1500, + "max_observed_peaks": 50, + "observed_intensity_threshold": 0.001, + "ensemble": "prediction", + "pool_aggregation": 1.0, + "autocast": false, + "model": { + "pe_embed_k": 14, + "embed_elem_group": true, + "multi_hop_max_dist": 10 + }, + "checkpoint": "model.pt", + "views": [ + { + "precursor_window": 0.5, + "pred_power": 0.75, + "match_ppm": 20, + "match_floor_mda": 4, + "match_by_instrument": { + "Orbitrap": [ + 10, + 1 + ] + } + } + ], + "inverse": { + "pooled": true, + "score": { + "members": "probability", + "power": 0.7 + }, + "weight_domain": 0.75, + "weight_other": 0.05, + "weight_other_single": 0.5, + "batch": 2048 + }, + "library": { + "kind": "sum", + "k": 20, + "top": 32, + "power": 6, + "debias": true, + "weight_domain": 0.0, + "weight_other": 0.4, + "weight_other_single": 0.0 + }, + "inverse_members": [ + { + "source": "runs/I1-ff512x6/step-0050000-ema.pt", + "sha256": "c131cac451c9d360d13a7576304a4f3ce59c4e542d10ec5e8e4b943838ba385b", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I1-ff512x6", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.2, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I3-ff512x6-real08/step-0030000-ema.pt", + "sha256": "27125fd05eb958236b7f815eb97d8ae9b148aedd5c552067361a7bc116dffbae", + "step": 30000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I3-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I3-ff512x6-real08/step-0100000-ema.pt", + "sha256": "d3a914a9bf011751408a2739cb18b0312df430fd31447b9115b0010861ab08e3", + "step": 100000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I3-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + } + ], + "library_asset": { + "schema": "train-library/v1", + "fold": "train", + "spectra": 194119, + "molecules": 25046, + "bin": 0.01, + "prior_sample": 1024, + "prior_seed": 0, + "fragment_entries": 6765621, + "loss_entries": 6763777, + "source": "/workspace/data/train.jsonl", + "source_sha256": "de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc", + "structure_store": "/run-state/workspace/research/inv/real-train.npz", + "structure_store_sha256": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "sha256": "22d1ddb216eef78d5040209ff6526371e5fcd8aac88e68a36823b6d5e73b3712", + "elapsed_seconds": 13.499361125999712, + "training_data": "MassSpecGym v1.5 train fold" + }, + "method": "native-glacier-all-conditions-forward-simulation+formula-transformer-inverse-fusion+train-library-neighbour-fusion", + "inference_runtime": "/opt/glacier/bin/python", + "members": [ + { + "source": "runs/B-all-b32/checkpoints/step-0020000-ema.ckpt", + "sha256": "80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 5136.2172065590275, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B-all-b32/checkpoints/step-0030000-ema.ckpt", + "sha256": "0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8314.79353913304, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0020000-ema.ckpt", + "sha256": "ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 6945.18486677701, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0030000-ema.ckpt", + "sha256": "f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 9298.063542745003, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/S2-B20k-synth/checkpoints/step-0030000-ema.ckpt", + "sha256": "44742fa31f337e59b543d903018780560569c2e8e50a008ba008859c8440e3a2", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8906.84206694903, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "own-checkpoint:6c5a43fada335e5f4e9f8265ec6cfd54a8f317eb8d2100d96ea3731809005be2", + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus (auxiliary intensity term)", + "synthetic": { + "manifest_sha256": "431454e702f8da3194684fc9a565135d29a38a407aaa31e9399d871360c6e962", + "per_item": 1, + "weight": 1.0, + "schedule": "e2e", + "instrument": "flag" + } + } + ] +} diff --git a/shared/package-files/31/31b5ab74bde59afd56aa40c7b594768f4413ba0926ea14b7644e32b81ef54e2c/v5.json b/shared/package-files/31/31b5ab74bde59afd56aa40c7b594768f4413ba0926ea14b7644e32b81ef54e2c/v5.json new file mode 100644 index 0000000000000000000000000000000000000000..fb4580b7fd9b21ce1b0fa626f3276ab6379b24c0 --- /dev/null +++ b/shared/package-files/31/31b5ab74bde59afd56aa40c7b594768f4413ba0926ea14b7644e32b81ef54e2c/v5.json @@ -0,0 +1,7 @@ +{ + "base": {}, + "noprec": {"drop_precursor": true}, + "noprec_pp0.75": {"drop_precursor": true, "pred_power": 0.75}, + "noprec_pp0.5": {"drop_precursor": true, "pred_power": 0.5}, + "noprec_pp1.5": {"drop_precursor": true, "pred_power": 1.5} +} diff --git a/shared/package-files/31/31bfbaa5112ad83be51aa3c3d93b3fcb1f1572b1f960674643afb4efba082283/fullfold-5Ms-N5-L-ion-net-saved-simulations.log b/shared/package-files/31/31bfbaa5112ad83be51aa3c3d93b3fcb1f1572b1f960674643afb4efba082283/fullfold-5Ms-N5-L-ion-net-saved-simulations.log new file mode 100644 index 0000000000000000000000000000000000000000..225fdf29b3f45fc91b0386c4116a3c40c26114a7 --- /dev/null +++ b/shared/package-files/31/31bfbaa5112ad83be51aa3c3d93b3fcb1f1572b1f960674643afb4efba082283/fullfold-5Ms-N5-L-ion-net-saved-simulations.log @@ -0,0 +1,11 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 5, "inverse_members": 5, "library": true, "ion": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 42.614358120947145} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 45.98873751796782} +{"event": "candidate_store", "pools": 3386, "pairs": 1066979, "seconds": 64.44688659906387} +{"event": "intact_ion", "scored": 19429, "seconds": 0.621663004043512} +{"event": "library", "scored": 19429, "search_seconds": 87.48240289394744, "seconds": 93.02219946496189} +{"event": "inverse_annotated", "pools": 3386, "pairs": 1066979, "formulae": 161754, "unsupported_candidates": 7534, "seconds": 0.0014276470756158233} +{"event": "inverse", "scored": 19429, "seconds": 61.46001957496628} +{"event": "consensus", "scored": 19428, "pools": 3386, "answers": 33860, "search_seconds": 9.31531518092379, "seconds": 18.01956544490531} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 41.62531950895209, "total_seconds": 400.593115924974} +{"event": "measured", "exit_code": 0, "wall_seconds": 402.7, "user_seconds": 1565.1, "system_seconds": 118.9, "max_rss_gib": 11.44} diff --git a/shared/package-files/31/31d7fe179ec04963d30222b295ef72585cf210116becdca21bdad7beb07302b3/fullfold-5Ms-N5-L-ion-net2-saved-simulations.log b/shared/package-files/31/31d7fe179ec04963d30222b295ef72585cf210116becdca21bdad7beb07302b3/fullfold-5Ms-N5-L-ion-net2-saved-simulations.log new file mode 100644 index 0000000000000000000000000000000000000000..bd7ab88c11effbae3a8ac5af5f6e1bb3c51b6d3b --- /dev/null +++ b/shared/package-files/31/31d7fe179ec04963d30222b295ef72585cf210116becdca21bdad7beb07302b3/fullfold-5Ms-N5-L-ion-net2-saved-simulations.log @@ -0,0 +1,11 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 5, "inverse_members": 5, "library": true, "ion": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 43.85963207599707} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 47.199365547974594} +{"event": "candidate_store", "pools": 3386, "pairs": 1066979, "seconds": 64.41283227293752} +{"event": "intact_ion", "scored": 19429, "seconds": 0.7614137870259583} +{"event": "library", "scored": 19429, "search_seconds": 111.0757649509469, "seconds": 115.67761580995284} +{"event": "inverse_annotated", "pools": 3386, "pairs": 1066979, "formulae": 161754, "unsupported_candidates": 7534, "seconds": 0.0013573190663009882} +{"event": "inverse", "scored": 19429, "seconds": 52.554905580938794} +{"event": "consensus", "scored": 19428, "pools": 3386, "answers": 33860, "search_seconds": 10.535743399057537, "seconds": 20.055558632942848} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 43.34987891104538, "total_seconds": 396.1821900010109} +{"event": "measured", "exit_code": 0, "wall_seconds": 398.3, "user_seconds": 1586.2, "system_seconds": 117.7, "max_rss_gib": 11.46} diff --git a/shared/package-files/31/31de3c3e8c3fe49d4728e46f75dc33712c62a1f7535991847eea6f476b78e7e7/scorelab-v7-B3-20k-full.log b/shared/package-files/31/31de3c3e8c3fe49d4728e46f75dc33712c62a1f7535991847eea6f476b78e7e7/scorelab-v7-B3-20k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..1fd43748345f448caf6e8b63b83ece99f3b5c362 --- /dev/null +++ b/shared/package-files/31/31de3c3e8c3fe49d4728e46f75dc33712c62a1f7535991847eea6f476b78e7e7/scorelab-v7-B3-20k-full.log @@ -0,0 +1,4 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 72.67455761799647} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 76.1311916239938} +ind noprec_pp0.75 all=0.4515 dom=0.6788 non=0.2234 h5=0.6152 h20=0.6969 | diff=+0.0000 [+0.0000,+0.0000] +agg noprec_pp0.75 all=0.5822 dom=0.7670 non=0.3966 h5=0.7975 h20=0.8853 | diff=+0.0000 [+0.0000,+0.0000] diff --git a/shared/package-files/31/31e783a178f229e3dc8fa1ca0bbed67394fc48ba33a5467a72d074682a72344f/train-queue.held.txt b/shared/package-files/31/31e783a178f229e3dc8fa1ca0bbed67394fc48ba33a5467a72d074682a72344f/train-queue.held.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0b871fe42cf22450ac66f702593f52e12c172cc --- /dev/null +++ b/shared/package-files/31/31e783a178f229e3dc8fa1ca0bbed67394fc48ba33a5467a72d074682a72344f/train-queue.held.txt @@ -0,0 +1 @@ +I27-ff512x6-real08-corpus2+train3-noise075 --steps 50000 --seed 1 --noise-rate 0.75 --noise-max 12 --noise-shape 3 diff --git a/shared/package-files/31/31e8031061bd5e0072fbcaa5181a8d77def59f7e67b706a0dd7fe76372e2cfca/summary.txt b/shared/package-files/31/31e8031061bd5e0072fbcaa5181a8d77def59f7e67b706a0dd7fe76372e2cfca/summary.txt new file mode 100644 index 0000000000000000000000000000000000000000..ed7b265c90e4c445642ed42f92c629b69e3482e2 --- /dev/null +++ b/shared/package-files/31/31e8031061bd5e0072fbcaa5181a8d77def59f7e67b706a0dd7fe76372e2cfca/summary.txt @@ -0,0 +1,47 @@ +evals/B35k-sub/report-ind.json + {'hit_rate_at_1': 0.4825, 'hit_rate_at_20': 0.6791, 'hit_rate_at_5': 0.5906} CI 0.4062 0.5726 n 2147 valid 2147 err None + adduct {'[M+H]+': (0.595, 1658), '[M+Na]+': (0.102, 489)} + instrument_type {'': (0.486, 35), 'Orbitrap': (0.494, 1870), 'QTOF': (0.397, 242)} + collision_energy {'20-39.999': (0.723, 512), '40-59.999': (0.746, 177), '<20': (0.57, 151), '>=60': (0.764, 348), 'missing': (0.19, 959)} + routing_domain {'fallback': (0.189, 991), 'glacier_released': (0.734, 1156)} +evals/B35k-sub/report-agg1.json + {'hit_rate_at_1': 0.6092, 'hit_rate_at_20': 0.8337, 'hit_rate_at_5': 0.7112} CI 0.5094 0.7164 n 2147 valid 2147 err None + adduct {'[M+H]+': (0.697, 1658), '[M+Na]+': (0.311, 489)} + instrument_type {'': (0.6, 35), 'Orbitrap': (0.63, 1870), 'QTOF': (0.446, 242)} + collision_energy {'20-39.999': (0.848, 512), '40-59.999': (0.797, 177), '<20': (0.636, 151), '>=60': (0.851, 348), 'missing': (0.356, 959)} + routing_domain {'fallback': (0.361, 991), 'glacier_released': (0.822, 1156)} +all n= 2147 hit1_ind=0.485 hit1_agg=0.610 h5_agg=0.712 h20_agg=0.834 npk=14 d_t=0.629 d_min=0.585 ties=0.21 cands=256 +('H', 'ce') n= 1156 hit1_ind=0.734 hit1_agg=0.822 h5_agg=0.939 h20_agg=0.986 npk=19 d_t=0.515 d_min=0.491 ties=0.00 cands=256 +('H', 'ceNA') n= 502 hit1_ind=0.281 hit1_agg=0.410 h5_agg=0.524 h20_agg=0.663 npk=12 d_t=0.941 d_min=0.761 ties=0.42 cands=256 +('Na', 'ce') n= 32 hit1_ind=0.156 hit1_agg=0.531 h5_agg=0.562 h20_agg=1.000 npk=8 d_t=0.546 d_min=0.487 ties=0.03 cands=256 +('Na', 'ceNA') n= 457 hit1_ind=0.101 hit1_agg=0.300 h5_agg=0.354 h20_agg=0.624 npk=7 d_t=1.000 d_min=0.908 ties=0.53 cands=256 +('H', 'ce', 'Orbitrap') n= 1007 hit1_ind=0.801 hit1_agg=0.892 h5_agg=0.962 h20_agg=0.988 npk=19 d_t=0.489 d_min=0.470 ties=0.00 cands=256 +('H', 'ce', 'QTOF') n= 149 hit1_ind=0.282 hit1_agg=0.349 h5_agg=0.785 h20_agg=0.973 npk=21 d_t=0.704 d_min=0.646 ties=0.01 cands=256 +('H', 'ceNA', 'Orbitrap') n= 411 hit1_ind=0.200 hit1_agg=0.365 h5_agg=0.450 h20_agg=0.613 npk=9 d_t=1.000 d_min=0.827 ties=0.50 cands=256 +('H', 'ceNA', 'QTOF') n= 68 hit1_ind=0.662 hit1_agg=0.588 h5_agg=0.853 h20_agg=0.882 npk=46 d_t=0.644 d_min=0.618 ties=0.01 cands=256 +('H', 'ceNA', 'none') n= 23 hit1_ind=0.609 hit1_agg=0.696 h5_agg=0.870 h20_agg=0.913 npk=106 d_t=0.574 d_min=0.551 ties=0.04 cands=256 +('Na', 'ce', 'Orbitrap') n= 23 hit1_ind=0.087 hit1_agg=0.391 h5_agg=0.391 h20_agg=1.000 npk=8 d_t=0.552 d_min=0.509 ties=0.04 cands=256 +('Na', 'ce', 'QTOF') n= 9 hit1_ind=0.333 hit1_agg=0.889 h5_agg=1.000 h20_agg=1.000 npk=12 d_t=0.318 d_min=0.307 ties=0.00 cands=256 +('Na', 'ceNA', 'Orbitrap') n= 429 hit1_ind=0.086 hit1_agg=0.289 h5_agg=0.347 h20_agg=0.615 npk=7 d_t=1.000 d_min=0.930 ties=0.56 cands=256 +('Na', 'ceNA', 'QTOF') n= 16 hit1_ind=0.375 hit1_agg=0.500 h5_agg=0.500 h20_agg=0.750 npk=84 d_t=0.670 d_min=0.621 ties=0.00 cands=256 +('Na', 'ceNA', 'none') n= 12 hit1_ind=0.250 hit1_agg=0.417 h5_agg=0.417 h20_agg=0.750 npk=84 d_t=0.652 d_min=0.582 ties=0.00 cands=256 +--- non-domain queries by pool composition +nondomain, pool has domain spectra n= 150 hit1_ind=0.260 hit1_agg=0.347 h5_agg=0.667 h20_agg=0.973 npk=16 d_t=0.600 d_min=0.556 ties=0.12 cands=256 +nondomain, pool has no domain spectra n= 841 hit1_ind=0.182 hit1_agg=0.366 h5_agg=0.408 h20_agg=0.599 npk=8 d_t=1.000 d_min=0.856 ties=0.51 cands=256 +--- by number of peaks +npk [1,3) n= 155 hit1_ind=0.084 hit1_agg=0.284 h5_agg=0.400 h20_agg=0.561 npk=2 d_t=1.000 d_min=0.971 ties=0.70 cands=256 +npk [3,6) n= 298 hit1_ind=0.302 hit1_agg=0.473 h5_agg=0.557 h20_agg=0.728 npk=4 d_t=0.848 d_min=0.661 ties=0.41 cands=256 +npk [6,11) n= 414 hit1_ind=0.338 hit1_agg=0.505 h5_agg=0.604 h20_agg=0.778 npk=8 d_t=0.746 d_min=0.614 ties=0.29 cands=256 +npk [11,21) n= 487 hit1_ind=0.480 hit1_agg=0.628 h5_agg=0.737 h20_agg=0.842 npk=15 d_t=0.608 d_min=0.556 ties=0.17 cands=256 +npk [21,51) n= 515 hit1_ind=0.707 hit1_agg=0.759 h5_agg=0.868 h20_agg=0.948 npk=31 d_t=0.579 d_min=0.554 ties=0.03 cands=256 +npk [51,1000000) n= 278 hit1_ind=0.719 hit1_agg=0.788 h5_agg=0.881 h20_agg=0.957 npk=74 d_t=0.584 d_min=0.567 ties=0.01 cands=256 +--- by pool size (queries per pool) +pool_n [1,2) n= 60 hit1_ind=0.733 hit1_agg=0.733 h5_agg=0.917 h20_agg=0.967 npk=44 d_t=0.608 d_min=0.585 ties=0.00 cands=256 +pool_n [2,4) n= 761 hit1_ind=0.794 hit1_agg=0.879 h5_agg=0.957 h20_agg=0.965 npk=21 d_t=0.481 d_min=0.469 ties=0.01 cands=256 +pool_n [4,8) n= 163 hit1_ind=0.620 hit1_agg=0.798 h5_agg=0.847 h20_agg=0.957 npk=20 d_t=0.519 d_min=0.495 ties=0.01 cands=256 +pool_n [8,16) n= 163 hit1_ind=0.552 hit1_agg=0.755 h5_agg=0.914 h20_agg=1.000 npk=16 d_t=0.539 d_min=0.492 ties=0.04 cands=256 +pool_n [16,1000000) n= 1000 hit1_ind=0.202 hit1_agg=0.344 h5_agg=0.459 h20_agg=0.679 npk=9 d_t=0.970 d_min=0.798 ties=0.44 cands=256 +--- by candidates +cands [128,256) n= 13 hit1_ind=0.692 hit1_agg=0.769 h5_agg=1.000 h20_agg=1.000 npk=27 d_t=0.508 d_min=0.508 ties=0.00 cands=189 +cands [256,257) n= 2134 hit1_ind=0.484 hit1_agg=0.609 h5_agg=0.710 h20_agg=0.833 npk=14 d_t=0.632 d_min=0.585 ties=0.21 cands=256 +pool-level hit1_agg (pools weighted equally): 0.7893462469733656 413 diff --git a/shared/package-files/46/4634d40829940e4adead1cf901074ec0626063198f1b22ac58b07a32bd9606dd/ensemble-mean-4M-soup.log b/shared/package-files/46/4634d40829940e4adead1cf901074ec0626063198f1b22ac58b07a32bd9606dd/ensemble-mean-4M-soup.log new file mode 100644 index 0000000000000000000000000000000000000000..3ce481f0bb505fe6915ba44d2e428bf769fd9c26 --- /dev/null +++ b/shared/package-files/46/4634d40829940e4adead1cf901074ec0626063198f1b22ac58b07a32bd9606dd/ensemble-mean-4M-soup.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 58.88140646199463} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 62.694043031995534} +ind meanD all=0.4924 dom=0.7303 non=0.2535 h5=0.6448 h20=0.7232 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6422 dom=0.8121 non=0.4717 h5=0.8325 h20=0.9045 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.4977 dom=0.7385 non=0.2558 h5=0.6469 h20=0.7246 | diff=+0.0052 [+0.0029,+0.0075] +agg Dmean all=0.6495 dom=0.8240 non=0.4743 h5=0.8302 h20=0.9104 | diff=+0.0073 [-0.0011,+0.0176] +ind gmean all=0.4912 dom=0.7285 non=0.2529 h5=0.6425 h20=0.7219 | diff=-0.0012 [-0.0028,+0.0002] +agg gmean all=0.6354 dom=0.8120 non=0.4581 h5=0.8302 h20=0.9044 | diff=-0.0068 [-0.0161,+0.0001] diff --git a/shared/package-files/46/46515e5b3ffc725cd8be1d8633b920f8f9a5874ffde48cfba4f7bac10b4bf49e/tolerance-strata-5Ms.log b/shared/package-files/46/46515e5b3ffc725cd8be1d8633b920f8f9a5874ffde48cfba4f7bac10b4bf49e/tolerance-strata-5Ms.log new file mode 100644 index 0000000000000000000000000000000000000000..9986e40933c11fb45b4be726b7bfe6ae8bbc7075 --- /dev/null +++ b/shared/package-files/46/46515e5b3ffc725cd8be1d8633b920f8f9a5874ffde48cfba4f7bac10b4bf49e/tolerance-strata-5Ms.log @@ -0,0 +1,10 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 77.01010414399207} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 80.98865063628182} +stratum sizes: all 19429, domain 9734, Orbitrap no CE [M+H]+ 3987, Orbitrap no CE [M+Na]+ 4082, Orbitrap no CE, precursor 2 decimals 7194, Orbitrap no CE, precursor finer 875, Orbitrap with CE 8370, not Orbitrap 2990 +released per spectrum / pool rule all: 0.5051 / 0.6485 | domain: 0.7473 / 0.8188 | Orbitrap no CE [M+H]+: 0.2310 / 0.5001 | Orbitrap no CE [M+Na]+: 0.1470 / 0.3704 | Orbitrap no CE, precursor 2 decimals: 0.1426 / 0.4091 | Orbitrap no CE, precursor finer: 0.5657 / 0.6434 | Orbitrap with CE: 0.7881 / 0.8480 | not Orbitrap: 0.5676 / 0.6676 +p20f4 per spectrum / pool rule all: 0.5047 / 0.6466 | domain: 0.7419 / 0.8174 | Orbitrap no CE [M+H]+: 0.2430 / 0.5011 | Orbitrap no CE [M+Na]+: 0.1463 / 0.3635 | Orbitrap no CE, precursor 2 decimals: 0.1503 / 0.4059 | Orbitrap no CE, precursor finer: 0.5543 / 0.6423 | Orbitrap with CE: 0.7817 / 0.8465 | not Orbitrap: 0.5676 / 0.6672 +p40f10 per spectrum / pool rule all: 0.5042 / 0.6391 | domain: 0.7364 / 0.8109 | Orbitrap no CE [M+H]+: 0.2571 / 0.4966 | Orbitrap no CE [M+Na]+: 0.1480 / 0.3513 | Orbitrap no CE, precursor 2 decimals: 0.1600 / 0.3967 | Orbitrap no CE, precursor finer: 0.5463 / 0.6400 | Orbitrap with CE: 0.7735 / 0.8430 | not Orbitrap: 0.5662 / 0.6512 +p80f20 per spectrum / pool rule all: 0.4920 / 0.6405 | domain: 0.7040 / 0.8066 | Orbitrap no CE [M+H]+: 0.2719 / 0.5059 | Orbitrap no CE [M+Na]+: 0.1632 / 0.3631 | Orbitrap no CE, precursor 2 decimals: 0.1781 / 0.4115 | Orbitrap no CE, precursor finer: 0.5360 / 0.6160 | Orbitrap with CE: 0.7442 / 0.8374 | not Orbitrap: 0.5288 / 0.6478 +p150f40 per spectrum / pool rule all: 0.4697 / 0.6161 | domain: 0.6749 / 0.7872 | Orbitrap no CE [M+H]+: 0.2616 / 0.4678 | Orbitrap no CE [M+Na]+: 0.1467 / 0.3474 | Orbitrap no CE, precursor 2 decimals: 0.1662 / 0.3788 | Orbitrap no CE, precursor finer: 0.5097 / 0.6377 | Orbitrap with CE: 0.7149 / 0.8151 | not Orbitrap: 0.5017 / 0.6237 +p80f20m per spectrum / pool rule all: 0.4917 / 0.6419 | domain: 0.7037 / 0.8063 | Orbitrap no CE [M+H]+: 0.2709 / 0.5099 | Orbitrap no CE [M+Na]+: 0.1634 / 0.3660 | Orbitrap no CE, precursor 2 decimals: 0.1781 / 0.4159 | Orbitrap no CE, precursor finer: 0.5326 / 0.6114 | Orbitrap with CE: 0.7435 / 0.8369 | not Orbitrap: 0.5294 / 0.6488 +p150f40m per spectrum / pool rule all: 0.4672 / 0.6134 | domain: 0.6713 / 0.7846 | Orbitrap no CE [M+H]+: 0.2611 / 0.4680 | Orbitrap no CE [M+Na]+: 0.1460 / 0.3415 | Orbitrap no CE, precursor 2 decimals: 0.1665 / 0.3763 | Orbitrap no CE, precursor finer: 0.5017 / 0.6320 | Orbitrap with CE: 0.7106 / 0.8109 | not Orbitrap: 0.4990 / 0.6258 diff --git a/shared/package-files/46/4662090341824510a92bb10e95b439a4d8b351d2163e1ddd31125b9467fe0f29/multires.py b/shared/package-files/46/4662090341824510a92bb10e95b439a4d8b351d2163e1ddd31125b9467fe0f29/multires.py new file mode 100644 index 0000000000000000000000000000000000000000..6d29e42961f8d8f06c50782ce1f6b67cdc0b1af6 --- /dev/null +++ b/shared/package-files/46/4662090341824510a92bb10e95b439a4d8b351d2163e1ddd31125b9467fe0f29/multires.py @@ -0,0 +1,57 @@ +"""Multi-resolution JSD study from saved simulations (dev only; uses validation labels for evaluation).""" +import json, sys, hashlib, pickle, itertools +from pathlib import Path +import numpy as np, torch +sys.path.insert(0, '/workspace/research/allcond/pkg'); sys.path.insert(0, '/workspace/research/ms-pred/src') +import infer +from ms_pred import common +root, pred = Path(sys.argv[1]), Path(sys.argv[2]) +labels = {json.loads(l)['query_id']: json.loads(l) for l in open('/workspace/data/validation.jsonl')} +queries = list(infer.read_jsonl(root / 'queries.jsonl')) +pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(root / 'candidate_pools.jsonl')} +inst = lambda name: common.instrument2onehot_pos.get(name or 'Unknown', common.instrument2onehot_pos['Unknown']) +plan = infer.Plan(queries, pools, 8, inst, set(common.ion2onehot_pos)) +masses = np.load(pred / 'masses.npy'); intens = np.load(pred / 'intens.npy'); done = np.load(pred / 'done.npy') +device = torch.device('cuda') +base = dict(max_observed_peaks=50, observed_intensity_threshold=0.001, upper_limit=1500, ensemble='distance') +widths = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0] +D = {} +for w in widths: + nb = int(round(1500 / w)) + D[w] = infer.score_queries(plan, masses, intens, done, dict(base, num_bins=nb), device) +pickle.dump(D, open(pred / 'multires.pkl', 'wb')) +target, domain = [], [] +ids = {pid: np.array([c['candidate_id'] for c in cands]) for pid, cands in pools.items()} +for q in queries: + tid = hashlib.sha256(labels[q['query_id']]['target_smiles'].encode()).hexdigest() + target.append(int(np.where(ids[q['candidate_pool_id']] == tid)[0][0])) + domain.append(q['adduct'] == '[M+H]+' and q['collision_energy'] is not None) +domain = np.array(domain) +by_pool = {} +for i, q in enumerate(queries): by_pool.setdefault(q['candidate_pool_id'], []).append(i) +def evaluate(dist, weight): + hits = np.zeros(len(queries), bool) + for pid, members in by_pool.items(): + scored = [dist[i] for i in members if dist[i] is not None] + if not scored: continue + mean = np.mean(scored, axis=0) + for i in members: + d = mean if dist[i] is None else (1 - weight) * dist[i] + weight * mean + hits[i] = np.lexsort((ids[pid], d))[0] == target[i] + return hits +def show(name, dist): + h0, h1 = evaluate(dist, 0.0), evaluate(dist, 1.0) + print(f'{name:36s} ind all={h0.mean():.4f} dom={h0[domain].mean():.4f} non={h0[~domain].mean():.4f} | agg all={h1.mean():.4f} dom={h1[domain].mean():.4f} non={h1[~domain].mean():.4f}') +def combo(ws, weights=None): + weights = weights or [1.0] * len(ws) + out = [] + for i in range(len(queries)): + ds = [D[w][i] for w in ws] + out.append(None if any(d is None for d in ds) else sum(c * d for c, d in zip(weights, ds)) / sum(weights)) + return out +for w in widths: show(f'width {w}', D[w]) +for ws in [(0.01, 0.02), (0.01, 0.05), (0.01, 0.1), (0.01, 0.05, 0.2), (0.01, 0.02, 0.05, 0.1), (0.01, 0.05, 0.1, 0.5), (0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0), (0.02, 0.1), (0.05, 0.5)]: + show('mean ' + str(ws), combo(ws)) +for wt in [(3, 1), (2, 1), (1, 2)]: + show(f'0.01,0.05 weights {wt}', combo((0.01, 0.05), list(wt))) + show(f'0.01,0.1 weights {wt}', combo((0.01, 0.1), list(wt))) diff --git a/shared/package-files/46/4675ff6bbb1fdd0da8a28e8ef04be012ab9e77d895b00d4801c03e0e1ff4d8bf/ensemble-mean-2M-same-B2.log b/shared/package-files/46/4675ff6bbb1fdd0da8a28e8ef04be012ab9e77d895b00d4801c03e0e1ff4d8bf/ensemble-mean-2M-same-B2.log new file mode 100644 index 0000000000000000000000000000000000000000..11730158f1525780275f247fdd4a67afc7199d4b --- /dev/null +++ b/shared/package-files/46/4675ff6bbb1fdd0da8a28e8ef04be012ab9e77d895b00d4801c03e0e1ff4d8bf/ensemble-mean-2M-same-B2.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 93.526362471006} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 98.51147835000302} +ind meanD all=0.4871 dom=0.7260 non=0.2472 h5=0.6390 h20=0.7170 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6280 dom=0.8140 non=0.4413 h5=0.8024 h20=0.8764 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.4911 dom=0.7309 non=0.2502 h5=0.6410 h20=0.7182 | diff=+0.0040 [+0.0021,+0.0060] +agg Dmean all=0.6314 dom=0.8215 non=0.4406 h5=0.8087 h20=0.8846 | diff=+0.0034 [-0.0023,+0.0090] +ind gmean all=0.4852 dom=0.7239 non=0.2455 h5=0.6383 h20=0.7165 | diff=-0.0020 [-0.0035,-0.0004] +agg gmean all=0.6249 dom=0.8082 non=0.4408 h5=0.8037 h20=0.8763 | diff=-0.0031 [-0.0088,+0.0003] diff --git a/shared/package-files/46/46f63581c0f540769dc9dd61bbb3df42312f232d7a929f0bc4b2db9961a41f13/metrics.jsonl b/shared/package-files/46/46f63581c0f540769dc9dd61bbb3df42312f232d7a929f0bc4b2db9961a41f13/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..3218b352fa1d51acf3e7e084cd10779476e31089 --- /dev/null +++ b/shared/package-files/46/46f63581c0f540769dc9dd61bbb3df42312f232d7a929f0bc4b2db9961a41f13/metrics.jsonl @@ -0,0 +1,250 @@ +{"step": 200, "loss": 0.32984035363420844, "loss_real": 0.32839940341189505, "loss_synth": 0.32985898019745946, "lr": 5.999770185426209e-05, "elapsed": 18.687599655007944, "steps_per_second": 39.33444739841113, "loss_extra": 0.33007212651893497} +{"step": 400, "loss": 0.04826136523857713, "loss_real": 0.04365978606045246, "loss_synth": 0.04876996006816626, "lr": 0.0001199815230572914, "elapsed": 23.055539864930324, "steps_per_second": 42.31666062872413, "loss_extra": 0.048554350417107345} +{"step": 600, "loss": 0.045071355048567054, "loss_real": 0.039193181097507475, "loss_synth": 0.04560333328321576, "lr": 0.00017993754018322624, "elapsed": 27.359005097998306, "steps_per_second": 43.61730831612567, "loss_extra": 0.04556283719837666} +{"step": 800, "loss": 0.042978927418589594, "loss_real": 0.03551881107501686, "loss_synth": 0.04365550758317113, "lr": 0.0002398518371215969, "elapsed": 31.670976176974364, "steps_per_second": 44.27722832100195, "loss_extra": 0.04360125003382564} +{"step": 1000, "loss": 0.04207608286291361, "loss_real": 0.03402715938165784, "loss_synth": 0.04274130927398801, "lr": 0.0002997105087403322, "elapsed": 36.071397033985704, "steps_per_second": 44.50695402625512, "loss_extra": 0.04281200394034386} +{"step": 1200, "loss": 0.041182298976927996, "loss_real": 0.033146814946085214, "loss_synth": 0.041794504672288894, "lr": 0.00035949966454633923, "elapsed": 40.3274983339943, "steps_per_second": 44.90261688896966, "loss_extra": 0.04196868089959025} +{"step": 1400, "loss": 0.04041769376024604, "loss_real": 0.03240492887794971, "loss_synth": 0.04092608649283647, "lr": 0.0004192054323428467, "elapsed": 44.555384998908266, "steps_per_second": 45.230760888803815, "loss_extra": 0.041303502060472966} +{"step": 1600, "loss": 0.039717577882111076, "loss_real": 0.03174469995312393, "loss_synth": 0.0401727544143796, "lr": 0.0004788139618827038, "elapsed": 48.75540738098789, "steps_per_second": 45.5160833712013, "loss_extra": 0.040649447329342364} +{"step": 1800, "loss": 0.03910872960463166, "loss_real": 0.031245682993903755, "loss_synth": 0.039567145071923736, "lr": 0.000538311428516825, "elapsed": 52.91154954500962, "steps_per_second": 45.7915627414644, "loss_extra": 0.04001829324290156} +{"step": 2000, "loss": 0.038516395147889855, "loss_real": 0.030636202776804566, "loss_synth": 0.03895939890295267, "lr": 0.0005976840368369773, "elapsed": 56.88699634792283, "steps_per_second": 46.206452466938615, "loss_extra": 0.03944428324699402} +{"step": 2200, "loss": 0.0379084787145257, "loss_real": 0.03009403532370925, "loss_synth": 0.03827409762889147, "lr": 0.0005971982039200904, "elapsed": 60.63247185293585, "steps_per_second": 46.779175503914374, "loss_extra": 0.03890200203284621} +{"step": 2400, "loss": 0.037236205376684664, "loss_real": 0.02950790822505951, "loss_synth": 0.03757056636735797, "lr": 0.000596666387431128, "elapsed": 64.46326487290207, "steps_per_second": 47.18811287608902, "loss_extra": 0.038245888352394106} +{"step": 2600, "loss": 0.036624424029141664, "loss_real": 0.029094003746286033, "loss_synth": 0.036944314911961554, "lr": 0.0005960886713500785, "elapsed": 68.20058093592525, "steps_per_second": 47.62115592626665, "loss_extra": 0.037614137940108774} +{"step": 2800, "loss": 0.03602298470214009, "loss_real": 0.028544441638514398, "loss_synth": 0.03632681431248784, "lr": 0.0005954651469050082, "elapsed": 71.9497275389731, "steps_per_second": 47.988979616606976, "loss_extra": 0.03701967947185039} +{"step": 3000, "loss": 0.035586576238274575, "loss_real": 0.028165603615343572, "loss_synth": 0.03582555633038283, "lr": 0.0005947959125576553, "elapsed": 75.72949950490147, "steps_per_second": 48.2885715439188, "loss_extra": 0.03663784496486187} +{"step": 3200, "loss": 0.03507101790979505, "loss_real": 0.02784139753319323, "loss_synth": 0.035240327399224045, "lr": 0.000594081073987881, "elapsed": 79.6236959049711, "steps_per_second": 48.4696484434679, "loss_extra": 0.03615841746330261} +{"step": 3400, "loss": 0.03472844311967492, "loss_real": 0.02736267426982522, "loss_synth": 0.03495210088789463, "lr": 0.0005933207440769824, "elapsed": 83.34276778390631, "steps_per_second": 48.75267043692543, "loss_extra": 0.03578537814319134} +{"step": 3600, "loss": 0.034258974492549894, "loss_real": 0.027287146402522923, "loss_synth": 0.03438949102535844, "lr": 0.0005925150428898661, "elapsed": 90.10768104693852, "steps_per_second": 47.05594312994544, "loss_extra": 0.03534021748229861} +{"step": 3800, "loss": 0.03387130249291658, "loss_real": 0.027208004454150794, "loss_synth": 0.0340343514457345, "lr": 0.0005916640976560898, "elapsed": 98.59087902295869, "steps_per_second": 44.7122573119336, "loss_extra": 0.03486654998734593} +{"step": 4000, "loss": 0.03351683666929603, "loss_real": 0.026355555430054665, "loss_synth": 0.03371622061356902, "lr": 0.0005907680427497705, "elapsed": 105.18942800397053, "steps_per_second": 43.67459257294503, "loss_extra": 0.034562416989356276} +{"step": 4200, "loss": 0.03321359286084771, "loss_real": 0.02664664266631007, "loss_synth": 0.03325508719310164, "lr": 0.000589827019668365, "elapsed": 110.42366806196515, "steps_per_second": 43.37916701465362, "loss_extra": 0.034313141591846945} +{"step": 4400, "loss": 0.03289854446426034, "loss_real": 0.02603820011951029, "loss_synth": 0.03296818403527141, "lr": 0.0005888411770103267, "elapsed": 115.233853557962, "steps_per_second": 43.29393856801061, "loss_extra": 0.034021038375794885} +{"step": 4600, "loss": 0.032664599623531104, "loss_real": 0.02580209485255182, "loss_synth": 0.032823152225464586, "lr": 0.0005878106704516395, "elapsed": 119.70570176793262, "steps_per_second": 43.354220465907495, "loss_extra": 0.033698932826519014} +{"step": 4800, "loss": 0.0323698721639812, "loss_real": 0.02600571362301707, "loss_synth": 0.0324029553681612, "lr": 0.0005867356627212351, "elapsed": 124.24157213792205, "steps_per_second": 43.3845070880967, "loss_extra": 0.033442565202713014} +{"step": 5000, "loss": 0.032010662369430065, "loss_real": 0.025455346452072262, "loss_synth": 0.032008160799741746, "lr": 0.000585616323575296, "elapsed": 128.59051937796175, "steps_per_second": 43.48297933392771, "loss_extra": 0.033151999097317454} +{"step": 5200, "loss": 0.03184604896232486, "loss_real": 0.025236865570768714, "loss_synth": 0.03190876795910299, "lr": 0.000584452829770449, "elapsed": 134.00896805489901, "steps_per_second": 43.18722746084571, "loss_extra": 0.03293179986998439} +{"step": 5400, "loss": 0.03157595781609416, "loss_real": 0.025300708990544082, "loss_synth": 0.03161842921748757, "lr": 0.0005832453650358537, "elapsed": 138.45036311401054, "steps_per_second": 43.252815191503934, "loss_extra": 0.032623856849968436} +{"step": 5600, "loss": 0.03132422152906656, "loss_real": 0.024908513650298118, "loss_synth": 0.03127561869099736, "lr": 0.0005819941200441891, "elapsed": 142.83614060399123, "steps_per_second": 43.33253747320387, "loss_extra": 0.03248721100389958} +{"step": 5800, "loss": 0.03113512028940022, "loss_real": 0.024835786819458007, "loss_synth": 0.031143010826781392, "lr": 0.0005806992923815441, "elapsed": 147.18478505697567, "steps_per_second": 43.419092821954074, "loss_extra": 0.032221638020128014} +{"step": 6000, "loss": 0.0309244691580534, "loss_real": 0.024427039958536626, "loss_synth": 0.03094874020665884, "lr": 0.0005793610865162167, "elapsed": 151.44226400798652, "steps_per_second": 43.52896082516118, "loss_extra": 0.03202909022569656} +{"step": 6200, "loss": 0.030644638454541562, "loss_real": 0.02442758820950985, "loss_synth": 0.030678599961102008, "lr": 0.0005779797137664262, "elapsed": 155.47012961097062, "steps_per_second": 43.70286437064536, "loss_extra": 0.03169090104289353} +{"step": 6400, "loss": 0.030563201997429134, "loss_real": 0.024681020267307757, "loss_synth": 0.030508151520043613, "lr": 0.0005765553922669433, "elapsed": 159.26409066095948, "steps_per_second": 43.937608188887715, "loss_extra": 0.031639922400936486} +{"step": 6600, "loss": 0.030367009295150637, "loss_real": 0.024367999993264677, "loss_synth": 0.030411669248715044, "lr": 0.0005750883469346437, "elapsed": 163.00037454499397, "steps_per_second": 44.177482695391944, "loss_extra": 0.031364738177508115} +{"step": 6800, "loss": 0.030084770154207945, "loss_real": 0.024188126493245362, "loss_synth": 0.029972629705443978, "lr": 0.000573578809432992, "elapsed": 166.78110042994376, "steps_per_second": 44.39276826118102, "loss_extra": 0.03122085116803646} +{"step": 7000, "loss": 0.02995472843758762, "loss_real": 0.023798542134463786, "loss_synth": 0.029903104715049266, "lr": 0.000572027018135459, "elapsed": 170.66064576792996, "steps_per_second": 44.56962214867916, "loss_extra": 0.03107563951984048} +{"step": 7200, "loss": 0.02987589097581804, "loss_real": 0.02383930241689086, "loss_synth": 0.02984170009382069, "lr": 0.0005704332180878793, "elapsed": 174.3924914629897, "steps_per_second": 44.77904524490219, "loss_extra": 0.030958665488287806} +{"step": 7400, "loss": 0.029647071845829487, "loss_real": 0.02370492327027023, "loss_synth": 0.029653958985581996, "lr": 0.0005687976609697565, "elapsed": 178.12424124998506, "steps_per_second": 44.97899400727559, "loss_extra": 0.030672535374760626} +{"step": 7600, "loss": 0.029572933334857224, "loss_real": 0.023649142449721695, "loss_synth": 0.02948038725182414, "lr": 0.0005671206050545193, "elapsed": 181.85141440993175, "steps_per_second": 45.17130191332928, "loss_extra": 0.03069421973079443} +{"step": 7800, "loss": 0.02934414624236524, "loss_real": 0.023523521292954683, "loss_synth": 0.029348168624565005, "lr": 0.000565402315168738, "elapsed": 186.49851531593595, "steps_per_second": 45.11395168738506, "loss_extra": 0.030351349990814923} +{"step": 8000, "loss": 0.029258989160880447, "loss_real": 0.023355349348858, "loss_synth": 0.029201778769493102, "lr": 0.0005636430626503045, "elapsed": 195.82005645195022, "steps_per_second": 43.903683206457224, "loss_extra": 0.03034158851020038} +{"step": 8200, "loss": 0.029085855912417174, "loss_real": 0.02321448940783739, "loss_synth": 0.02891050555743277, "lr": 0.0005618431253055855, "elapsed": 202.9965584819438, "steps_per_second": 43.296086705811916, "loss_extra": 0.03028048793785274} +{"step": 8400, "loss": 0.029014678010717034, "loss_real": 0.023316929172724484, "loss_synth": 0.028894868325442077, "lr": 0.000560002787365553, "elapsed": 208.54223965399433, "steps_per_second": 43.090349299002554, "loss_extra": 0.030123842265456915} +{"step": 8600, "loss": 0.028774280101060867, "loss_real": 0.022985090175643562, "loss_synth": 0.028642907561734317, "lr": 0.0005581223394409018, "elapsed": 213.62506601400673, "steps_per_second": 42.995255976322234, "loss_extra": 0.02991084381006658} +{"step": 8800, "loss": 0.028656107196584343, "loss_real": 0.02269365674816072, "loss_synth": 0.028558988785371185, "lr": 0.0005562020784761579, "elapsed": 218.07761230692267, "steps_per_second": 43.03712733685355, "loss_extra": 0.029788662465289235} +{"step": 9000, "loss": 0.02858210417442024, "loss_real": 0.02255314202979207, "loss_synth": 0.02842928539030254, "lr": 0.0005542423077027882, "elapsed": 222.51723590993788, "steps_per_second": 43.079878621047804, "loss_extra": 0.029781678868457676} +{"step": 9200, "loss": 0.02840207751840353, "loss_real": 0.022699162950739264, "loss_synth": 0.028259743433445693, "lr": 0.0005522433365913161, "elapsed": 227.00515960890334, "steps_per_second": 43.111091026405866, "loss_extra": 0.029534567883238196} +{"step": 9400, "loss": 0.028379604164510967, "loss_real": 0.022609668811783196, "loss_synth": 0.02835021948441863, "lr": 0.0005502054808024529, "elapsed": 231.46086063992698, "steps_per_second": 43.14739850068313, "loss_extra": 0.029411267479881643} +{"step": 9600, "loss": 0.02828184649348259, "loss_real": 0.02256869412958622, "loss_synth": 0.028181105367839337, "lr": 0.0005481290621372514, "elapsed": 235.89754418097436, "steps_per_second": 43.185944865749335, "loss_extra": 0.02937469881027937} +{"step": 9800, "loss": 0.02810642285272479, "loss_real": 0.022498010704293848, "loss_synth": 0.027984977699816227, "lr": 0.000546014408486289, "elapsed": 240.40860008995514, "steps_per_second": 43.208809325066596, "loss_extra": 0.0292016951367259} +{"step": 10000, "loss": 0.028015298750251532, "loss_real": 0.022203194154426457, "loss_synth": 0.02792995534837246, "lr": 0.0005438618537778916, "elapsed": 244.7892812989885, "steps_per_second": 43.25516146498871, "loss_extra": 0.029110009651631116} +{"step": 10200, "loss": 0.02791747652925551, "loss_real": 0.02224438024684787, "loss_synth": 0.027711562952026723, "lr": 0.0005416717379254006, "elapsed": 261.6932254959829, "steps_per_second": 41.11407417074065, "loss_extra": 0.029108097050338982} +{"step": 10400, "loss": 0.027778164567425847, "loss_real": 0.021813911767676473, "loss_synth": 0.027734526013955475, "lr": 0.0005394444067734975, "elapsed": 265.47394166793674, "steps_per_second": 41.290987615468815, "loss_extra": 0.028857779782265426} +{"step": 10600, "loss": 0.02775545652024448, "loss_real": 0.02218247246928513, "loss_synth": 0.027615924989804627, "lr": 0.0005371802120435915, "elapsed": 269.21840991894715, "steps_per_second": 41.46854814009539, "loss_extra": 0.028862583748996258} +{"step": 10800, "loss": 0.027561957417055964, "loss_real": 0.02193476738873869, "loss_synth": 0.027391177108511328, "lr": 0.0005348795112782779, "elapsed": 272.9593883759808, "steps_per_second": 41.641541956049664, "loss_extra": 0.02870961820706725} +{"step": 11000, "loss": 0.027453739969059823, "loss_real": 0.02188117233105004, "loss_synth": 0.027308054491877554, "lr": 0.0005325426677848778, "elapsed": 276.8409746380057, "steps_per_second": 41.78728371452258, "loss_extra": 0.02856692275032401} +{"step": 11200, "loss": 0.027383540682494642, "loss_real": 0.021865299167111517, "loss_synth": 0.02714891134761274, "lr": 0.0005301700505780687, "elapsed": 280.702610851964, "steps_per_second": 41.93192156387438, "loss_extra": 0.028575852382928132} +{"step": 11400, "loss": 0.02724368415772915, "loss_real": 0.02182316388003528, "loss_synth": 0.027035312540829182, "lr": 0.0005277620343216117, "elapsed": 284.5480948049808, "steps_per_second": 42.07494487662445, "loss_extra": 0.028392872530966996} +{"step": 11600, "loss": 0.027178909750655292, "loss_real": 0.021509069707244633, "loss_synth": 0.027045887438580395, "lr": 0.0005253189992691882, "elapsed": 288.2887239669217, "steps_per_second": 42.230079381777735, "loss_extra": 0.02829638183116913} +{"step": 11800, "loss": 0.027192790517583488, "loss_real": 0.021392753878608346, "loss_synth": 0.02713466220535338, "lr": 0.0005228413312043536, "elapsed": 292.25764596194495, "steps_per_second": 42.34632400041224, "loss_extra": 0.02825830487534404} +{"step": 12000, "loss": 0.027030795542523266, "loss_real": 0.02140180646907538, "loss_synth": 0.026839871713891624, "lr": 0.0005203294213796174, "elapsed": 296.22485792590305, "steps_per_second": 42.459560678107415, "loss_extra": 0.02819882709532976} +{"step": 12200, "loss": 0.026877258634194733, "loss_real": 0.020947305457666515, "loss_synth": 0.026791720520704984, "lr": 0.0005177836664546598, "elapsed": 299.9801280719694, "steps_per_second": 42.601167254944784, "loss_extra": 0.027992637064307928} +{"step": 12400, "loss": 0.026887019714340567, "loss_real": 0.02114406115375459, "loss_synth": 0.026708347406238318, "lr": 0.000515204468433695, "elapsed": 303.8793991849525, "steps_per_second": 42.717905962565695, "loss_extra": 0.028062651455402373} +{"step": 12600, "loss": 0.026738491430878638, "loss_real": 0.021144953994080423, "loss_synth": 0.026511466866359114, "lr": 0.0005125922346019892, "elapsed": 307.7439128999831, "steps_per_second": 42.836611214025325, "loss_extra": 0.027936311541125178} +{"step": 12800, "loss": 0.02670823280699551, "loss_real": 0.021047650766558946, "loss_synth": 0.026509154131636025, "lr": 0.0005099473774615467, "elapsed": 311.49594747601077, "steps_per_second": 42.968455739590006, "loss_extra": 0.02788987325504422} +{"step": 13000, "loss": 0.02664270273409784, "loss_real": 0.021093974029645322, "loss_synth": 0.02641952904872596, "lr": 0.00050727031466597, "elapsed": 315.2807054859586, "steps_per_second": 43.092345547754256, "loss_extra": 0.027828904092311858} +{"step": 13200, "loss": 0.026568472869694233, "loss_real": 0.020822438253089784, "loss_synth": 0.026406681975349785, "lr": 0.000504561468954508, "elapsed": 319.12995480792597, "steps_per_second": 43.20404366950661, "loss_extra": 0.027727828780189156} +{"step": 13400, "loss": 0.02641557746566832, "loss_real": 0.02084171344526112, "loss_synth": 0.026220807107165456, "lr": 0.0005018212680853004, "elapsed": 323.0002921199193, "steps_per_second": 43.310010363059384, "loss_extra": 0.027577862543985247} +{"step": 13600, "loss": 0.026372050298377872, "loss_real": 0.020661150137893856, "loss_synth": 0.026223626844584944, "lr": 0.0004990501447678302, "elapsed": 326.89359871693887, "steps_per_second": 43.410175652156106, "loss_extra": 0.027511991914361714} +{"step": 13800, "loss": 0.026387189980596304, "loss_real": 0.020649163350462914, "loss_synth": 0.02625118361786008, "lr": 0.0004962485365945929, "elapsed": 330.81062856700737, "steps_per_second": 43.50462815226678, "loss_extra": 0.02751947980374098} +{"step": 14000, "loss": 0.026196336867287756, "loss_real": 0.020513774775899947, "loss_synth": 0.025995352640748023, "lr": 0.0004934168859719962, "elapsed": 334.67871527792886, "steps_per_second": 43.60342206734489, "loss_extra": 0.02738369337283075} +{"step": 14200, "loss": 0.026297111148014665, "loss_real": 0.020857417942024767, "loss_synth": 0.026104366583749653, "lr": 0.0004905556400504991, "elapsed": 338.48399333294947, "steps_per_second": 43.70831233653192, "loss_extra": 0.0274340695515275} +{"step": 14400, "loss": 0.026092894272878767, "loss_real": 0.020695445318706332, "loss_synth": 0.02589533624239266, "lr": 0.0004876652506540011, "elapsed": 342.28623983392026, "steps_per_second": 43.811177997529725, "loss_extra": 0.02722730690613389} +{"step": 14600, "loss": 0.02608502714894712, "loss_real": 0.020566645353101196, "loss_synth": 0.02581865940243006, "lr": 0.00048474617420849446, "elapsed": 346.1037925030105, "steps_per_second": 43.90966953753651, "loss_extra": 0.02730896727181971} +{"step": 14800, "loss": 0.026000663982704283, "loss_real": 0.02074725230690092, "loss_synth": 0.025789806116372348, "lr": 0.000481798871669989, "elapsed": 349.9718534189742, "steps_per_second": 43.99931734829774, "loss_extra": 0.027123296419158578} +{"step": 15000, "loss": 0.025918896524235607, "loss_real": 0.020422801757231355, "loss_synth": 0.02574136105366051, "lr": 0.00047882380845172155, "elapsed": 353.8700659389142, "steps_per_second": 44.083020157281496, "loss_extra": 0.027050508987158536} +{"step": 15200, "loss": 0.025829149391502142, "loss_real": 0.020235231686383484, "loss_synth": 0.025568710016086696, "lr": 0.0004758214543506626, "elapsed": 358.4684336819919, "steps_per_second": 44.07516218273042, "loss_extra": 0.027060308679938316} +{"step": 15400, "loss": 0.02574286007322371, "loss_real": 0.020324256918393076, "loss_synth": 0.02552437849342823, "lr": 0.0004727922834733288, "elapsed": 362.3241558329901, "steps_per_second": 44.16135832692603, "loss_extra": 0.026901782471686602} +{"step": 15600, "loss": 0.02568170551210642, "loss_real": 0.020244917767122388, "loss_synth": 0.025458178389817475, "lr": 0.0004697367741609171, "elapsed": 366.13563109200913, "steps_per_second": 44.251222564447524, "loss_extra": 0.026848811469972134} +{"step": 15800, "loss": 0.02569873157888651, "loss_real": 0.020121230031363666, "loss_synth": 0.025492601599544286, "lr": 0.0004666554089137685, "elapsed": 369.9436191909481, "steps_per_second": 44.33959833438842, "loss_extra": 0.026872959956526755} +{"step": 16000, "loss": 0.0255767638143152, "loss_real": 0.020079077673144638, "loss_synth": 0.025350105725228788, "lr": 0.00046354867431517584, "elapsed": 373.93221272795927, "steps_per_second": 44.403837790485824, "loss_extra": 0.026757567115128042} +{"step": 16200, "loss": 0.025614589853212237, "loss_real": 0.020000229724682867, "loss_synth": 0.02546197080053389, "lr": 0.0004604170609545466, "elapsed": 377.7528190909652, "steps_per_second": 44.4871837834041, "loss_extra": 0.026741937538608908} +{"step": 16400, "loss": 0.025457167876884342, "loss_real": 0.019912757631391286, "loss_synth": 0.025197277134284376, "lr": 0.00045726106334993325, "elapsed": 381.5540248589823, "steps_per_second": 44.57114893009203, "loss_extra": 0.02667918027378619} +{"step": 16600, "loss": 0.025459148082882167, "loss_real": 0.019913877765648066, "loss_synth": 0.02522703627124429, "lr": 0.0004540811798699431, "elapsed": 385.35532823891845, "steps_per_second": 44.65338521825536, "loss_extra": 0.026653648484498263} +{"step": 16800, "loss": 0.025309027805924415, "loss_real": 0.01961683325469494, "loss_synth": 0.025123955244198443, "lr": 0.00045087791265504006, "elapsed": 389.2125845809933, "steps_per_second": 44.72729295710572, "loss_extra": 0.026482213689014315} +{"step": 17000, "loss": 0.02533793340437114, "loss_real": 0.019888852508738637, "loss_synth": 0.025161397522315384, "lr": 0.0004476517675382507, "elapsed": 393.01653986796737, "steps_per_second": 44.80599170080845, "loss_extra": 0.026460382686927915} +{"step": 17200, "loss": 0.025242437478154897, "loss_real": 0.019748425730504095, "loss_synth": 0.024985970677807928, "lr": 0.00044440325396528766, "elapsed": 397.0304187289439, "steps_per_second": 44.858554933871524, "loss_extra": 0.02645228510722518} +{"step": 17400, "loss": 0.025233918875455855, "loss_real": 0.019645647285506128, "loss_synth": 0.02495050210505724, "lr": 0.00044113288491410207, "elapsed": 400.9044507339131, "steps_per_second": 44.926245134250046, "loss_extra": 0.026486977469176054} +{"step": 17600, "loss": 0.025075139654800297, "loss_real": 0.019598605008795858, "loss_synth": 0.02486157825216651, "lr": 0.00043784117681387844, "elapsed": 404.7148835269036, "steps_per_second": 44.999910936196926, "loss_extra": 0.02623922717757523} +{"step": 17800, "loss": 0.025129153542220593, "loss_real": 0.01942584869917482, "loss_synth": 0.02492008052766323, "lr": 0.00043452864946348456, "elapsed": 408.5238243979402, "steps_per_second": 45.07232543603932, "loss_extra": 0.02632816830649972} +{"step": 18000, "loss": 0.02504312771372497, "loss_real": 0.019324033129960297, "loss_synth": 0.024878499060869218, "lr": 0.00043119582594938896, "elapsed": 412.4867339339107, "steps_per_second": 45.125931082999024, "loss_extra": 0.026200629491358995} +{"step": 18200, "loss": 0.02493507538922131, "loss_real": 0.019229204547591507, "loss_synth": 0.02468499606475234, "lr": 0.0004278432325630599, "elapsed": 416.45338051591534, "steps_per_second": 45.178063115154, "loss_extra": 0.02617536817677319} +{"step": 18400, "loss": 0.02500434722751379, "loss_real": 0.019485079543665053, "loss_synth": 0.024752708338201045, "lr": 0.00042447139871785766, "elapsed": 420.37962811696343, "steps_per_second": 45.23367035058523, "loss_extra": 0.02621377483010292} +{"step": 18600, "loss": 0.024840750684961676, "loss_real": 0.01930315304081887, "loss_synth": 0.02457039733417332, "lr": 0.0004210808568654337, "elapsed": 424.17660724092275, "steps_per_second": 45.30247339401808, "loss_extra": 0.026071997787803412} +{"step": 18800, "loss": 0.02488099053502083, "loss_real": 0.01931819644756615, "loss_synth": 0.024621432712301612, "lr": 0.00041767214241165117, "elapsed": 428.13605767290574, "steps_per_second": 45.352233229493834, "loss_extra": 0.026105865370482206} +{"step": 19000, "loss": 0.02481641948223114, "loss_real": 0.01914853838738054, "loss_synth": 0.024615893615409733, "lr": 0.00041424579363203725, "elapsed": 432.18503307690844, "steps_per_second": 45.39134126545444, "loss_extra": 0.026000768952071665} +{"step": 19200, "loss": 0.02479699461720884, "loss_real": 0.01924166056793183, "loss_synth": 0.02458152704872191, "lr": 0.00041080235158678376, "elapsed": 436.0081812979188, "steps_per_second": 45.453987701834954, "loss_extra": 0.025976669806987047} +{"step": 19400, "loss": 0.024690065383911133, "loss_real": 0.01909731363877654, "loss_synth": 0.02437749058008194, "lr": 0.00040734236003530744, "elapsed": 439.842250896967, "steps_per_second": 45.51434394928557, "loss_extra": 0.025972936721518635} +{"step": 19600, "loss": 0.024543025493621827, "loss_real": 0.019017794751562178, "loss_synth": 0.024351598359644414, "lr": 0.0004038663653503835, "elapsed": 443.8042153789429, "steps_per_second": 45.56007566612648, "loss_extra": 0.02569353248924017} +{"step": 19800, "loss": 0.024578186282888055, "loss_real": 0.018843721547164023, "loss_synth": 0.024291385989636184, "lr": 0.000400374916431868, "elapsed": 447.6068212930113, "steps_per_second": 45.62171794646737, "loss_extra": 0.025860011978074908} +{"step": 20000, "loss": 0.024518369026482106, "loss_real": 0.018825590084306894, "loss_synth": 0.024352797837927938, "lr": 0.00039686856462001896, "elapsed": 451.3958457489498, "steps_per_second": 45.68370659913802, "loss_extra": 0.025672237435355783} +{"step": 20200, "loss": 0.024508352018892766, "loss_real": 0.019144823970273138, "loss_synth": 0.024310413701459765, "lr": 0.00039334786360843476, "elapsed": 467.6054186229594, "steps_per_second": 44.49315484308203, "loss_extra": 0.025637249974533916} +{"step": 20400, "loss": 0.024431935511529446, "loss_real": 0.0188777809869498, "loss_synth": 0.024162360820919274, "lr": 0.00038981336935661813, "elapsed": 471.68968173791654, "steps_per_second": 44.53305614715395, "loss_extra": 0.02566528378985822} +{"step": 20600, "loss": 0.024396896520629527, "loss_real": 0.01887137545272708, "loss_synth": 0.024207490449771284, "lr": 0.00038626564000218466, "elapsed": 475.55772368994076, "steps_per_second": 44.593114572856564, "loss_extra": 0.025545441508293153} +{"step": 20800, "loss": 0.02432512312196195, "loss_real": 0.01854653623420745, "loss_synth": 0.024069520514458417, "lr": 0.00038270523577272616, "elapsed": 479.4055741629563, "steps_per_second": 44.65411114495956, "loss_extra": 0.025583548974245786} +{"step": 21000, "loss": 0.02429214329458773, "loss_real": 0.01863538870587945, "loss_synth": 0.02407639356330037, "lr": 0.0003791327188973438, "elapsed": 483.4410089299781, "steps_per_second": 44.6962559685162, "loss_extra": 0.025489719370380044} +{"step": 21200, "loss": 0.02430887564085424, "loss_real": 0.01847722625359893, "loss_synth": 0.024106221245601772, "lr": 0.00037554865351786614, "elapsed": 487.8579575169133, "steps_per_second": 44.70169386070134, "loss_extra": 0.02552379627712071} +{"step": 21400, "loss": 0.02420620677061379, "loss_real": 0.018496608114801347, "loss_synth": 0.02394380623474717, "lr": 0.00037195360559976446, "elapsed": 492.0075173219666, "steps_per_second": 44.73201890986201, "loss_extra": 0.02545941644348204} +{"step": 21600, "loss": 0.024184339065104723, "loss_real": 0.01849824027623981, "loss_synth": 0.023941597929224373, "lr": 0.0003683481428427801, "elapsed": 495.83277936792, "steps_per_second": 44.79192461158565, "loss_extra": 0.0254138898383826} +{"step": 21800, "loss": 0.024147673845291137, "loss_real": 0.018834740351885558, "loss_synth": 0.023939554281532764, "lr": 0.0003647328345912784, "elapsed": 499.7094866099069, "steps_per_second": 44.84614074247434, "loss_extra": 0.025277920300140977} +{"step": 22000, "loss": 0.024096918776631355, "loss_real": 0.018362106126733124, "loss_synth": 0.02382961138151586, "lr": 0.0003611082517443419, "elapsed": 503.5276628329884, "steps_per_second": 44.90486312300327, "loss_extra": 0.02535939493216574} +{"step": 22200, "loss": 0.0240167052205652, "loss_real": 0.018253506012260914, "loss_synth": 0.023872756268829107, "lr": 0.00035747496666562, "elapsed": 507.3407491398975, "steps_per_second": 44.96314077152613, "loss_extra": 0.02516127715818584} +{"step": 22400, "loss": 0.02412208640947938, "loss_real": 0.018250606041401624, "loss_synth": 0.02395462800748646, "lr": 0.00035383355309294483, "elapsed": 511.36448475695215, "steps_per_second": 45.001472782678874, "loss_extra": 0.02530887962318957} +{"step": 22600, "loss": 0.024067604346200824, "loss_real": 0.018260691626928748, "loss_synth": 0.02382126818411052, "lr": 0.00035018458604773206, "elapsed": 515.1645893969107, "steps_per_second": 45.05927169182486, "loss_extra": 0.025321723707020283} +{"step": 22800, "loss": 0.023875142242759467, "loss_real": 0.01820848505012691, "loss_synth": 0.023681060802191498, "lr": 0.0003465286417441785, "elapsed": 518.9589734349865, "steps_per_second": 45.116712012839265, "loss_extra": 0.025052861887961627} +{"step": 23000, "loss": 0.023836699370294808, "loss_real": 0.018163367402739824, "loss_synth": 0.023692062869668008, "lr": 0.0003428662974982705, "elapsed": 522.7523379329359, "steps_per_second": 45.17338667246374, "loss_extra": 0.024966343380510805} +{"step": 23200, "loss": 0.02386493262834847, "loss_real": 0.018251225990243255, "loss_synth": 0.0236096403375268, "lr": 0.00033919813163662, "elapsed": 526.6031392269069, "steps_per_second": 45.224159101644666, "loss_extra": 0.025094404974952342} +{"step": 23400, "loss": 0.023761696312576533, "loss_real": 0.01798698558472097, "loss_synth": 0.02343520608730614, "lr": 0.000335524723405139, "elapsed": 530.4163822149858, "steps_per_second": 45.27746518504214, "loss_extra": 0.02509003587067127} +{"step": 23600, "loss": 0.02377291769720614, "loss_real": 0.01839322494342923, "loss_synth": 0.02351136602461338, "lr": 0.00033184665287757097, "elapsed": 534.364291934995, "steps_per_second": 45.31826825229634, "loss_extra": 0.024967967793345452} +{"step": 23800, "loss": 0.023785856273025274, "loss_real": 0.018493382893502712, "loss_synth": 0.023520751791074872, "lr": 0.0003281645008638895, "elapsed": 538.2422453579493, "steps_per_second": 45.364505465735085, "loss_extra": 0.024969291845336555} +{"step": 24000, "loss": 0.02365153716877103, "loss_real": 0.01785986798349768, "loss_synth": 0.023450607880949974, "lr": 0.0003244788488185826, "elapsed": 542.0353826140054, "steps_per_second": 45.417352744407026, "loss_extra": 0.024857794092968108} +{"step": 24200, "loss": 0.023771318681538103, "loss_real": 0.01789054152555764, "loss_synth": 0.023541658474132417, "lr": 0.00032079027874883385, "elapsed": 545.8381694019772, "steps_per_second": 45.46862231583171, "loss_extra": 0.025021665347740054} +{"step": 24400, "loss": 0.023636473175138235, "loss_real": 0.017965932972729207, "loss_synth": 0.023397905472666024, "lr": 0.00031709937312261613, "elapsed": 549.6371995449299, "steps_per_second": 45.519483515550434, "loss_extra": 0.02485916543751955} +{"step": 24600, "loss": 0.023689927142113446, "loss_real": 0.018146215449087323, "loss_synth": 0.02347647475078702, "lr": 0.0003134067147767145, "elapsed": 553.6038959329017, "steps_per_second": 45.55547980295104, "loss_extra": 0.02486557655967772} +{"step": 24800, "loss": 0.02365683188661933, "loss_real": 0.01770957197062671, "loss_synth": 0.023449631044641137, "lr": 0.0003097128868246881, "elapsed": 557.502921853913, "steps_per_second": 45.59662341919383, "loss_extra": 0.02489636472426355} +{"step": 25000, "loss": 0.023526974590495228, "loss_real": 0.017868183245882394, "loss_synth": 0.02330430433154106, "lr": 0.0003060184725647909, "elapsed": 561.3122444619657, "steps_per_second": 45.64465575531934, "loss_extra": 0.024731795564293862} +{"step": 25200, "loss": 0.02350288008339703, "loss_real": 0.01788471414707601, "loss_synth": 0.023244222234934567, "lr": 0.0003023240553878617, "elapsed": 565.9591792549472, "steps_per_second": 45.62273558404637, "loss_extra": 0.02473647846840322} +{"step": 25400, "loss": 0.02342412741854787, "loss_real": 0.017621063645929098, "loss_synth": 0.023186034550890328, "lr": 0.0002986302186851996, "elapsed": 569.7606695579598, "steps_per_second": 45.670501885926484, "loss_extra": 0.02466936970129609} +{"step": 25600, "loss": 0.023423658004030585, "loss_real": 0.0180282848328352, "loss_synth": 0.02319293546490371, "lr": 0.00029493754575644036, "elapsed": 573.5646114099072, "steps_per_second": 45.71741955784079, "loss_extra": 0.024590733908116818} +{"step": 25800, "loss": 0.023393318643793463, "loss_real": 0.01754395502153784, "loss_synth": 0.0231626595556736, "lr": 0.0002912466197174462, "elapsed": 577.5540030619595, "steps_per_second": 45.74865507355247, "loss_extra": 0.024639202682301402} +{"step": 26000, "loss": 0.02340478088706732, "loss_real": 0.01763074513990432, "loss_synth": 0.023120878944173456, "lr": 0.00028755802340822527, "elapsed": 581.4118182979291, "steps_per_second": 45.79006010229266, "loss_extra": 0.02469059537164867} +{"step": 26200, "loss": 0.023303329097107053, "loss_real": 0.01745335238054395, "loss_synth": 0.023171951044350863, "lr": 0.0002838723393008943, "elapsed": 585.2271161539247, "steps_per_second": 45.83431521232241, "loss_extra": 0.024450459135696292} +{"step": 26400, "loss": 0.02324269517324865, "loss_real": 0.017315733223222197, "loss_synth": 0.022956266179680825, "lr": 0.00028019014940769974, "elapsed": 589.04062237998, "steps_per_second": 45.87812629546536, "loss_extra": 0.024557593967765568} +{"step": 26600, "loss": 0.023294484056532384, "loss_real": 0.01758052551653236, "loss_synth": 0.02303399922326207, "lr": 0.000276512035189111, "elapsed": 592.9035820309073, "steps_per_second": 45.91744034892607, "loss_extra": 0.024546543853357434} +{"step": 26800, "loss": 0.0231832876522094, "loss_real": 0.017361464062705636, "loss_synth": 0.022949072094634176, "lr": 0.00027283857746200125, "elapsed": 596.7142350740032, "steps_per_second": 45.96035594301633, "loss_extra": 0.024427928514778614} +{"step": 27000, "loss": 0.023232891475781798, "loss_real": 0.017564050764776767, "loss_synth": 0.023036308102309704, "lr": 0.0002691703563079296, "elapsed": 600.6452231269795, "steps_per_second": 45.99328440323424, "loss_extra": 0.024413481932133437} +{"step": 27200, "loss": 0.023159309197217225, "loss_real": 0.01722140418831259, "loss_synth": 0.022962418477982284, "lr": 0.0002655079509815397, "elapsed": 604.5274308630032, "steps_per_second": 46.029574162972175, "loss_extra": 0.024386949772015214} +{"step": 27400, "loss": 0.02305224628187716, "loss_real": 0.017535257847048343, "loss_synth": 0.022835614951327445, "lr": 0.00026185193981908867, "elapsed": 608.3276382529875, "steps_per_second": 46.07174168098021, "loss_extra": 0.024226418640464546} +{"step": 27600, "loss": 0.023109179232269527, "loss_real": 0.017138511277735233, "loss_synth": 0.02290025817230344, "lr": 0.0002582029001471206, "elapsed": 612.1262344309362, "steps_per_second": 46.11349791611729, "loss_extra": 0.024354491643607618} +{"step": 27800, "loss": 0.023143089655786753, "loss_real": 0.01723926024977118, "loss_synth": 0.022989882472902536, "lr": 0.00025456140819130085, "elapsed": 615.9237881459994, "steps_per_second": 46.15480730262998, "loss_extra": 0.02432131215929985} +{"step": 28000, "loss": 0.023001945484429596, "loss_real": 0.017261390686035157, "loss_synth": 0.022678358172997834, "lr": 0.0002509280389854229, "elapsed": 619.7976972589968, "steps_per_second": 46.189780345921044, "loss_extra": 0.024321460919454693} +{"step": 28200, "loss": 0.023059544125571846, "loss_real": 0.017000420312397183, "loss_synth": 0.022804608065634967, "lr": 0.00024730336628060344, "elapsed": 623.7383913549129, "steps_per_second": 46.21924955567562, "loss_extra": 0.024366043685004116} +{"step": 28400, "loss": 0.022942910855636, "loss_real": 0.017048925929702818, "loss_synth": 0.022845944175496697, "lr": 0.00024368796245468133, "elapsed": 627.532535902923, "steps_per_second": 46.25938037454892, "loss_extra": 0.02406342063099146} +{"step": 28600, "loss": 0.02294981044717133, "loss_real": 0.017054123990237712, "loss_synth": 0.022748525347560646, "lr": 0.00024008239842183163, "elapsed": 631.3940704329871, "steps_per_second": 46.29396777528661, "loss_extra": 0.024174492843449115} +{"step": 28800, "loss": 0.02291824701242149, "loss_real": 0.017237004837952555, "loss_synth": 0.022625869642943143, "lr": 0.00023648724354241227, "elapsed": 635.2006127740024, "steps_per_second": 46.332224135306944, "loss_extra": 0.024196379948407412} +{"step": 29000, "loss": 0.022883899183943866, "loss_real": 0.017067798920907082, "loss_synth": 0.022642011512070893, "lr": 0.00023290306553305494, "elapsed": 639.0024670509156, "steps_per_second": 46.37036228694276, "loss_extra": 0.02413518527522683} +{"step": 29200, "loss": 0.022797020748257638, "loss_real": 0.01676602297928184, "loss_synth": 0.022570422571152448, "lr": 0.00022933043037701642, "elapsed": 642.9138952639187, "steps_per_second": 46.39995926990847, "loss_extra": 0.024070416130125522} +{"step": 29400, "loss": 0.022776368390768766, "loss_real": 0.01696603337302804, "loss_synth": 0.02249052044004202, "lr": 0.00022576990223480343, "elapsed": 646.9384563189233, "steps_per_second": 46.42089687119286, "loss_extra": 0.024070427222177386} +{"step": 29600, "loss": 0.022813136810436844, "loss_real": 0.01695744165685028, "loss_synth": 0.022555339904502033, "lr": 0.00022222204335508425, "elapsed": 650.7732452919008, "steps_per_second": 46.455402026990164, "loss_extra": 0.024087143428623677} +{"step": 29800, "loss": 0.022800325779244304, "loss_real": 0.017049004305154086, "loss_synth": 0.022580208918079735, "lr": 0.00021868741398590414, "elapsed": 654.5751038639573, "steps_per_second": 46.49188278875905, "loss_extra": 0.0240186798106879} +{"step": 30000, "loss": 0.022716420833021403, "loss_real": 0.016914589614607393, "loss_synth": 0.02246172960847616, "lr": 0.00021516657228621528, "elapsed": 658.4636739759007, "steps_per_second": 46.521676900632634, "loss_extra": 0.023977977186441422} +{"step": 30200, "loss": 0.022691294811666013, "loss_real": 0.016973160728812216, "loss_synth": 0.022492418857291342, "lr": 0.00021166007423773693, "elapsed": 674.643450857955, "steps_per_second": 45.68555507667076, "loss_extra": 0.02388273193500936} +{"step": 30400, "loss": 0.02262568274512887, "loss_real": 0.016797015038318933, "loss_synth": 0.02233575145713985, "lr": 0.0002081684735571596, "elapsed": 678.4521180849988, "steps_per_second": 45.72466007328624, "loss_extra": 0.023926992462947966} +{"step": 30600, "loss": 0.022703057769685984, "loss_real": 0.01687931258697063, "loss_synth": 0.02249062629416585, "lr": 0.00020469232160870657, "elapsed": 682.2615467819851, "steps_per_second": 45.76326746403061, "loss_extra": 0.02392634049989283} +{"step": 30800, "loss": 0.02273153681308031, "loss_real": 0.017017593714408575, "loss_synth": 0.022441641874611378, "lr": 0.00020123216731706737, "elapsed": 686.1425922279013, "steps_per_second": 45.796560188520445, "loss_extra": 0.024012879049405456} +{"step": 31000, "loss": 0.02257384231314063, "loss_real": 0.016830501337535678, "loss_synth": 0.02232911595143378, "lr": 0.00019778855708071612, "elapsed": 690.0478274909547, "steps_per_second": 45.8278320037606, "loss_extra": 0.023815314723178743} +{"step": 31200, "loss": 0.022612796621397136, "loss_real": 0.016534202019684016, "loss_synth": 0.02234054963104427, "lr": 0.00019436203468562864, "elapsed": 693.9152459709439, "steps_per_second": 45.861293978777454, "loss_extra": 0.02393991653807461} +{"step": 31400, "loss": 0.022462269328534602, "loss_real": 0.016658573113381862, "loss_synth": 0.022201008535921572, "lr": 0.00019095314121941266, "elapsed": 697.7197065179935, "steps_per_second": 45.89860124420848, "loss_extra": 0.02373069169931114} +{"step": 31600, "loss": 0.022500953348353506, "loss_real": 0.01667645120061934, "loss_synth": 0.022268449533730746, "lr": 0.0001875624149858636, "elapsed": 701.6116173350019, "steps_per_second": 45.92965716808026, "loss_extra": 0.023744355179369448} +{"step": 31800, "loss": 0.022471881695091723, "loss_real": 0.016495774099603296, "loss_synth": 0.022236871337518095, "lr": 0.00018419039141996036, "elapsed": 705.4226142489351, "steps_per_second": 45.965739131989544, "loss_extra": 0.023744117552414536} +{"step": 32000, "loss": 0.022431137524545192, "loss_real": 0.0164901377633214, "loss_synth": 0.02217287361621857, "lr": 0.0001808376030033136, "elapsed": 709.2654557609931, "steps_per_second": 45.99931999226113, "loss_extra": 0.023720429092645646} +{"step": 32200, "loss": 0.02243243155069649, "loss_real": 0.016588354310952128, "loss_synth": 0.02223380923271179, "lr": 0.0001775045791800812, "elapsed": 713.280488659977, "steps_per_second": 46.02120323082086, "loss_extra": 0.023645496070384978} +{"step": 32400, "loss": 0.02238320654258132, "loss_real": 0.016507104514166714, "loss_synth": 0.022194665130227803, "lr": 0.00017419184627336242, "elapsed": 717.1133839689428, "steps_per_second": 46.054757193209994, "loss_extra": 0.02359179680235684} +{"step": 32600, "loss": 0.022344163469970226, "loss_real": 0.01650251843035221, "loss_synth": 0.022183207795023918, "lr": 0.00017089992740208575, "elapsed": 720.9191042099847, "steps_per_second": 46.08971820098984, "loss_extra": 0.02351929814554751} +{"step": 32800, "loss": 0.02240306603722274, "loss_real": 0.016597881563939154, "loss_synth": 0.022137759644538166, "lr": 0.00016762934239840198, "elapsed": 724.7395622069016, "steps_per_second": 46.12334906656302, "loss_extra": 0.023675775285810233} +{"step": 33000, "loss": 0.02236032915301621, "loss_real": 0.016353388582356274, "loss_synth": 0.02216835642233491, "lr": 0.000164380607725597, "elapsed": 728.6077220779844, "steps_per_second": 46.15354122185521, "loss_extra": 0.02359506637789309} +{"step": 33200, "loss": 0.022383257569745182, "loss_real": 0.01651797422207892, "loss_synth": 0.022078680293634533, "lr": 0.00016115423639653619, "elapsed": 732.4078504859935, "steps_per_second": 46.18777946846302, "loss_extra": 0.023705512341111897} +{"step": 33400, "loss": 0.02225934002548456, "loss_real": 0.01633551487699151, "loss_synth": 0.02200534272007644, "lr": 0.0001579507378926539, "elapsed": 736.4015005519614, "steps_per_second": 46.20928223858658, "loss_extra": 0.023541399501264094} +{"step": 33600, "loss": 0.0223047888930887, "loss_real": 0.016634530778974296, "loss_synth": 0.022052844939753413, "lr": 0.00015477061808349973, "elapsed": 740.2547589179594, "steps_per_second": 46.239480605621694, "loss_extra": 0.023540751719847323} +{"step": 33800, "loss": 0.022288591088727116, "loss_real": 0.01630918265786022, "loss_synth": 0.022053401563316585, "lr": 0.0001516143791468568, "elapsed": 744.0785188649315, "steps_per_second": 46.271228879032726, "loss_extra": 0.02356157872825861} +{"step": 34000, "loss": 0.022305581774562596, "loss_real": 0.016324055874720217, "loss_synth": 0.022085895258933307, "lr": 0.00014848251948944142, "elapsed": 747.8776532949414, "steps_per_second": 46.30419935044812, "loss_extra": 0.023563500018790363} +{"step": 34200, "loss": 0.02224899420514703, "loss_real": 0.016130425380542875, "loss_synth": 0.021965410597622394, "lr": 0.00014537553366819925, "elapsed": 751.6912092629354, "steps_per_second": 46.335925020521586, "loss_extra": 0.023594347480684518} +{"step": 34400, "loss": 0.02218326600268483, "loss_real": 0.016279262150637807, "loss_synth": 0.021917119063436984, "lr": 0.0001422939123122089, "elapsed": 755.5903743029339, "steps_per_second": 46.361974756597974, "loss_extra": 0.023473980333656073} +{"step": 34600, "loss": 0.022161659486591816, "loss_real": 0.01607295823749155, "loss_synth": 0.021915407804772257, "lr": 0.00013923814204520548, "elapsed": 759.5688936999068, "steps_per_second": 46.382817487572474, "loss_extra": 0.02346464936621487} +{"step": 34800, "loss": 0.022071340745314957, "loss_real": 0.016151345050893724, "loss_synth": 0.0218886330537498, "lr": 0.00013620870540873793, "elapsed": 763.376743592904, "steps_per_second": 46.41400183130739, "loss_extra": 0.023281747428700327} +{"step": 35000, "loss": 0.02207944108173251, "loss_real": 0.01599323481786996, "loss_synth": 0.02190952538512647, "lr": 0.00013320608078596944, "elapsed": 767.2320070449496, "steps_per_second": 46.441949007493875, "loss_extra": 0.023305985489860178} +{"step": 35200, "loss": 0.022048943350091575, "loss_real": 0.01601466057356447, "loss_synth": 0.021857433496043088, "lr": 0.00013023074232613552, "elapsed": 771.8615575269796, "steps_per_second": 46.42215978496475, "loss_extra": 0.023287969715893267} +{"step": 35400, "loss": 0.02209464834071696, "loss_real": 0.016388005884364246, "loss_synth": 0.021861650496721268, "lr": 0.0001272831598696703, "elapsed": 775.667083823937, "steps_per_second": 46.45278615543242, "loss_extra": 0.023318066177889705} +{"step": 35600, "loss": 0.022037637354806065, "loss_real": 0.016055761706084012, "loss_synth": 0.021805242942646144, "lr": 0.00012436379887401295, "elapsed": 779.6679809489287, "steps_per_second": 46.47125348244276, "loss_extra": 0.023308270238339902} +{"step": 35800, "loss": 0.022061342084780337, "loss_real": 0.01597564233932644, "loss_synth": 0.021838649874553084, "lr": 0.00012147312034010696, "elapsed": 783.5169964919332, "steps_per_second": 46.49869996766309, "loss_extra": 0.023340351255610584} +{"step": 36000, "loss": 0.02196911337785423, "loss_real": 0.01594383431598544, "loss_synth": 0.021725645968690515, "lr": 0.00011861158073960271, "elapsed": 787.3340057119494, "steps_per_second": 46.527797961953915, "loss_extra": 0.023258312875404953} +{"step": 36200, "loss": 0.021948021491989492, "loss_real": 0.015745409377850593, "loss_synth": 0.021651066159829497, "lr": 0.00011577963194277514, "elapsed": 791.1321507679531, "steps_per_second": 46.557739835606775, "loss_extra": 0.02332129024900496} +{"step": 36400, "loss": 0.02198921191506088, "loss_real": 0.015773790255188942, "loss_synth": 0.02169065930880606, "lr": 0.0001129777211471684, "elapsed": 795.0708169809077, "steps_per_second": 46.57901339527113, "loss_extra": 0.02336629663594067} +{"step": 36600, "loss": 0.021994683127850294, "loss_real": 0.01599171177018434, "loss_synth": 0.021779640559107066, "lr": 0.00011020629080697766, "elapsed": 798.875858232961, "steps_per_second": 46.6080032166777, "loss_extra": 0.023251702841371298} +{"step": 36800, "loss": 0.022003804296255113, "loss_real": 0.016058698357082905, "loss_synth": 0.021742037143558265, "lr": 0.00010746577856318116, "elapsed": 802.8516080509871, "steps_per_second": 46.626626321926224, "loss_extra": 0.02329729779623449} +{"step": 37000, "loss": 0.021919479398056864, "loss_real": 0.015985445198602975, "loss_synth": 0.021627546837553382, "lr": 0.00010475661717443124, "elapsed": 806.733316181926, "steps_per_second": 46.65059343685668, "loss_extra": 0.023241087067872285} +{"step": 37200, "loss": 0.02197118792682886, "loss_real": 0.01571685465052724, "loss_synth": 0.021693367790430785, "lr": 0.00010207923444871681, "elapsed": 810.5490536099533, "steps_per_second": 46.67819074453902, "loss_extra": 0.023334387810900806} +{"step": 37400, "loss": 0.021896106209605932, "loss_real": 0.015980010419152677, "loss_synth": 0.021641426859423517, "lr": 9.94340531758075e-05, "elapsed": 814.3550605329219, "steps_per_second": 46.70609264157338, "loss_extra": 0.0231775020994246} +{"step": 37600, "loss": 0.021848205979913472, "loss_real": 0.015956856133416294, "loss_synth": 0.021615769919008015, "lr": 9.682149106049004e-05, "elapsed": 818.1629330879077, "steps_per_second": 46.733622164207326, "loss_extra": 0.023103153528645635} +{"step": 37800, "loss": 0.021857185205444694, "loss_real": 0.01585617824923247, "loss_synth": 0.021628623371943833, "lr": 9.424196065660837e-05, "elapsed": 822.0971345579019, "steps_per_second": 46.75358582071754, "loss_extra": 0.023127325512468815} +{"step": 38000, "loss": 0.02183324281126261, "loss_real": 0.015741298729553817, "loss_synth": 0.0216013940051198, "lr": 9.169586930191606e-05, "elapsed": 826.1667584759416, "steps_per_second": 46.7655608893515, "loss_extra": 0.023122454630210995} +{"step": 38200, "loss": 0.02182892504148185, "loss_real": 0.01578235357068479, "loss_synth": 0.02153805809095502, "lr": 8.91836190537533e-05, "elapsed": 830.0464436669135, "steps_per_second": 46.78829895580701, "loss_extra": 0.023169022370129824} +{"step": 38400, "loss": 0.0218340924102813, "loss_real": 0.015863816337659955, "loss_synth": 0.021656390856951476, "lr": 8.670560662555727e-05, "elapsed": 833.9288470249157, "steps_per_second": 46.810666789621166, "loss_extra": 0.02304824917577207} +{"step": 38600, "loss": 0.021730047399178148, "loss_real": 0.015745037239976226, "loss_synth": 0.0214783245511353, "lr": 8.426222332421624e-05, "elapsed": 837.8067217429634, "steps_per_second": 46.833081317851416, "loss_extra": 0.023020471474155785} +{"step": 38800, "loss": 0.021772246984764935, "loss_real": 0.015768854208290578, "loss_synth": 0.021556177958846092, "lr": 8.185385498827815e-05, "elapsed": 841.757569483947, "steps_per_second": 46.85115719329987, "loss_extra": 0.023030362259596586} +{"step": 39000, "loss": 0.02169058447703719, "loss_real": 0.015494903386570513, "loss_synth": 0.02149194263853133, "lr": 7.948088192702195e-05, "elapsed": 845.9113680559676, "steps_per_second": 46.85763279258069, "loss_extra": 0.02296475230716169} +{"step": 39200, "loss": 0.02174397071823478, "loss_real": 0.015634889854118227, "loss_synth": 0.02152112264186144, "lr": 7.714367886040248e-05, "elapsed": 849.9127549469704, "steps_per_second": 46.8725847550853, "loss_extra": 0.023027196945622563} +{"step": 39400, "loss": 0.021714478265494108, "loss_real": 0.015609937026165427, "loss_synth": 0.02146923227235675, "lr": 7.48426148598775e-05, "elapsed": 853.725459053996, "steps_per_second": 46.89792480286301, "loss_extra": 0.023019218975678088} +{"step": 39600, "loss": 0.021761108711361884, "loss_real": 0.015727074854075908, "loss_synth": 0.021497153425589204, "lr": 7.25780532901276e-05, "elapsed": 857.5216701349709, "steps_per_second": 46.9239528827294, "loss_extra": 0.02307223011739552} +{"step": 39800, "loss": 0.021680161906406283, "loss_real": 0.015522136418148876, "loss_synth": 0.021448360765352847, "lr": 7.035035175167622e-05, "elapsed": 861.3208365319297, "steps_per_second": 46.949584169354836, "loss_extra": 0.022980806417763233} +{"step": 40000, "loss": 0.02170702432282269, "loss_real": 0.015636910651810467, "loss_synth": 0.02151039202697575, "lr": 6.81598620244206e-05, "elapsed": 865.2321386389667, "steps_per_second": 46.968801428905635, "loss_extra": 0.022957376316189767} +{"step": 40200, "loss": 0.02163575201295316, "loss_real": 0.015445555290207268, "loss_synth": 0.021378797581419348, "lr": 6.600693001208181e-05, "elapsed": 881.3502797259716, "steps_per_second": 46.326852140716646, "loss_extra": 0.022967032259330153} +{"step": 40400, "loss": 0.02173660382628441, "loss_real": 0.0154707965021953, "loss_synth": 0.02150638209655881, "lr": 6.38918956875819e-05, "elapsed": 885.1528207529336, "steps_per_second": 46.3542059829011, "loss_extra": 0.023054400635883213} +{"step": 40600, "loss": 0.021607311218976976, "loss_real": 0.015669114710763096, "loss_synth": 0.02137667347677052, "lr": 6.181509303935915e-05, "elapsed": 889.0570152389118, "steps_per_second": 46.37593658001205, "loss_extra": 0.02286860689520836} +{"step": 40800, "loss": 0.02160109962336719, "loss_real": 0.015576146868988871, "loss_synth": 0.021281287968158723, "lr": 5.977685001862671e-05, "elapsed": 892.9656630159589, "steps_per_second": 46.39723927557246, "loss_extra": 0.022966263378039004} +{"step": 41000, "loss": 0.021686366684734823, "loss_real": 0.01583578343503177, "loss_synth": 0.02142708453349769, "lr": 5.7777488487585654e-05, "elapsed": 896.8101905978983, "steps_per_second": 46.4217234093063, "loss_extra": 0.02296096452511847} +{"step": 41200, "loss": 0.021630537621676924, "loss_real": 0.015239539961330593, "loss_synth": 0.021430860524997115, "lr": 5.581732416859908e-05, "elapsed": 900.6148341048975, "steps_per_second": 46.44808369740593, "loss_extra": 0.022939668158069252} +{"step": 41400, "loss": 0.02155919736251235, "loss_real": 0.015103531442582608, "loss_synth": 0.021330963633954526, "lr": 5.3896666594335835e-05, "elapsed": 904.5014462929685, "steps_per_second": 46.469942873620134, "loss_extra": 0.022907998617738484} +{"step": 41600, "loss": 0.02159856794402003, "loss_real": 0.015327799231745303, "loss_synth": 0.021389071652665733, "lr": 5.20158190588919e-05, "elapsed": 908.321655940963, "steps_per_second": 46.49506259804095, "loss_extra": 0.022896589031443} +{"step": 41800, "loss": 0.021615014476701618, "loss_real": 0.015607447209767998, "loss_synth": 0.021483395798131823, "lr": 5.017507856989665e-05, "elapsed": 912.1247005399782, "steps_per_second": 46.52085741520418, "loss_extra": 0.022789762010797857} +{"step": 42000, "loss": 0.021532560894265772, "loss_real": 0.015518703083507716, "loss_synth": 0.021323299081996084, "lr": 4.837473580161169e-05, "elapsed": 916.1539730569348, "steps_per_second": 46.534767752867474, "loss_extra": 0.02278571553528309} +{"step": 42200, "loss": 0.021544430535286666, "loss_real": 0.015449792514555156, "loss_synth": 0.02132054232992232, "lr": 4.6615075049030575e-05, "elapsed": 919.9669736769283, "steps_per_second": 46.55966162187786, "loss_extra": 0.02282618367113173} +{"step": 42400, "loss": 0.021522242976352572, "loss_real": 0.015387132354080678, "loss_synth": 0.02129462453536689, "lr": 4.489637418298455e-05, "elapsed": 923.8065506309504, "steps_per_second": 46.582986733562755, "loss_extra": 0.022814741656184197} +{"step": 42600, "loss": 0.02154427654109895, "loss_real": 0.015563430823385715, "loss_synth": 0.021311199804767967, "lr": 4.321890460626433e-05, "elapsed": 927.6184056960046, "steps_per_second": 46.607529408524925, "loss_extra": 0.022815410355105994} +{"step": 42800, "loss": 0.02147884384728968, "loss_real": 0.015522071355953813, "loss_synth": 0.02125463239848614, "lr": 4.158293121076186e-05, "elapsed": 931.5546575719491, "steps_per_second": 46.62554891511179, "loss_extra": 0.02273696744814515} +{"step": 43000, "loss": 0.021557299252599478, "loss_real": 0.015327840852551162, "loss_synth": 0.02138508154079318, "lr": 3.99887123356411e-05, "elapsed": 935.5783807869302, "steps_per_second": 46.63898928621168, "loss_extra": 0.02281102289445698} +{"step": 43200, "loss": 0.021426466973498464, "loss_real": 0.015285408291965723, "loss_synth": 0.02115912612527609, "lr": 3.843649972654328e-05, "elapsed": 939.5738722769311, "steps_per_second": 46.65373524889134, "loss_extra": 0.02275955314747989} +{"step": 43400, "loss": 0.02151825270615518, "loss_real": 0.01541561544407159, "loss_synth": 0.02126858535222709, "lr": 3.69265384958331e-05, "elapsed": 943.4981604939094, "steps_per_second": 46.671927929218484, "loss_extra": 0.022827065195888282} +{"step": 43600, "loss": 0.021537283370271325, "loss_real": 0.015395925138145685, "loss_synth": 0.02130706274881959, "lr": 3.545906708389291e-05, "elapsed": 947.4007037609117, "steps_per_second": 46.69105495425634, "loss_extra": 0.022833458883687853} +{"step": 43800, "loss": 0.021450059041380882, "loss_real": 0.015253889723680913, "loss_synth": 0.021293681841343642, "lr": 3.403431722147019e-05, "elapsed": 951.5151738239219, "steps_per_second": 46.69946837823344, "loss_extra": 0.02268222624436021} +{"step": 44000, "loss": 0.021481197578832507, "loss_real": 0.015476532825268806, "loss_synth": 0.02127004402689636, "lr": 3.265251389308442e-05, "elapsed": 955.7205489239423, "steps_per_second": 46.70330148154688, "loss_extra": 0.02273463860154152} +{"step": 44200, "loss": 0.021494152201339604, "loss_real": 0.01525487300939858, "loss_synth": 0.021280701300129296, "lr": 3.1313875301499545e-05, "elapsed": 959.6905887039611, "steps_per_second": 46.71871869875675, "loss_extra": 0.022790640285238625} +{"step": 44400, "loss": 0.021499041160568597, "loss_real": 0.015530293551273644, "loss_synth": 0.021253075180575252, "lr": 3.0018612833267117e-05, "elapsed": 963.6331851329887, "steps_per_second": 46.735357050578365, "loss_extra": 0.0227809077501297} +{"step": 44600, "loss": 0.02149309538304806, "loss_real": 0.015491985306143761, "loss_synth": 0.021302897166460753, "lr": 2.8766931025346027e-05, "elapsed": 967.4755020400044, "steps_per_second": 46.756772859649516, "loss_extra": 0.02272505280561745} +{"step": 44800, "loss": 0.02145277040079236, "loss_real": 0.015104714832268655, "loss_synth": 0.021281249737367034, "lr": 2.755902753280375e-05, "elapsed": 971.45934209798, "steps_per_second": 46.77110535699259, "loss_extra": 0.022726403726264836} +{"step": 45000, "loss": 0.02141444974578917, "loss_real": 0.01519812765531242, "loss_synth": 0.021219056090340017, "lr": 2.639509309760422e-05, "elapsed": 975.4171927989228, "steps_per_second": 46.786583369757516, "loss_extra": 0.022688968852162362} +{"step": 45200, "loss": 0.021477118134498596, "loss_real": 0.015238306880928577, "loss_synth": 0.021268505761399867, "lr": 2.5275311518487436e-05, "elapsed": 980.0454062499339, "steps_per_second": 46.76947081459945, "loss_extra": 0.022768707042559982} +{"step": 45400, "loss": 0.021414649402722717, "loss_real": 0.015513569666072726, "loss_synth": 0.021180978007614613, "lr": 2.4199859621945708e-05, "elapsed": 984.0388722799253, "steps_per_second": 46.78310150764472, "loss_extra": 0.022672517523169518} +{"step": 45600, "loss": 0.021390819558873772, "loss_real": 0.015069368118420244, "loss_synth": 0.02120526530779898, "lr": 2.316890723430054e-05, "elapsed": 988.1735141689423, "steps_per_second": 46.78984152367449, "loss_extra": 0.022673805104568602} +{"step": 45800, "loss": 0.02142046557739377, "loss_real": 0.015096409195102752, "loss_synth": 0.021270355870947243, "lr": 2.218261715488513e-05, "elapsed": 992.5528567779111, "steps_per_second": 46.78482721386211, "loss_extra": 0.022668609237298368} +{"step": 46000, "loss": 0.021440073754638432, "loss_real": 0.015111852446570992, "loss_synth": 0.021241393079981206, "lr": 2.1241145130336496e-05, "elapsed": 996.3624754399061, "steps_per_second": 46.806976754141594, "loss_extra": 0.02273730638436973} +{"step": 46200, "loss": 0.021425330080091953, "loss_real": 0.015231124716810882, "loss_synth": 0.021208546655252576, "lr": 2.0344639830001105e-05, "elapsed": 1000.2735027509043, "steps_per_second": 46.82414219392801, "loss_extra": 0.022717306138947607} +{"step": 46400, "loss": 0.021353082126006485, "loss_real": 0.015227976692840458, "loss_synth": 0.021098486883565783, "lr": 1.949324282245851e-05, "elapsed": 1004.0694698980078, "steps_per_second": 46.846613513580415, "loss_extra": 0.022670704927295445} +{"step": 46600, "loss": 0.021379630323499443, "loss_real": 0.01524373731110245, "loss_synth": 0.021179713970050217, "lr": 1.8687088553165976e-05, "elapsed": 1008.1146951309638, "steps_per_second": 46.85716632421174, "loss_extra": 0.022644680170342327} +{"step": 46800, "loss": 0.021503587244078515, "loss_real": 0.015149700529873371, "loss_synth": 0.02122193486429751, "lr": 1.7926304323227836e-05, "elapsed": 1012.0578319799388, "steps_per_second": 46.872425669714694, "loss_extra": 0.02288789859972894} +{"step": 47000, "loss": 0.02139280750416219, "loss_real": 0.015161974723450839, "loss_synth": 0.02119097076356411, "lr": 1.721101026929328e-05, "elapsed": 1015.874249977991, "steps_per_second": 46.89349307357524, "loss_extra": 0.022676263712346555} +{"step": 47200, "loss": 0.021307507548481226, "loss_real": 0.015064829434268177, "loss_synth": 0.021117370119318368, "lr": 1.6541319344585365e-05, "elapsed": 1019.705478276941, "steps_per_second": 46.91371002733802, "loss_extra": 0.022581371553242205} +{"step": 47400, "loss": 0.021411571744829418, "loss_real": 0.015429252139292658, "loss_synth": 0.02125898309983313, "lr": 1.5917337301064426e-05, "elapsed": 1023.5100473139901, "steps_per_second": 46.93501251960589, "loss_extra": 0.02260281483642757} +{"step": 47600, "loss": 0.021391921835020186, "loss_real": 0.01518694031983614, "loss_synth": 0.021189673952758312, "lr": 1.533916267272854e-05, "elapsed": 1027.4354364220053, "steps_per_second": 46.95055928451278, "loss_extra": 0.022671296196058392} +{"step": 47800, "loss": 0.02130934632383287, "loss_real": 0.0153369752317667, "loss_synth": 0.02107844201847911, "lr": 1.480688676005397e-05, "elapsed": 1031.3572817170061, "steps_per_second": 46.96614966146894, "loss_extra": 0.022576844356954097} +{"step": 48000, "loss": 0.02144556469283998, "loss_real": 0.015434110742062331, "loss_synth": 0.021220160899683833, "lr": 1.432059361557764e-05, "elapsed": 1035.1970052329125, "steps_per_second": 46.98539696073615, "loss_extra": 0.02271437511779368} +{"step": 48200, "loss": 0.021396428160369397, "loss_real": 0.015352047076448798, "loss_synth": 0.021252112556248905, "lr": 1.3880360030624374e-05, "elapsed": 1039.05993313191, "steps_per_second": 47.00343657718782, "loss_extra": 0.022590214582160116} +{"step": 48400, "loss": 0.02136217100545764, "loss_real": 0.015371512938290834, "loss_synth": 0.021103104911744594, "lr": 1.3486255523180529e-05, "elapsed": 1042.8885333149228, "steps_per_second": 47.022908955305375, "loss_extra": 0.022660888358950616} +{"step": 48600, "loss": 0.021355287758633493, "loss_real": 0.01530672586057335, "loss_synth": 0.021180960219353437, "lr": 1.313834232691649e-05, "elapsed": 1046.695509972982, "steps_per_second": 47.04322162917246, "loss_extra": 0.02257968520745635} +{"step": 48800, "loss": 0.021365657560527326, "loss_real": 0.01541316207498312, "loss_synth": 0.021148426411673426, "lr": 1.2836675381359077e-05, "elapsed": 1050.5737513499334, "steps_per_second": 47.06015076071779, "loss_extra": 0.022616087459027767} +{"step": 49000, "loss": 0.02136064101010561, "loss_real": 0.015317044067196549, "loss_synth": 0.02106708603911102, "lr": 1.2581302323216026e-05, "elapsed": 1054.5526228449307, "steps_per_second": 47.072402782452514, "loss_extra": 0.02270289806649089} +{"step": 49200, "loss": 0.02136932427994907, "loss_real": 0.015240695672109722, "loss_synth": 0.021161734396591782, "lr": 1.2372263478853567e-05, "elapsed": 1058.3422302049585, "steps_per_second": 47.09309125418612, "loss_extra": 0.022640753341838717} +{"step": 49400, "loss": 0.021332339588552712, "loss_real": 0.015213992968201638, "loss_synth": 0.021060212217271328, "lr": 1.2209591857928498e-05, "elapsed": 1062.1653371589491, "steps_per_second": 47.11212501652859, "loss_extra": 0.022666246416047215} +{"step": 49600, "loss": 0.021382332341745497, "loss_real": 0.015072147399187087, "loss_synth": 0.021177209382876754, "lr": 1.2093313148175555e-05, "elapsed": 1066.0161344489316, "steps_per_second": 47.129780390255185, "loss_extra": 0.022682846505194903} +{"step": 49800, "loss": 0.02140770402736962, "loss_real": 0.015332858404144644, "loss_synth": 0.02120447102934122, "lr": 1.2023445711350887e-05, "elapsed": 1069.8467445869464, "steps_per_second": 47.148208129641816, "loss_extra": 0.022665450647473336} +{"step": 50000, "loss": 0.02133926990441978, "loss_real": 0.01525807783473283, "loss_synth": 0.021080073677003385, "lr": 1.2000000580332747e-05, "elapsed": 1073.6812933399342, "steps_per_second": 47.166327462074534, "loss_extra": 0.022653845436871052} diff --git a/shared/package-files/4b/4b2b5135192e1cf9254c33374532efcad4681500a4800a9ae1aafa3471202ae8/big_pools.py b/shared/package-files/4b/4b2b5135192e1cf9254c33374532efcad4681500a4800a9ae1aafa3471202ae8/big_pools.py new file mode 100644 index 0000000000000000000000000000000000000000..d3439d89e4e04da712d1c3504f6ca46f6b2981d6 --- /dev/null +++ b/shared/package-files/4b/4b2b5135192e1cf9254c33374532efcad4681500a4800a9ae1aafa3471202ae8/big_pools.py @@ -0,0 +1,112 @@ +"""Largest validation pools: rank of the labelled candidate under forward member sets / distances. + +big_pools.py INVERSE.pkl:KEY[+...] NAME:MEMBER=ANCHOR.pkl[,...]:VARIANT:LAMBDA [...] [--top 25] [--reference NAME] + +Each configuration is evaluated in the released fused rule; prints, for the largest pools, the +pool size, share of validation queries, the composition and the fused rank of the labelled +candidate under every configuration (0 = hit). Validation labels: error analysis only. +""" +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from fuselab import Lab +from fusion_rule import MEMBERS + + +def main(): + args = [a for a in sys.argv[1:] if not a.startswith('--')] + top = int(sys.argv[sys.argv.index('--top') + 1]) if '--top' in sys.argv else 25 + if '--top' in sys.argv: + args.remove(str(top)) + reference = sys.argv[sys.argv.index('--reference') + 1] if '--reference' in sys.argv else 'released' + if '--reference' in sys.argv: + args.remove(reference) + inverse, configs = args[0], args[1:] + ref = Lab('/workspace/research/validation-input', 'noprec_pp0.75', MEMBERS).setup() + pools = len(ref.members) + parts = [] + for item in inverse.split('+'): + path, key = item.rsplit(':', 1) + loaded = pickle.load(open(path, 'rb'))[key] + parts.append([ref.matrix(loaded, s) for s in range(pools)]) + inv = [np.mean([part[s] for part in parts], axis=0) for s in range(pools)] + dom = [ref.domain[m] for m in ref.members] + orbitrap = ref.instrument == 'Orbitrap' + + def weight(s): + return np.where(dom[s], 0.75, max(0.05, 0.5 / len(dom[s]))) + + def view(members, variant): + if '/' in variant: + a, b = variant.split('/') + la = Lab('/workspace/research/validation-input', a, members) + lb = Lab('/workspace/research/validation-input', b, members) + return [np.where(orbitrap[ref.members[s]][:, None], ref.matrix(la.sim, s), ref.matrix(lb.sim, s)) for s in range(pools)] + lab = Lab('/workspace/research/validation-input', variant, members) + return [ref.matrix(lab.sim, s) for s in range(pools)] + + first = np.array([m[0] for m in ref.members]) + size = np.array([len(m) for m in ref.members]) + ranks, names = [], [] + released = [ref.matrix(ref.sim, s) for s in range(pools)] + names.append('released') + ranks.append(ref.pool_rule(lambda s: released[s].mean(0) + (weight(s)[:, None] * inv[s]).mean(0))[first]) + names.append('rel-fwd') + ranks.append(ref.pool_rule(lambda s: released[s].mean(0))[first]) + names.append('inv') + ranks.append(ref.pool_rule(lambda s: inv[s].mean(0))[first]) + for config in configs: + name, members, variant, lam = config.split(':') + members, lam = members.split(','), float(lam) + base = view(members, 'noprec_pp0.75') + sim = base if lam == 0 else [(1 - lam) * base[s] + lam * a for s, a in enumerate(view(members, variant))] + names.append(name) + ranks.append(ref.pool_rule(lambda s: sim[s].mean(0) + (weight(s)[:, None] * inv[s]).mean(0))[first]) + names.append(name + '-fwd') + ranks.append(ref.pool_rule(lambda s: sim[s].mean(0))[first]) + ranks = np.array(ranks) + order = np.argsort(-size) + total = size.sum() + print('cumulative share of queries in the largest pools:', + ' '.join(f'top{k}={size[order[:k]].sum() / total:.3f}' for k in (1, 2, 5, 10, 20, 50, 100))) + print(f'{"size":>5} {"share":>6} {"dom":>5} {"orbi":>5} {"Na":>5} | ' + ' '.join(f'{n[:11]:>11}' for n in names)) + for s in order[:top]: + m = ref.members[s] + print(f'{size[s]:5d} {size[s] / total:6.3f} {dom[s].mean():5.2f} {orbitrap[m].mean():5.2f} ' + f'{np.mean(ref.adduct[m] == "[M+Na]+"):5.2f} | ' + ' '.join(f'{int(r):11d}' for r in ranks[:, s])) + for k in (5, 10, 20, 50): + big = np.zeros(pools, bool) + big[order[:k]] = True + print(f'query-weighted Hit@1 without the {k} largest pools:', + ' '.join(f'{n}={np.sum(size[~big] * (r[~big] == 0)) / size[~big].sum():.4f}' for n, r in zip(names, ranks))) + print('query-weighted Hit@1 (all pools):', ' '.join(f'{n}={np.sum(size * (r == 0)) / total:.4f}' for n, r in zip(names, ranks))) + print('pool-macro Hit@1:', ' '.join(f'{n}={np.mean(r == 0):.4f}' for n, r in zip(names, ranks))) + # paired pool bootstrap against the released configuration (molecule groups = pools) + rng = np.random.default_rng(0) + draws = rng.integers(0, pools, size=(2000, pools)) + small = np.ones(pools, bool) + small[order[:20]] = False + capped = np.minimum(size, 30) + hit0 = ranks[names.index(reference)] == 0 + for n, r in zip(names, ranks): + if n == reference: + continue + hit = r == 0 + delta = hit.astype(float) - hit0 + macro = delta[draws].mean(1) + trimmed = (delta * size * small)[draws].sum(1) / (size * small)[draws].sum(1) + cap = (delta * capped)[draws].sum(1) / capped[draws].sum(1) + weighted = (delta * size)[draws].sum(1) / size[draws].sum(1) + print(f'{n:>10} vs {reference}: pools +{int((hit & ~hit0).sum())} -{int((hit0 & ~hit).sum())}' + f' | macro {delta.mean():+.4f} [{np.percentile(macro, 2.5):+.4f},{np.percentile(macro, 97.5):+.4f}]' + f' | without top 20 {np.sum(delta * size * small) / np.sum(size * small):+.4f} [{np.percentile(trimmed, 2.5):+.4f},{np.percentile(trimmed, 97.5):+.4f}]' + f' | pool weight min(n,30) {np.sum(delta * capped) / capped.sum():+.4f} [{np.percentile(cap, 2.5):+.4f},{np.percentile(cap, 97.5):+.4f}]' + f' | query-weighted {np.sum(delta * size) / total:+.4f} [{np.percentile(weighted, 2.5):+.4f},{np.percentile(weighted, 97.5):+.4f}]') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/4b/4b9e15d8a4c8e11f9f504bc34bb6440b2a6755c2341440cbd58faf7d7aaa0776/validation.jsonl b/shared/package-files/4b/4b9e15d8a4c8e11f9f504bc34bb6440b2a6755c2341440cbd58faf7d7aaa0776/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..fec113bfeb4733ca1a34b7d7e13bf76285436579 --- /dev/null +++ b/shared/package-files/4b/4b9e15d8a4c8e11f9f504bc34bb6440b2a6755c2341440cbd58faf7d7aaa0776/validation.jsonl @@ -0,0 +1,10 @@ +{"step": 5000, "elapsed": 138.89323110098485, "val_loss": 0.03692166181518486, "val_cos": 0.6375729971547043, "val_loss_ema": 0.0346049552680694, "val_cos_ema": 0.6586101810196742} +{"step": 10000, "elapsed": 245.17811427800916, "val_loss": 0.031209282539073558, "val_cos": 0.7000256744106748, "val_loss_ema": 0.0305125258943119, "val_cos_ema": 0.7049022417158307, "ind_cos": 0.4450048895980236, "agg_cos": 0.4794894230274332, "ind_nll": 0.3119048844510783, "agg_nll": 0.2986257656081116, "retrieval_seconds": 11.342060461058281} +{"step": 15000, "elapsed": 358.109123926959, "val_loss": 0.030734230703956353, "val_cos": 0.7086718513763254, "val_loss_ema": 0.028656229687409527, "val_cos_ema": 0.727728252949843} +{"step": 20000, "elapsed": 460.49017273203935, "val_loss": 0.029526356852142336, "val_cos": 0.7227197826058984, "val_loss_ema": 0.02789279624188552, "val_cos_ema": 0.7393655389696138, "ind_cos": 0.5160327345720315, "agg_cos": 0.5467599979412219, "ind_nll": 0.4046013690874466, "agg_nll": 0.39646919553245147, "retrieval_seconds": 11.316811108961701} +{"step": 25000, "elapsed": 573.9212612230331, "val_loss": 0.029543655225084363, "val_cos": 0.7276312450943178, "val_loss_ema": 0.027812078355104644, "val_cos_ema": 0.7436318363898682} +{"step": 30000, "elapsed": 675.9432603720343, "val_loss": 0.028240262563195843, "val_cos": 0.7428367740796619, "val_loss_ema": 0.027439836233776063, "val_cos_ema": 0.7488680992733157, "ind_cos": 0.5341499819856915, "agg_cos": 0.5713109269648463, "ind_nll": 0.435688918626795, "agg_nll": 0.4260126614854084, "retrieval_seconds": 11.328252990962937} +{"step": 35000, "elapsed": 789.3583169019548, "val_loss": 0.028097089979209157, "val_cos": 0.747005611276153, "val_loss_ema": 0.027402305377235904, "val_cos_ema": 0.7520112417528244} +{"step": 40000, "elapsed": 891.1495158870239, "val_loss": 0.02748260623704719, "val_cos": 0.7523145169591847, "val_loss_ema": 0.02749774997064633, "val_cos_ema": 0.7526626520158333, "ind_cos": 0.5406351330485357, "agg_cos": 0.5723917854753204, "ind_nll": 0.45112975449070974, "agg_nll": 0.4387256163466982, "retrieval_seconds": 11.335351880989037} +{"step": 45000, "elapsed": 1005.1417226810008, "val_loss": 0.02759789613082409, "val_cos": 0.7524195040878005, "val_loss_ema": 0.02749095973490417, "val_cos_ema": 0.7531127458470586} +{"step": 50000, "elapsed": 1106.9181813240284, "val_loss": 0.027409266036428914, "val_cos": 0.7535315508751416, "val_loss_ema": 0.027461212989115618, "val_cos_ema": 0.7535381856093019, "ind_cos": 0.5401719079726183, "agg_cos": 0.5767666889700962, "ind_nll": 0.4513356323022286, "agg_nll": 0.44006382212157086, "retrieval_seconds": 11.338363650022075} diff --git a/shared/package-files/4b/4baaca3b70f6137916859e29026ae2b95914ca65ebda9a396cccec056138b63e/library_oracle.py b/shared/package-files/4b/4baaca3b70f6137916859e29026ae2b95914ca65ebda9a396cccec056138b63e/library_oracle.py new file mode 100644 index 0000000000000000000000000000000000000000..54f1bb797978bc92232f7207d6a5fba57037c304 --- /dev/null +++ b/shared/package-files/4b/4baaca3b70f6137916859e29026ae2b95914ca65ebda9a396cccec056138b63e/library_oracle.py @@ -0,0 +1,69 @@ +"""How related are the library neighbours of a validation spectrum to its label? (lab, E71; ANALYSIS ONLY) + +library_oracle.py [--out evals/library/oracle-neigh.npz] + +For every validation query: the Tanimoto between its LABEL and (i) the train-fold library molecules the +released spectral similarity returns (``library.neighbours``), (ii) the library molecules with the most +similar structure (what a perfect spectrum-to-structure-similarity predictor would return). Labels are +read: the numbers bound what a better neighbour similarity for the library branch could give and can +never enter a package. ``--out`` saves both neighbour lists (molecule rows, similarities) per query. +""" +import argparse +import sys +from pathlib import Path + +import numpy as np +import torch + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import library as libmod +import netprop +import scorelab + +ROOT = netprop.ROOT + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--out', default=None) + parser.add_argument('--top', type=int, default=32) + args = parser.parse_args() + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + lib = torch.load(ROOT / 'library/train-library.pt', weights_only=False) + fps = np.unpackbits(lib['fingerprints'].numpy(), axis=1).astype(np.float32) # [molecules, bits] + store = np.load(ROOT / 'inv/pools-validation-input.npz') + sslot = {pid: n for n, pid in enumerate(store['pool_id'])} + starts, packed = store['pool_cand_start'], store['cand_fps'] + pool_ids = sorted({q['candidate_pool_id'] for q in queries}) + slot = {pid: n for n, pid in enumerate(pool_ids)} + label = np.zeros((len(pool_ids), fps.shape[1]), np.float32) + for i, q in enumerate(queries): + label[slot[q['candidate_pool_id']]] = np.unpackbits(packed[starts[sslot[q['candidate_pool_id']]] + int(ev.target[i])]) + t = netprop.tanimoto(label, fps) # [pools, molecules] + qpool = np.array([slot[q['candidate_pool_id']] for q in queries]) + order = np.argsort(-t, axis=1, kind='stable')[:, :args.top] + best = np.take_along_axis(t, order, axis=1) + molecules, values = libmod.neighbours(lib, queries, args.top) + true = t[qpool[:, None], molecules] # label Tanimoto of the spectral neighbours + w = np.maximum(values.astype(np.float64), 0.0) ** 6 + weighted = (w[:, :20] * true[:, :20]).sum(1) / np.maximum(w[:, :20].sum(1), 1e-300) + domain = np.array([q['adduct'] == '[M+H]+' and q.get('collision_energy') is not None for q in queries]) + for name, rows in (('all', np.ones(len(queries), bool)), ('domain', domain), ('other', ~domain)): + o = best[qpool[rows]] + print(f'{name:6s} queries {int(rows.sum()):6d} | oracle: nearest {o[:, 0].mean():.3f} (median {np.median(o[:, 0]):.3f}; >= 0.5: ' + f'{np.mean(o[:, 0] >= 0.5):.3f}; >= 0.7: {np.mean(o[:, 0] >= 0.7):.3f}), mean of 20 {o[:, :20].mean():.3f} | spectral: nearest ' + f'{true[rows, 0].mean():.3f}, best of 20 {true[rows, :20].max(1).mean():.3f}, mean of 20 {true[rows, :20].mean():.3f}, ' + f's^6-weighted {weighted[rows].mean():.3f} | similarity of the nearest {values[rows, 0].mean():.3f}') + hit = (true[:, :20].max(1) >= best[qpool][:, 0] - 1e-9).mean() + print(f'share of queries whose structurally nearest library molecule is among the 20 spectral neighbours: {hit:.3f}') + if args.out: + out = ROOT / args.out + out.parent.mkdir(parents=True, exist_ok=True) + np.savez(out, query_ids=np.array([q['query_id'] for q in queries]), spectral=molecules, spectral_sim=values, + oracle=order[qpool], oracle_sim=best[qpool].astype(np.float32)) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/4b/4becbd83858054d151c4a73d6bcf5dcef9bce44b215279f587c805446d69c04c/swap-quick-N5-recur-merged-10-sqrt.log b/shared/package-files/4b/4becbd83858054d151c4a73d6bcf5dcef9bce44b215279f587c805446d69c04c/swap-quick-N5-recur-merged-10-sqrt.log new file mode 100644 index 0000000000000000000000000000000000000000..664a7f0316d409c48dd08aebf6e8fac40db6b629 --- /dev/null +++ b/shared/package-files/4b/4becbd83858054d151c4a73d6bcf5dcef9bce44b215279f587c805446d69c04c/swap-quick-N5-recur-merged-10-sqrt.log @@ -0,0 +1,4 @@ +released rule without consensus: Hit@1 0.7685 domain 0.9301 other 0.6062 macro 0.8650 Hit@5 0.8793 Hit@20 0.9358 +lin w 0.05: Hit@1 0.7715 (+0.0030 [-0.0031, +0.0108]) macro 0.8665 (+0.0015 [-0.0009, +0.0041]) pools +13 -8 | other 0.6141 Hit@5 0.8841 Hit@20 0.9359 +lin w 0.10: Hit@1 0.7690 (+0.0005 [-0.0077, +0.0088]) macro 0.8662 (+0.0012 [-0.0018, +0.0041]) pools +15 -11 | other 0.6090 Hit@5 0.8832 Hit@20 0.9369 +lin w 0.20: Hit@1 0.8019 (+0.0334 [-0.0036, +0.0925]) macro 0.8662 (+0.0012 [-0.0021, +0.0044]) pools +18 -14 | other 0.6756 Hit@5 0.8762 Hit@20 0.9326 diff --git a/shared/package-files/4c/4c03c661926decaf21e61fa726520091182f6e5ea21b0d473223a351786ebe5a/train-S1.log b/shared/package-files/4c/4c03c661926decaf21e61fa726520091182f6e5ea21b0d473223a351786ebe5a/train-S1.log new file mode 100644 index 0000000000000000000000000000000000000000..3dc0927d0ba785a42c245ac42f53e1b2ec48bd8b --- /dev/null +++ b/shared/package-files/4c/4c03c661926decaf21e61fa726520091182f6e5ea21b0d473223a351786ebe5a/train-S1.log @@ -0,0 +1,5 @@ +{"event": "resumed", "source": "/workspace/research/forks/B-step0035000-resume.ckpt", "step": 35000, "epoch": 5, "batch_in_epoch": 5460, "elapsed": 9512.104094705079, "skipped": 0} +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "own-checkpoint:0739bdd163a52753b55f2558914ac1fb8383b00c0436512105f4f0e28d55a5a8", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 37500, "elapsed_seconds": 12713.62058708514, "validation_loss": 0.5682035563513637, "validation_loss_ema": 0.5665822857990861} diff --git a/shared/package-files/4c/4ca8141b70da8b10e2daeefe54ff68ba8d401b3a0f4384e39917cad80717208b/release-rule-6M-B4s-30k.log b/shared/package-files/4c/4ca8141b70da8b10e2daeefe54ff68ba8d401b3a0f4384e39917cad80717208b/release-rule-6M-B4s-30k.log new file mode 100644 index 0000000000000000000000000000000000000000..bff4e853e6e45c5f3208d01d723d7492f0841d28 --- /dev/null +++ b/shared/package-files/4c/4ca8141b70da8b10e2daeefe54ff68ba8d401b3a0f4384e39917cad80717208b/release-rule-6M-B4s-30k.log @@ -0,0 +1,13 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.161, to the average candidate 0.102 + domain: label 0.153, candidate 0.105, best similarity median 0.442 + other: label 0.168, candidate 0.098, best similarity median 0.444 +--- neighbour branch alone (per spectrum / pool mean) +frag k=20 p=6 debias ind all=0.1356 dom=0.1437 non=0.1274 | pool all=0.1965 dom=0.1713 non=0.2219 +loss k=20 p=6 debias ind all=0.0691 dom=0.0593 non=0.0789 | pool all=0.1212 dom=0.0784 non=0.1642 +sum k=20 p=6 debias ind all=0.1682 dom=0.1791 non=0.1573 | pool all=0.2540 dom=0.2259 non=0.2821 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8379 | +0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] +forward 6M-B4s-30k-ensmean.pkl all=0.7476 dom=0.9113 non=0.5832 h5=0.8712 h20=0.9346 macro=0.8399 | -0.0005 [-0.0059,+0.0036] | ind 0.6038 +0.0026 [+0.0002,+0.0048] + pools +23 -16 | macro +0.0021 [-0.0018,+0.0059] | without top 20 -0.0006 [-0.0063,+0.0042] | weight min(n,30) -0.0006 [-0.0065,+0.0043] +sum k=20 p=6 debias u=0/0 all=0.7476 dom=0.9113 non=0.5832 h5=0.8712 h20=0.9346 macro=0.8399 | -0.0005 [-0.0059,+0.0036] | ind 0.6038 +0.0026 [+0.0002,+0.0048] + pools +23 -16 | macro +0.0021 [-0.0018,+0.0059] | without top 20 -0.0006 [-0.0063,+0.0042] | weight min(n,30) -0.0006 [-0.0065,+0.0043] diff --git a/shared/package-files/4c/4cc4b21e82b0d241cc5b465fadc9763617901d859676ac0182a2973ba362a4e6/summary.txt b/shared/package-files/4c/4cc4b21e82b0d241cc5b465fadc9763617901d859676ac0182a2973ba362a4e6/summary.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee41d3d255da1f854952831abae910623af385bb --- /dev/null +++ b/shared/package-files/4c/4cc4b21e82b0d241cc5b465fadc9763617901d859676ac0182a2973ba362a4e6/summary.txt @@ -0,0 +1,47 @@ +evals/F1-30k-sub/report-ind.json + {'hit_rate_at_1': 0.469, 'hit_rate_at_20': 0.6628, 'hit_rate_at_5': 0.572} CI 0.3961 0.5502 n 2147 valid 2147 err None + adduct {'[M+H]+': (0.577, 1658), '[M+Na]+': (0.104, 489)} + instrument_type {'': (0.486, 35), 'Orbitrap': (0.479, 1870), 'QTOF': (0.388, 242)} + collision_energy {'20-39.999': (0.672, 512), '40-59.999': (0.768, 177), '<20': (0.49, 151), '>=60': (0.747, 348), 'missing': (0.201, 959)} + routing_domain {'fallback': (0.2, 991), 'glacier_released': (0.7, 1156)} +evals/F1-30k-sub/report-agg1.json + {'hit_rate_at_1': 0.578, 'hit_rate_at_20': 0.8393, 'hit_rate_at_5': 0.7434} CI 0.4789 0.6882 n 2147 valid 2147 err None + adduct {'[M+H]+': (0.658, 1658), '[M+Na]+': (0.307, 489)} + instrument_type {'': (0.486, 35), 'Orbitrap': (0.595, 1870), 'QTOF': (0.463, 242)} + collision_energy {'20-39.999': (0.793, 512), '40-59.999': (0.785, 177), '<20': (0.596, 151), '>=60': (0.813, 348), 'missing': (0.337, 959)} + routing_domain {'fallback': (0.339, 991), 'glacier_released': (0.783, 1156)} +all n= 2147 hit1_ind=0.470 hit1_agg=0.578 h5_agg=0.743 h20_agg=0.839 npk=14 d_t=0.649 d_min=0.579 ties=0.22 cands=256 +('H', 'ce') n= 1156 hit1_ind=0.700 hit1_agg=0.783 h5_agg=0.932 h20_agg=0.960 npk=19 d_t=0.515 d_min=0.477 ties=0.00 cands=256 +('H', 'ceNA') n= 502 hit1_ind=0.295 hit1_agg=0.371 h5_agg=0.600 h20_agg=0.755 npk=12 d_t=0.969 d_min=0.753 ties=0.45 cands=256 +('Na', 'ce') n= 32 hit1_ind=0.156 hit1_agg=0.406 h5_agg=0.406 h20_agg=0.844 npk=8 d_t=0.532 d_min=0.420 ties=0.06 cands=256 +('Na', 'ceNA') n= 457 hit1_ind=0.103 hit1_agg=0.300 h5_agg=0.449 h20_agg=0.626 npk=7 d_t=1.000 d_min=0.864 ties=0.53 cands=256 +('H', 'ce', 'Orbitrap') n= 1007 hit1_ind=0.763 hit1_agg=0.838 h5_agg=0.953 h20_agg=0.986 npk=19 d_t=0.489 d_min=0.458 ties=0.00 cands=256 +('H', 'ce', 'QTOF') n= 149 hit1_ind=0.275 hit1_agg=0.409 h5_agg=0.785 h20_agg=0.785 npk=21 d_t=0.734 d_min=0.642 ties=0.01 cands=256 +('H', 'ceNA', 'Orbitrap') n= 411 hit1_ind=0.221 hit1_agg=0.326 h5_agg=0.564 h20_agg=0.725 npk=9 d_t=1.000 d_min=0.832 ties=0.55 cands=256 +('H', 'ceNA', 'QTOF') n= 68 hit1_ind=0.632 hit1_agg=0.574 h5_agg=0.779 h20_agg=0.882 npk=46 d_t=0.645 d_min=0.609 ties=0.01 cands=256 +('H', 'ceNA', 'none') n= 23 hit1_ind=0.609 hit1_agg=0.565 h5_agg=0.696 h20_agg=0.913 npk=106 d_t=0.605 d_min=0.533 ties=0.04 cands=256 +('Na', 'ce', 'Orbitrap') n= 23 hit1_ind=0.087 hit1_agg=0.391 h5_agg=0.391 h20_agg=1.000 npk=8 d_t=0.563 d_min=0.420 ties=0.09 cands=256 +('Na', 'ce', 'QTOF') n= 9 hit1_ind=0.333 hit1_agg=0.444 h5_agg=0.444 h20_agg=0.444 npk=12 d_t=0.438 d_min=0.372 ties=0.00 cands=256 +('Na', 'ceNA', 'Orbitrap') n= 429 hit1_ind=0.086 hit1_agg=0.291 h5_agg=0.445 h20_agg=0.615 npk=7 d_t=1.000 d_min=0.909 ties=0.56 cands=256 +('Na', 'ceNA', 'QTOF') n= 16 hit1_ind=0.438 hit1_agg=0.500 h5_agg=0.562 h20_agg=0.812 npk=84 d_t=0.682 d_min=0.593 ties=0.00 cands=256 +('Na', 'ceNA', 'none') n= 12 hit1_ind=0.250 hit1_agg=0.333 h5_agg=0.417 h20_agg=0.750 npk=84 d_t=0.731 d_min=0.607 ties=0.00 cands=256 +--- non-domain queries by pool composition +nondomain, pool has domain spectra n= 150 hit1_ind=0.260 hit1_agg=0.287 h5_agg=0.633 h20_agg=0.740 npk=16 d_t=0.625 d_min=0.537 ties=0.14 cands=256 +nondomain, pool has no domain spectra n= 841 hit1_ind=0.191 hit1_agg=0.348 h5_agg=0.504 h20_agg=0.691 npk=8 d_t=1.000 d_min=0.848 ties=0.53 cands=256 +--- by number of peaks +npk [1,3) n= 155 hit1_ind=0.052 hit1_agg=0.245 h5_agg=0.465 h20_agg=0.613 npk=2 d_t=1.000 d_min=0.990 ties=0.74 cands=256 +npk [3,6) n= 298 hit1_ind=0.275 hit1_agg=0.473 h5_agg=0.607 h20_agg=0.758 npk=4 d_t=0.841 d_min=0.631 ties=0.42 cands=256 +npk [6,11) n= 414 hit1_ind=0.331 hit1_agg=0.488 h5_agg=0.640 h20_agg=0.792 npk=8 d_t=0.722 d_min=0.587 ties=0.32 cands=256 +npk [11,21) n= 487 hit1_ind=0.480 hit1_agg=0.618 h5_agg=0.793 h20_agg=0.844 npk=15 d_t=0.621 d_min=0.548 ties=0.16 cands=256 +npk [21,51) n= 515 hit1_ind=0.687 hit1_agg=0.713 h5_agg=0.883 h20_agg=0.932 npk=31 d_t=0.586 d_min=0.548 ties=0.04 cands=256 +npk [51,1000000) n= 278 hit1_ind=0.698 hit1_agg=0.691 h5_agg=0.853 h20_agg=0.942 npk=74 d_t=0.596 d_min=0.571 ties=0.02 cands=256 +--- by pool size (queries per pool) +pool_n [1,2) n= 60 hit1_ind=0.717 hit1_agg=0.717 h5_agg=0.900 h20_agg=0.983 npk=44 d_t=0.615 d_min=0.586 ties=0.00 cands=256 +pool_n [2,4) n= 761 hit1_ind=0.760 hit1_agg=0.827 h5_agg=0.947 h20_agg=0.966 npk=21 d_t=0.487 d_min=0.460 ties=0.01 cands=256 +pool_n [4,8) n= 163 hit1_ind=0.564 hit1_agg=0.669 h5_agg=0.785 h20_agg=0.933 npk=20 d_t=0.511 d_min=0.462 ties=0.02 cands=256 +pool_n [8,16) n= 163 hit1_ind=0.485 hit1_agg=0.595 h5_agg=0.865 h20_agg=0.951 npk=16 d_t=0.530 d_min=0.466 ties=0.04 cands=256 +pool_n [16,1000000) n= 1000 hit1_ind=0.217 hit1_agg=0.363 h5_agg=0.552 h20_agg=0.701 npk=9 d_t=0.998 d_min=0.760 ties=0.46 cands=256 +--- by candidates +cands [128,256) n= 13 hit1_ind=0.538 hit1_agg=0.538 h5_agg=1.000 h20_agg=1.000 npk=27 d_t=0.488 d_min=0.483 ties=0.00 cands=189 +cands [256,257) n= 2134 hit1_ind=0.470 hit1_agg=0.578 h5_agg=0.742 h20_agg=0.838 npk=14 d_t=0.650 d_min=0.581 ties=0.22 cands=256 +pool-level hit1_agg (pools weighted equally): 0.738498789346247 413 diff --git a/shared/package-files/4c/4cc6cb26cdbf49ccb44f43aec374a6c904a90b7bd47300c5d6765f7776336c1f/recipe.json b/shared/package-files/4c/4cc6cb26cdbf49ccb44f43aec374a6c904a90b7bd47300c5d6765f7776336c1f/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..c9316aaf8e5687b66f916e6587df5bb511276f44 --- /dev/null +++ b/shared/package-files/4c/4cc6cb26cdbf49ccb44f43aec374a6c904a90b7bd47300c5d6765f7776336c1f/recipe.json @@ -0,0 +1,167 @@ +{ + "args": { + "store": "/workspace/research/inv", + "out": "runs/I24-ff512x6-real15-corpus2+train3-noise05-real025", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.15, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 0.5, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "noise_real_rate": 0.25, + "synth_peak_drop": -1.0, + "synth_jitter": -1.0, + "synth_rank_drop": 0.0, + "rank_keep": "inv/rank_keep.json", + "noise_near": 0.0, + "noise_deltas": "inv/noise_deltas.json", + "init": null, + "max_steps_this_run": 0 + }, + "parameters": 24997832, + "model": { + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "pair_dim": 64, + "fp_bits": 4096, + "max_energy": 200.0 + }, + "real_rows": 194119, + "synth_rows": 2333477, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "gpu": "NVIDIA H100 80GB HBM3", + "load_seconds": 54.414447149960324, + "extra_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + } +} diff --git a/shared/package-files/4c/4cd44942b55b4478afbe793dad69884a53899ad8a53bfe9c09587154b92b8c9e/metrics.jsonl b/shared/package-files/4c/4cd44942b55b4478afbe793dad69884a53899ad8a53bfe9c09587154b92b8c9e/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..103f8f4114b2089147a96303ef0ffedeb4facf5c --- /dev/null +++ b/shared/package-files/4c/4cd44942b55b4478afbe793dad69884a53899ad8a53bfe9c09587154b92b8c9e/metrics.jsonl @@ -0,0 +1,244 @@ +{"step": 200, "loss": 0.32955215878784655, "bce_real": 0.32814977219328284, "bce_synth": 0.3299010490626097, "lr": 5.9999425457951604e-05, "elapsed": 23.10453538701404, "steps_per_second": 16.547663369274193} +{"step": 400, "loss": 0.04746789498254657, "bce_real": 0.04295873340219259, "bce_synth": 0.048589687030762434, "lr": 0.00011999538058286864, "elapsed": 34.65004271303769, "steps_per_second": 16.926340892016814} +{"step": 600, "loss": 0.04328444058075547, "bce_real": 0.03678316676057875, "bce_synth": 0.04490183096379042, "lr": 0.00017998438366332372, "elapsed": 46.22918172099162, "steps_per_second": 17.040156226954238} +{"step": 800, "loss": 0.04089394934475422, "bce_real": 0.033762437691912055, "bce_synth": 0.04266813054680824, "lr": 0.00023996295344516443, "elapsed": 57.67855323001277, "steps_per_second": 17.145190680228627} +{"step": 1000, "loss": 0.03949602270498872, "bce_real": 0.03207399467937648, "bce_synth": 0.04134247848764062, "lr": 0.0002999276093605773, "elapsed": 69.29368353099562, "steps_per_second": 17.15988551875378} +{"step": 1200, "loss": 0.03846497852355242, "bce_real": 0.03079275961034, "bce_synth": 0.04037367718294263, "lr": 0.00035987487175711435, "elapsed": 80.83365185395814, "steps_per_second": 17.188181454124127} +{"step": 1400, "loss": 0.03752813411876559, "bce_real": 0.029830035883933306, "bce_synth": 0.039443271197378636, "lr": 0.0004198012621266681, "elapsed": 92.33657708903775, "steps_per_second": 17.216288357007837} +{"step": 1600, "loss": 0.03655270179733634, "bce_real": 0.028824286283925176, "bce_synth": 0.03847538093104959, "lr": 0.00047970330333438473, "elapsed": 103.97357784502674, "steps_per_second": 17.212566840827748} +{"step": 1800, "loss": 0.03567059446126222, "bce_real": 0.027921586465090513, "bce_synth": 0.03759839653968811, "lr": 0.0005395775198474994, "elapsed": 114.85794046905357, "steps_per_second": 17.334410033902927} +{"step": 2000, "loss": 0.03499885097146034, "bce_real": 0.027251702873036264, "bce_synth": 0.036926190741360186, "lr": 0.0005994204379640853, "elapsed": 124.6395517840283, "steps_per_second": 17.60233123360643} +{"step": 2200, "loss": 0.03411336924880743, "bce_real": 0.0263290043361485, "bce_synth": 0.03604996744543314, "lr": 0.0005992987145833635, "elapsed": 132.81842403800692, "steps_per_second": 18.06236979411915} +{"step": 2400, "loss": 0.03330376921221614, "bce_real": 0.0255111984629184, "bce_synth": 0.03524240909144282, "lr": 0.0005991654122715976, "elapsed": 140.7416312850546, "steps_per_second": 18.500903655982583} +{"step": 2600, "loss": 0.032582322861999274, "bce_real": 0.024724878631532193, "bce_synth": 0.0345371020771563, "lr": 0.0005990205362913348, "elapsed": 148.47527653200086, "steps_per_second": 18.915000850353405} +{"step": 2800, "loss": 0.03186209845356643, "bce_real": 0.024174593463540076, "bce_synth": 0.03377459984272718, "lr": 0.000598864092362031, "elapsed": 157.1456976380432, "steps_per_second": 19.16135390341624} +{"step": 3000, "loss": 0.031257849233224985, "bce_real": 0.023452833611518144, "bce_synth": 0.03319958485662937, "lr": 0.0005986960866598242, "elapsed": 168.68239965406246, "steps_per_second": 19.027786463113674} +{"step": 3200, "loss": 0.030715739838778972, "bce_real": 0.02296712745912373, "bce_synth": 0.03264344370923936, "lr": 0.000598516525817292, "elapsed": 180.24936059606262, "steps_per_second": 18.909051433320805} +{"step": 3400, "loss": 0.03020620560273528, "bce_real": 0.022477910742163657, "bce_synth": 0.03212885467335582, "lr": 0.0005983254169231893, "elapsed": 191.72680422395933, "steps_per_second": 18.81482473208733} +{"step": 3600, "loss": 0.029714414915069938, "bce_real": 0.022099883193150163, "bce_synth": 0.03160876201465726, "lr": 0.0005981227675221674, "elapsed": 203.28919373906683, "steps_per_second": 18.723576657579404} +{"step": 3800, "loss": 0.029238175954669713, "bce_real": 0.021498563401401043, "bce_synth": 0.031163640851154924, "lr": 0.0005979085856144783, "elapsed": 214.6224108559545, "steps_per_second": 18.663664635806175} +{"step": 4000, "loss": 0.02881018796004355, "bce_real": 0.021002605594694614, "bce_synth": 0.030752562284469605, "lr": 0.0005976828796556566, "elapsed": 225.87243695405778, "steps_per_second": 18.6172763624267} +{"step": 4200, "loss": 0.02849424979649484, "bce_real": 0.02065423786640167, "bce_synth": 0.03044469192624092, "lr": 0.0005974456585561872, "elapsed": 237.33511752798222, "steps_per_second": 18.55805014943369} +{"step": 4400, "loss": 0.028156981570646167, "bce_real": 0.02019477969035506, "bce_synth": 0.030137822004035114, "lr": 0.0005971969316811528, "elapsed": 248.78517036500853, "steps_per_second": 18.50551689197964} +{"step": 4600, "loss": 0.02784949492663145, "bce_real": 0.019984332509338856, "bce_synth": 0.029806194212287664, "lr": 0.0005969367088498648, "elapsed": 259.17970831505954, "steps_per_second": 18.536318283661387} +{"step": 4800, "loss": 0.027507359459996224, "bce_real": 0.019499257439747453, "bce_synth": 0.029499619165435434, "lr": 0.0005966650003354748, "elapsed": 269.4921158889774, "steps_per_second": 18.570541982460977} +{"step": 5000, "loss": 0.027216771561652423, "bce_real": 0.019323786050081254, "bce_synth": 0.02918039254844189, "lr": 0.0005963818168645697, "elapsed": 279.7984235580079, "steps_per_second": 18.602561743890686} +{"step": 5200, "loss": 0.026922154566273095, "bce_real": 0.018974569477140903, "bce_synth": 0.02889935896731913, "lr": 0.0005960871696167482, "elapsed": 337.85730153601617, "steps_per_second": 15.90997080481138} +{"step": 5400, "loss": 0.026687649944797158, "bce_real": 0.018643046305514874, "bce_synth": 0.028688990538939835, "lr": 0.0005957810702241789, "elapsed": 348.1667989710113, "steps_per_second": 16.016678181373305} +{"step": 5600, "loss": 0.02643456244841218, "bce_real": 0.018590758675709366, "bce_synth": 0.028385947877541184, "lr": 0.0005954635307711417, "elapsed": 358.4747925719712, "steps_per_second": 16.117122924567063} +{"step": 5800, "loss": 0.026164723951369526, "bce_real": 0.018246687259525062, "bce_synth": 0.02813457720912993, "lr": 0.0005951345637935509, "elapsed": 368.77766409504693, "steps_per_second": 16.2120116945659} +{"step": 6000, "loss": 0.025959917921572925, "bce_real": 0.017833108049817383, "bce_synth": 0.027981709763407706, "lr": 0.000594794182278459, "elapsed": 379.0874253070215, "steps_per_second": 16.301283040204293} +{"step": 6200, "loss": 0.025731792422011495, "bce_real": 0.017776403450407086, "bce_synth": 0.027710938062518835, "lr": 0.0005944423996635457, "elapsed": 389.4150985190645, "steps_per_second": 16.38491394949315} +{"step": 6400, "loss": 0.025524929175153376, "bce_real": 0.01741731942165643, "bce_synth": 0.027541944468393923, "lr": 0.0005940792298365861, "elapsed": 399.728987885057, "steps_per_second": 16.464684816545326} +{"step": 6600, "loss": 0.025257175406441092, "bce_real": 0.017024651300162078, "bce_synth": 0.027305267034098506, "lr": 0.0005937046871349034, "elapsed": 410.0462404700229, "steps_per_second": 16.54019256509812} +{"step": 6800, "loss": 0.025110849756747485, "bce_real": 0.016977717764675618, "bce_synth": 0.027134214323014022, "lr": 0.0005933187863448017, "elapsed": 420.35882428998593, "steps_per_second": 16.61208350259024} +{"step": 7000, "loss": 0.02490956678055227, "bce_real": 0.016744037750177087, "bce_synth": 0.026940991217270494, "lr": 0.0005929215427009838, "elapsed": 430.6704814590048, "steps_per_second": 16.680477968108754} +{"step": 7200, "loss": 0.024747309377416968, "bce_real": 0.016597349788062276, "bce_synth": 0.026774860508739947, "lr": 0.0005925129718859484, "elapsed": 440.97348762501497, "steps_per_second": 16.745928762022608} +{"step": 7400, "loss": 0.02458265928551555, "bce_real": 0.016435984084382654, "bce_synth": 0.026609393348917366, "lr": 0.0005920930900293717, "elapsed": 451.34832098998595, "steps_per_second": 16.80557446879262} +{"step": 7600, "loss": 0.024374073510989545, "bce_real": 0.01612370607908815, "bce_synth": 0.026426604110747577, "lr": 0.0005916619137074705, "elapsed": 461.72788710403256, "steps_per_second": 16.862297080755212} +{"step": 7800, "loss": 0.024199834670871497, "bce_real": 0.01593870107550174, "bce_synth": 0.026255043717101217, "lr": 0.0005912194599423477, "elapsed": 472.0388903559651, "steps_per_second": 16.91898174428127} +{"step": 8000, "loss": 0.02407926307991147, "bce_real": 0.01573973833117634, "bce_synth": 0.026153974179178478, "lr": 0.0005907657462013203, "elapsed": 483.849006160046, "steps_per_second": 16.91937272014652} +{"step": 8200, "loss": 0.02398269422352314, "bce_real": 0.015560896038077771, "bce_synth": 0.02607787346467376, "lr": 0.0005903007903962298, "elapsed": 496.9968574460363, "steps_per_second": 16.873170250306877} +{"step": 8400, "loss": 0.023740612752735615, "bce_real": 0.01524495916441083, "bce_synth": 0.02585416560061276, "lr": 0.0005898246108827355, "elapsed": 509.9616832729662, "steps_per_second": 16.83557541006291} +{"step": 8600, "loss": 0.02362698425538838, "bce_real": 0.015269545204937458, "bce_synth": 0.025706152142956854, "lr": 0.0005893372264595891, "elapsed": 521.9021737009753, "steps_per_second": 16.833569033340552} +{"step": 8800, "loss": 0.023576124040409922, "bce_real": 0.015097765512764453, "bce_synth": 0.025685374392196536, "lr": 0.0005888386563678933, "elapsed": 532.0712191360071, "steps_per_second": 16.888877558858763} +{"step": 9000, "loss": 0.023391173919662833, "bce_real": 0.014804976582527161, "bce_synth": 0.025527252526953818, "lr": 0.0005883289202903413, "elapsed": 540.5552156560589, "steps_per_second": 16.995980226633133} +{"step": 9200, "loss": 0.023235711995512248, "bce_real": 0.014652825836092233, "bce_synth": 0.02537096668034792, "lr": 0.0005878080383504407, "elapsed": 548.5004545750562, "steps_per_second": 17.116845356697226} +{"step": 9400, "loss": 0.023091877847909927, "bce_real": 0.014583255592733622, "bce_synth": 0.02520865716971457, "lr": 0.0005872760311117187, "elapsed": 556.5108978360659, "steps_per_second": 17.23212921773443} +{"step": 9600, "loss": 0.022932843109592795, "bce_real": 0.014371083904989064, "bce_synth": 0.025062841754406692, "lr": 0.0005867329195769101, "elapsed": 566.1155439589638, "steps_per_second": 17.29426516483526} +{"step": 9800, "loss": 0.022918982664123178, "bce_real": 0.014252663161605596, "bce_synth": 0.025074993940070272, "lr": 0.0005861787251871285, "elapsed": 579.0720476580318, "steps_per_second": 17.251886766748854} +{"step": 10000, "loss": 0.02271126627922058, "bce_real": 0.01408198005054146, "bce_synth": 0.024858064446598292, "lr": 0.0005856134698210193, "elapsed": 591.5845383889973, "steps_per_second": 17.22456159375823} +{"step": 10200, "loss": 0.022562528755515815, "bce_real": 0.014000152633525432, "bce_synth": 0.02469268118031323, "lr": 0.0005850371757938964, "elapsed": 878.6849166540196, "steps_per_second": 11.755666357202344} +{"step": 10400, "loss": 0.022429063292220233, "bce_real": 0.013858471331186593, "bce_synth": 0.024561259541660548, "lr": 0.0005844498658568614, "elapsed": 887.9049605750479, "steps_per_second": 11.860140806177515} +{"step": 10600, "loss": 0.02234803563915193, "bce_real": 0.013600530582480133, "bce_synth": 0.02452424440532923, "lr": 0.0005838515631959049, "elapsed": 898.3397252350114, "steps_per_second": 11.946064818195872} +{"step": 10800, "loss": 0.022256084810942413, "bce_real": 0.013573215939104558, "bce_synth": 0.024416213426738977, "lr": 0.0005832422914309915, "elapsed": 908.7349043369759, "steps_per_second": 12.030521884778452} +{"step": 11000, "loss": 0.022095420230180025, "bce_real": 0.01348695675842464, "bce_synth": 0.024237038027495147, "lr": 0.0005826220746151272, "elapsed": 919.1115629510023, "steps_per_second": 12.113292432359694} +{"step": 11200, "loss": 0.021995439091697336, "bce_real": 0.013365125092677772, "bce_synth": 0.024142493102699517, "lr": 0.00058199093723341, "elapsed": 929.5157903080108, "steps_per_second": 12.193826726078385} +{"step": 11400, "loss": 0.021892072623595594, "bce_real": 0.013113237763755024, "bce_synth": 0.0240760756470263, "lr": 0.000581348904202063, "elapsed": 939.914584898972, "steps_per_second": 12.272628726381532} +{"step": 11600, "loss": 0.021825048420578242, "bce_real": 0.013089308119378983, "bce_synth": 0.0239983303565532, "lr": 0.000580696000867451, "elapsed": 950.2740139670204, "steps_per_second": 12.350203530926107} +{"step": 11800, "loss": 0.021705527836456896, "bce_real": 0.012937021846883, "bce_synth": 0.023886961210519076, "lr": 0.0005800322530050796, "elapsed": 960.6907884849934, "steps_per_second": 12.425335442748601} +{"step": 12000, "loss": 0.021657991632819177, "bce_real": 0.012864298988133668, "bce_synth": 0.02384569083340466, "lr": 0.000579357686818578, "elapsed": 971.0793211939745, "steps_per_second": 12.499204697465787} +{"step": 12200, "loss": 0.021556063182651998, "bce_real": 0.012869755192659794, "bce_synth": 0.023717047413811088, "lr": 0.000578672328938664, "elapsed": 981.4468173600035, "steps_per_second": 12.57176495073961} +{"step": 12400, "loss": 0.02150109373033047, "bce_real": 0.012784611252136528, "bce_synth": 0.023669584654271603, "lr": 0.0005779762064220934, "elapsed": 991.8193440790055, "steps_per_second": 12.642726363359799} +{"step": 12600, "loss": 0.021397946244105695, "bce_real": 0.01267283347900957, "bce_synth": 0.023568584201857447, "lr": 0.0005772693467505911, "elapsed": 1002.2104111240478, "steps_per_second": 12.711964773706246} +{"step": 12800, "loss": 0.021238730819895864, "bce_real": 0.012405117508023977, "bce_synth": 0.02343636174686253, "lr": 0.0005765517778297665, "elapsed": 1012.6111579639837, "steps_per_second": 12.779643052000218} +{"step": 13000, "loss": 0.021131142377853393, "bce_real": 0.012305455207824707, "bce_synth": 0.023326801219955087, "lr": 0.0005758235279880121, "elapsed": 1022.9929026520113, "steps_per_second": 12.846171406248077} +{"step": 13200, "loss": 0.021142348786816, "bce_real": 0.012177947997115553, "bce_synth": 0.023372516809031366, "lr": 0.0005750846259753846, "elapsed": 1033.4012532669585, "steps_per_second": 12.911012609395401} +{"step": 13400, "loss": 0.021051046550273896, "bce_real": 0.012120746448636055, "bce_synth": 0.023272731099277733, "lr": 0.0005743351009624703, "elapsed": 1043.796260726056, "steps_per_second": 12.97471450577453} +{"step": 13600, "loss": 0.020985667603090407, "bce_real": 0.01215870060492307, "bce_synth": 0.0231816447339952, "lr": 0.0005735749825392333, "elapsed": 1054.1724752399605, "steps_per_second": 13.037381736481636} +{"step": 13800, "loss": 0.020911755450069906, "bce_real": 0.011975310444831848, "bce_synth": 0.023134968718513848, "lr": 0.0005728043007138474, "elapsed": 1063.9826025139773, "steps_per_second": 13.105856632507075} +{"step": 14000, "loss": 0.020818487862125038, "bce_real": 0.011983109884895385, "bce_synth": 0.023016557563096285, "lr": 0.0005720230859115115, "elapsed": 1074.4109399080044, "steps_per_second": 13.165409143672722} +{"step": 14200, "loss": 0.02078916204161942, "bce_real": 0.011845846315845848, "bce_synth": 0.023014084715396167, "lr": 0.0005712313689732482, "elapsed": 1084.8589747019578, "steps_per_second": 13.22356241099177} +{"step": 14400, "loss": 0.020635292856022714, "bce_real": 0.011752366907894612, "bce_synth": 0.022845191648229957, "lr": 0.0005704291811546867, "elapsed": 1095.3277673110133, "steps_per_second": 13.280340715113843} +{"step": 14600, "loss": 0.020545745994895698, "bce_real": 0.011526763518340886, "bce_synth": 0.022789492951706052, "lr": 0.0005696165541248286, "elapsed": 1105.8124975140672, "steps_per_second": 13.335839016743959} +{"step": 14800, "loss": 0.02050755511969328, "bce_real": 0.011638927524909377, "bce_synth": 0.02271389650180936, "lr": 0.0005687935199647974, "elapsed": 1116.3007241260493, "steps_per_second": 13.390242030196204} +{"step": 15000, "loss": 0.020464931968599557, "bce_real": 0.011419146773405373, "bce_synth": 0.02271534701809287, "lr": 0.0005679601111665725, "elapsed": 1126.8008453709772, "steps_per_second": 13.443478955089137} +{"step": 15200, "loss": 0.020314522394910453, "bce_real": 0.011314195962622762, "bce_synth": 0.022553628208115697, "lr": 0.0005671163606317065, "elapsed": 1188.2222651479533, "steps_per_second": 12.911950358587823} +{"step": 15400, "loss": 0.020317872483283282, "bce_real": 0.011280789747834205, "bce_synth": 0.022566122701391578, "lr": 0.0005662623016700254, "elapsed": 1198.6724720769562, "steps_per_second": 12.96673691627609} +{"step": 15600, "loss": 0.02033970086835325, "bce_real": 0.011240766220726072, "bce_synth": 0.022603338537737726, "lr": 0.0005653979679983149, "elapsed": 1209.144367521978, "steps_per_second": 13.020332014252691} +{"step": 15800, "loss": 0.020232050204649566, "bce_real": 0.011090047385077923, "bce_synth": 0.022506402060389518, "lr": 0.0005645233937389882, "elapsed": 1218.8949391930364, "steps_per_second": 13.080805330768728} +{"step": 16000, "loss": 0.020115563590079547, "bce_real": 0.01107909802813083, "bce_synth": 0.022363659953698517, "lr": 0.0005636386134187397, "elapsed": 1227.440159838996, "steps_per_second": 13.153330858126003} +{"step": 16200, "loss": 0.020024324860423805, "bce_real": 0.010946175390854478, "bce_synth": 0.022282791212201117, "lr": 0.0005627436619671814, "elapsed": 1234.4784256999847, "steps_per_second": 13.241133764509788} +{"step": 16400, "loss": 0.020044797277078034, "bce_real": 0.010880002425983549, "bce_synth": 0.022324819406494497, "lr": 0.0005618385747154643, "elapsed": 1241.1811011299724, "steps_per_second": 13.33156811398045} +{"step": 16600, "loss": 0.019957691570743917, "bce_real": 0.010829615187831224, "bce_synth": 0.02222857910208404, "lr": 0.0005609233873948831, "elapsed": 1247.6909977010218, "steps_per_second": 13.423114458505587} +{"step": 16800, "loss": 0.019918121164664626, "bce_real": 0.010747827836312354, "bce_synth": 0.022199511248618364, "lr": 0.0005599981361354663, "elapsed": 1255.7570200130576, "steps_per_second": 13.496807708842551} +{"step": 17000, "loss": 0.019802163001149894, "bce_real": 0.01074730845168233, "bce_synth": 0.022054834282025693, "lr": 0.0005590628574645494, "elapsed": 1268.353041477967, "steps_per_second": 13.520662876628993} +{"step": 17200, "loss": 0.019742315439507364, "bce_real": 0.010639285766519607, "bce_synth": 0.022006971957162023, "lr": 0.0005581175883053327, "elapsed": 1282.274964343058, "steps_per_second": 13.529918578345061} +{"step": 17400, "loss": 0.0197188981808722, "bce_real": 0.010630919602699579, "bce_synth": 0.02197981013916433, "lr": 0.0005571623659754243, "elapsed": 1295.399671467021, "steps_per_second": 13.54737739744631} +{"step": 17600, "loss": 0.019611316546797753, "bce_real": 0.010511399293318392, "bce_synth": 0.02187519846484065, "lr": 0.000556197228185366, "elapsed": 1307.5049433880486, "steps_per_second": 13.575148832792832} +{"step": 17800, "loss": 0.019573080064728857, "bce_real": 0.01040862905792892, "bce_synth": 0.021853016577661036, "lr": 0.0005552222130371452, "elapsed": 1319.3973235400626, "steps_per_second": 13.604619790530064} +{"step": 18000, "loss": 0.01954219409264624, "bce_real": 0.010325723050627858, "bce_synth": 0.02183507235720754, "lr": 0.0005542373590226904, "elapsed": 1331.1957223609788, "steps_per_second": 13.634530366849427} +{"step": 18200, "loss": 0.019488513730466367, "bce_real": 0.010387547130230814, "bce_synth": 0.021752656809985636, "lr": 0.000553242705022352, "elapsed": 1342.4867514240323, "steps_per_second": 13.669117833416188} +{"step": 18400, "loss": 0.019451010189950466, "bce_real": 0.010365146538242697, "bce_synth": 0.021711396193131803, "lr": 0.0005522382903033667, "elapsed": 1353.6168858030578, "steps_per_second": 13.704765766834583} +{"step": 18600, "loss": 0.019377366825938224, "bce_real": 0.010167085353750736, "bce_synth": 0.0216687052231282, "lr": 0.0005512241545183076, "elapsed": 1364.7629122319631, "steps_per_second": 13.739666242298496} +{"step": 18800, "loss": 0.01927343680523336, "bce_real": 0.01001318051479757, "bce_synth": 0.021577208070084453, "lr": 0.0005502003377035189, "elapsed": 1375.9095704799984, "steps_per_second": 13.773990320081346} +{"step": 19000, "loss": 0.019253712063655257, "bce_real": 0.010062544995453209, "bce_synth": 0.021540295127779246, "lr": 0.0005491668802775358, "elapsed": 1387.050442103995, "steps_per_second": 13.807816375495753} +{"step": 19200, "loss": 0.01924402341246605, "bce_real": 0.00992837459081784, "bce_synth": 0.021561575094237923, "lr": 0.0005481238230394878, "elapsed": 1398.2059663180262, "steps_per_second": 13.840952893011162} +{"step": 19400, "loss": 0.01914205524139106, "bce_real": 0.009914457560516893, "bce_synth": 0.021437701554968953, "lr": 0.0005470712071674886, "elapsed": 1409.3511764119612, "steps_per_second": 13.873663037389388} +{"step": 19600, "loss": 0.01911836501210928, "bce_real": 0.009809700495097787, "bce_synth": 0.021434179041534662, "lr": 0.0005460090742170103, "elapsed": 1420.4315791580593, "steps_per_second": 13.906495289622958} +{"step": 19800, "loss": 0.019064172441139816, "bce_real": 0.009737043066415936, "bce_synth": 0.021384580302983524, "lr": 0.0005449374661192434, "elapsed": 1431.5811881859554, "steps_per_second": 13.938136284746042} +{"step": 20000, "loss": 0.019050262765958906, "bce_real": 0.009704943508841097, "bce_synth": 0.021375195952132345, "lr": 0.0005438564251794405, "elapsed": 1442.7599463750375, "steps_per_second": 13.969000053337792} +{"step": 20200, "loss": 0.01895655647851527, "bce_real": 0.009725559435319156, "bce_synth": 0.021253048470243813, "lr": 0.000542765994075247, "elapsed": 1838.8027020810405, "steps_per_second": 11.051631297093474} +{"step": 20400, "loss": 0.018902266593649984, "bce_real": 0.00953247599536553, "bce_synth": 0.021233287854120136, "lr": 0.0005416662158550157, "elapsed": 1850.445031299023, "steps_per_second": 11.090411466462886} +{"step": 20600, "loss": 0.018886092165485025, "bce_real": 0.009646966618020088, "bce_synth": 0.02118460662662983, "lr": 0.0005405571339361076, "elapsed": 1861.1091461710166, "steps_per_second": 11.134587986507249} +{"step": 20800, "loss": 0.01887134226039052, "bce_real": 0.009617955815047026, "bce_synth": 0.021173404259607197, "lr": 0.0005394387921031779, "elapsed": 1870.6795047869673, "steps_per_second": 11.18483262106181} +{"step": 21000, "loss": 0.018825757699087262, "bce_real": 0.009598130548838527, "bce_synth": 0.02112141130492091, "lr": 0.0005383112345064472, "elapsed": 1878.7503857649863, "steps_per_second": 11.243582237430674} +{"step": 21200, "loss": 0.01875879826024175, "bce_real": 0.009479012454394252, "bce_synth": 0.021067427778616546, "lr": 0.0005371745056599587, "elapsed": 1886.423876908957, "steps_per_second": 11.304221103304291} +{"step": 21400, "loss": 0.018720286432653666, "bce_real": 0.009418729960452765, "bce_synth": 0.021034332187846304, "lr": 0.000536028650439821, "elapsed": 1894.0068371760426, "steps_per_second": 11.364912145681247} +{"step": 21600, "loss": 0.018591226628050208, "bce_real": 0.009255633228458465, "bce_synth": 0.020913740508258342, "lr": 0.000534873714082436, "elapsed": 1902.3010786919622, "steps_per_second": 11.420819522563383} +{"step": 21800, "loss": 0.018612855933606624, "bce_real": 0.009270039396360516, "bce_synth": 0.020937166595831513, "lr": 0.0005337097421827136, "elapsed": 1913.947046761983, "steps_per_second": 11.456024996830749} +{"step": 22000, "loss": 0.018567148484289645, "bce_real": 0.009200741979293525, "bce_synth": 0.02089732775464654, "lr": 0.0005325367806922714, "elapsed": 1925.6033328620251, "steps_per_second": 11.490740243537411} +{"step": 22200, "loss": 0.01857200773432851, "bce_real": 0.009280930880922824, "bce_synth": 0.02088344653137028, "lr": 0.0005313548759176205, "elapsed": 1937.2662195060402, "steps_per_second": 11.524995851990607} +{"step": 22400, "loss": 0.018500922750681638, "bce_real": 0.009127993157599122, "bce_synth": 0.02083272469229996, "lr": 0.0005301640745183378, "elapsed": 1948.903020121972, "steps_per_second": 11.558994738865325} +{"step": 22600, "loss": 0.018510221615433694, "bce_real": 0.009108637350145728, "bce_synth": 0.020849152533337474, "lr": 0.0005289644235052233, "elapsed": 1960.542345658061, "steps_per_second": 11.59257272044243} +{"step": 22800, "loss": 0.01835083430632949, "bce_real": 0.00902154064970091, "bce_synth": 0.020671780463308097, "lr": 0.0005277559702384452, "elapsed": 1972.1716334819794, "steps_per_second": 11.625811654065672} +{"step": 23000, "loss": 0.018332826793193816, "bce_real": 0.008977870533708483, "bce_synth": 0.020660157287493347, "lr": 0.0005265387624256692, "elapsed": 1983.8220009939978, "steps_per_second": 11.658534128936774} +{"step": 23200, "loss": 0.018370172129943966, "bce_real": 0.00896250854479149, "bce_synth": 0.020710615273565054, "lr": 0.0005253128481201754, "elapsed": 1995.4343773520086, "steps_per_second": 11.69109620674439} +{"step": 23400, "loss": 0.018309705313295125, "bce_real": 0.009050603231880814, "bce_synth": 0.020613189293071627, "lr": 0.0005240782757189615, "elapsed": 2007.076845725067, "steps_per_second": 11.723102667907437} +{"step": 23600, "loss": 0.01827222920022905, "bce_real": 0.008920078875962644, "bce_synth": 0.02059886172413826, "lr": 0.0005228350939608321, "elapsed": 2018.6932144770399, "steps_per_second": 11.754890745512956} +{"step": 23800, "loss": 0.018166948752477766, "bce_real": 0.008829939651768655, "bce_synth": 0.020489814588800073, "lr": 0.0005215833519244743, "elapsed": 2030.3263639380457, "steps_per_second": 11.78621513741621} +{"step": 24000, "loss": 0.01812147148884833, "bce_real": 0.008810781529173256, "bce_synth": 0.020437789801508188, "lr": 0.0005203230990265203, "elapsed": 2041.9710200569825, "steps_per_second": 11.817113726950533} +{"step": 24200, "loss": 0.018178494842723013, "bce_real": 0.00886929694795981, "bce_synth": 0.02049444178119302, "lr": 0.0005190543850195967, "elapsed": 2053.615279293037, "steps_per_second": 11.847662313270124} +{"step": 24400, "loss": 0.01809338852763176, "bce_real": 0.008728461426217108, "bce_synth": 0.020423199888318776, "lr": 0.00051777725999036, "elapsed": 2065.2501356049906, "steps_per_second": 11.877918957999633} +{"step": 24600, "loss": 0.018049374613910915, "bce_real": 0.00875109774293378, "bce_synth": 0.020362604409456253, "lr": 0.0005164917743575197, "elapsed": 2076.888463755022, "steps_per_second": 11.90781477661317} +{"step": 24800, "loss": 0.018009142996743322, "bce_real": 0.008741259351372719, "bce_synth": 0.020314811738207938, "lr": 0.0005151979788698475, "elapsed": 2088.522350164014, "steps_per_second": 11.93740116133732} +{"step": 25000, "loss": 0.018008475583046676, "bce_real": 0.00861383812269196, "bce_synth": 0.020345678152516485, "lr": 0.0005138959246041736, "elapsed": 2099.8307005160023, "steps_per_second": 11.96852300027605} +{"step": 25200, "loss": 0.0179172651655972, "bce_real": 0.008495849147439003, "bce_synth": 0.020261129736900328, "lr": 0.0005125856629633713, "elapsed": 2197.421372086974, "steps_per_second": 11.525779299419327} +{"step": 25400, "loss": 0.01794089812785387, "bce_real": 0.008548112132120877, "bce_synth": 0.020277640111744405, "lr": 0.0005112672456743265, "elapsed": 2211.4731577310013, "steps_per_second": 11.543067650648988} +{"step": 25600, "loss": 0.017885004496201874, "bce_real": 0.008543162965215742, "bce_synth": 0.020209072595462202, "lr": 0.0005099407247858964, "elapsed": 2224.8898729790235, "steps_per_second": 11.563452729617454} +{"step": 25800, "loss": 0.017873481763526797, "bce_real": 0.008556249886751174, "bce_synth": 0.02019142737612128, "lr": 0.0005086061526668541, "elapsed": 2237.9206275730394, "steps_per_second": 11.585599854028144} +{"step": 26000, "loss": 0.017834606161341072, "bce_real": 0.00852467910386622, "bce_synth": 0.02015073463320732, "lr": 0.0005072635820038217, "elapsed": 2250.8812223139685, "steps_per_second": 11.607852883552294} +{"step": 26200, "loss": 0.0178185086324811, "bce_real": 0.008331876790616661, "bce_synth": 0.020178597522899508, "lr": 0.0005059130657991904, "elapsed": 2263.74699628097, "steps_per_second": 11.630339384976647} +{"step": 26400, "loss": 0.01775978021323681, "bce_real": 0.008323796214535833, "bce_synth": 0.02010726908221841, "lr": 0.0005045546573690274, "elapsed": 2275.644953305018, "steps_per_second": 11.657550369134846} +{"step": 26600, "loss": 0.017730044741183518, "bce_real": 0.008348025446757674, "bce_synth": 0.02006410793401301, "lr": 0.0005031884103409714, "elapsed": 2287.306066735997, "steps_per_second": 11.685692666729448} +{"step": 26800, "loss": 0.01755786900408566, "bce_real": 0.008289567476604134, "bce_synth": 0.019863641615957023, "lr": 0.0005018143786521158, "elapsed": 2298.2767206520075, "steps_per_second": 11.717084100025883} +{"step": 27000, "loss": 0.01765232318080962, "bce_real": 0.00819402108900249, "bce_synth": 0.020005364269018173, "lr": 0.0005004326165468789, "elapsed": 2308.2059419819852, "steps_per_second": 11.753501881691895} +{"step": 27200, "loss": 0.017596022896468638, "bce_real": 0.008203236109111459, "bce_synth": 0.01993276515044272, "lr": 0.0004990431785748627, "elapsed": 2316.553091106005, "steps_per_second": 11.797696297649438} +{"step": 27400, "loss": 0.017617000006139277, "bce_real": 0.008153719131369143, "bce_synth": 0.019971279809251428, "lr": 0.0004976461195886993, "elapsed": 2324.2746771819657, "steps_per_second": 11.844774118785374} +{"step": 27600, "loss": 0.017565334793180228, "bce_real": 0.008164845041465014, "bce_synth": 0.019903993140906094, "lr": 0.0004962414947418852, "elapsed": 2331.9601088160416, "steps_per_second": 11.891723936621705} +{"step": 27800, "loss": 0.01750142904929817, "bce_real": 0.008070477878209203, "bce_synth": 0.01984766570851207, "lr": 0.0004948293594866042, "elapsed": 2339.7247050970327, "steps_per_second": 11.93795800110745} +{"step": 28000, "loss": 0.01743393622338772, "bce_real": 0.008039622134529054, "bce_synth": 0.019771058345213532, "lr": 0.0004934097695715384, "elapsed": 2351.377101315069, "steps_per_second": 11.963977160728941} +{"step": 28200, "loss": 0.017492013443261387, "bce_real": 0.008030821834690869, "bce_synth": 0.019845773307606576, "lr": 0.0004919827810396669, "elapsed": 2363.049115095986, "steps_per_second": 11.989638518642971} +{"step": 28400, "loss": 0.0174710707180202, "bce_real": 0.008001608962658793, "bce_synth": 0.01982688813470304, "lr": 0.0004905484502260535, "elapsed": 2374.706285385997, "steps_per_second": 12.015121890808633} +{"step": 28600, "loss": 0.017434942424297332, "bce_real": 0.008083796817809344, "bce_synth": 0.019761325158178807, "lr": 0.0004891068337556227, "elapsed": 2386.3715524360305, "steps_per_second": 12.04031409859159} +{"step": 28800, "loss": 0.017387756183743476, "bce_real": 0.008024542564526201, "bce_synth": 0.019717141054570675, "lr": 0.0004876579885409243, "elapsed": 2398.03388155601, "steps_per_second": 12.065274929833192} +{"step": 29000, "loss": 0.017341382252052426, "bce_real": 0.007871411019004881, "bce_synth": 0.019697326608002184, "lr": 0.00048620197177988667, "elapsed": 2409.7234234859934, "steps_per_second": 12.089855884220528} +{"step": 29200, "loss": 0.017334452401846646, "bce_real": 0.00793214950012043, "bce_synth": 0.01967356214299798, "lr": 0.00048473884095355833, "elapsed": 2421.4593337370316, "steps_per_second": 12.113965387106965} +{"step": 29400, "loss": 0.01725699070841074, "bce_real": 0.007865650495514274, "bce_synth": 0.019593372996896504, "lr": 0.00048326865382383906, "elapsed": 2433.1849951499607, "steps_per_second": 12.13789261795567} +{"step": 29600, "loss": 0.017274211682379245, "bce_real": 0.00790973135503009, "bce_synth": 0.019603911591693758, "lr": 0.00048179146843119934, "elapsed": 2444.916494657984, "steps_per_second": 12.161560125538777} +{"step": 29800, "loss": 0.01725028458982706, "bce_real": 0.007824043016880751, "bce_synth": 0.019595349496230482, "lr": 0.0004803073430923892, "elapsed": 2456.6240694640437, "steps_per_second": 12.185119783796964} +{"step": 30000, "loss": 0.017169973235577344, "bce_real": 0.00779127080924809, "bce_synth": 0.019503211518749595, "lr": 0.0004788163363981358, "elapsed": 2468.3566495389678, "steps_per_second": 12.20833071267915} +{"step": 30200, "loss": 0.017180343717336656, "bce_real": 0.007710586409084499, "bce_synth": 0.019536234848201276, "lr": 0.0004773185072108303, "elapsed": 2915.5521659749793, "steps_per_second": 10.397537346927042} +{"step": 30400, "loss": 0.017110301200300455, "bce_real": 0.007703379399608821, "bce_synth": 0.01945055994205177, "lr": 0.0004758139146622044, "elapsed": 2927.4067432959564, "steps_per_second": 10.423851261783923} +{"step": 30600, "loss": 0.017050382001325488, "bce_real": 0.007664350692648441, "bce_synth": 0.019385443618521094, "lr": 0.0004743026181509957, "elapsed": 2939.226274054032, "steps_per_second": 10.450077188440133} +{"step": 30800, "loss": 0.01702680140733719, "bce_real": 0.007575658985879272, "bce_synth": 0.0193780614156276, "lr": 0.00047278467734060257, "elapsed": 2951.005002444028, "steps_per_second": 10.476237639214887} +{"step": 31000, "loss": 0.017042305348441006, "bce_real": 0.007614174426998943, "bce_synth": 0.01938784041441977, "lr": 0.0004712601521567291, "elapsed": 2962.269801878021, "steps_per_second": 10.504018152845802} +{"step": 31200, "loss": 0.016937613589689135, "bce_real": 0.007592262073885649, "bce_synth": 0.01926255475729704, "lr": 0.00046972910278501927, "elapsed": 2972.491825878038, "steps_per_second": 10.535295715059288} +{"step": 31400, "loss": 0.01699154913891107, "bce_real": 0.007468047656584531, "bce_synth": 0.01936081040650606, "lr": 0.0004681915896686806, "elapsed": 2981.113402075018, "steps_per_second": 10.572051825450536} +{"step": 31600, "loss": 0.0169427652284503, "bce_real": 0.007583939987234771, "bce_synth": 0.01927105847746134, "lr": 0.0004666476735060982, "elapsed": 2989.0440447459696, "steps_per_second": 10.61105646427077} +{"step": 31800, "loss": 0.016909912498667835, "bce_real": 0.007517758230678737, "bce_synth": 0.019246497293934225, "lr": 0.00046509741524843875, "elapsed": 2996.974403028027, "steps_per_second": 10.649854935353838} +{"step": 32000, "loss": 0.01698279343545437, "bce_real": 0.007483262978494168, "bce_synth": 0.019346091244369746, "lr": 0.0004635408760972437, "elapsed": 3004.4065926370677, "steps_per_second": 10.690226662428703} +{"step": 32200, "loss": 0.01688567880541086, "bce_real": 0.007426985893398523, "bce_synth": 0.01923881722614169, "lr": 0.0004619781175020134, "elapsed": 3016.2711274840403, "steps_per_second": 10.714572511886407} +{"step": 32400, "loss": 0.016822487697936594, "bce_real": 0.007411501086317003, "bce_synth": 0.019163757683709263, "lr": 0.0004604092011577816, "elapsed": 3028.1373893070268, "steps_per_second": 10.73872073841835} +{"step": 32600, "loss": 0.016802548728883267, "bce_real": 0.007422336384188384, "bce_synth": 0.019136162670329214, "lr": 0.00045883418900267894, "elapsed": 3040.004362363019, "steps_per_second": 10.762677233329942} +{"step": 32800, "loss": 0.016779213063418865, "bce_real": 0.007435932853259147, "bce_synth": 0.01910363898612559, "lr": 0.00045725314321548853, "elapsed": 3051.8659274670063, "steps_per_second": 10.786465930092332} +{"step": 33000, "loss": 0.01672744816634804, "bce_real": 0.007408386876340956, "bce_synth": 0.019045849116519093, "lr": 0.00045566612621319075, "elapsed": 3063.721714920015, "steps_per_second": 10.810090220013477} +{"step": 33200, "loss": 0.016724678589962422, "bce_real": 0.0073843063274398445, "bce_synth": 0.019048381075263025, "lr": 0.00045407320064849954, "elapsed": 3075.5631659299834, "steps_per_second": 10.833582401732938} +{"step": 33400, "loss": 0.016676111416891216, "bce_real": 0.007237669031601399, "bce_synth": 0.01902421192266047, "lr": 0.00045247442940738873, "elapsed": 3087.403480138979, "steps_per_second": 10.856897745911445} +{"step": 33600, "loss": 0.016670701834373178, "bce_real": 0.007232065796852111, "bce_synth": 0.019018850261345505, "lr": 0.00045086987560660925, "elapsed": 3099.239997741999, "steps_per_second": 10.880047679196581} +{"step": 33800, "loss": 0.016674681385047734, "bce_real": 0.007187662813812494, "bce_synth": 0.01903486660681665, "lr": 0.00044925960259119784, "elapsed": 3111.0951433109585, "steps_per_second": 10.90295532420555} +{"step": 34000, "loss": 0.016633219104260206, "bce_real": 0.007287837320473045, "bce_synth": 0.01895816790871322, "lr": 0.0004476436739319758, "elapsed": 3122.997551067965, "steps_per_second": 10.925522498915056} +{"step": 34200, "loss": 0.01655301181599498, "bce_real": 0.007203226862475276, "bce_synth": 0.018879056069999935, "lr": 0.00044602215342303975, "elapsed": 3134.9334628270008, "steps_per_second": 10.947800288985682} +{"step": 34400, "loss": 0.016549928626045585, "bce_real": 0.0071366439177654685, "bce_synth": 0.018891770327463746, "lr": 0.00044439510507924293, "elapsed": 3146.8504204490455, "steps_per_second": 10.969974794385852} +{"step": 34600, "loss": 0.016613971162587404, "bce_real": 0.007218986612278968, "bce_synth": 0.01895126017741859, "lr": 0.00044276259313366786, "elapsed": 3158.734065294033, "steps_per_second": 10.992097730316571} +{"step": 34800, "loss": 0.016508316970430315, "bce_real": 0.007130312398076057, "bce_synth": 0.018841381669044494, "lr": 0.0004411246820350911, "elapsed": 3170.666073309956, "steps_per_second": 11.013885665355634} +{"step": 35000, "loss": 0.016558933039195835, "bce_real": 0.0071708770445548, "bce_synth": 0.018894498348236085, "lr": 0.000439481436445438, "elapsed": 3182.5713873080676, "steps_per_second": 11.035602543346252} +{"step": 35200, "loss": 0.016537703196518122, "bce_real": 0.007100029534194618, "bce_synth": 0.018885612320154906, "lr": 0.0004378329212372309, "elapsed": 3260.5728308500256, "steps_per_second": 10.832253773647432} +{"step": 35400, "loss": 0.01643794768024236, "bce_real": 0.007029421455226839, "bce_synth": 0.01877860556356609, "lr": 0.0004361792014910274, "elapsed": 3272.5278365949634, "steps_per_second": 10.8538696364341} +{"step": 35600, "loss": 0.016453529624268413, "bce_real": 0.007113196454010904, "bce_synth": 0.018777222307398915, "lr": 0.00043452034249285166, "elapsed": 3284.521463165991, "steps_per_second": 10.875199305577755} +{"step": 35800, "loss": 0.016446693185716867, "bce_real": 0.006998364236205816, "bce_synth": 0.018797253202646972, "lr": 0.00043285640973161633, "elapsed": 3296.551579421037, "steps_per_second": 10.896252230714348} +{"step": 36000, "loss": 0.01634936795104295, "bce_real": 0.006974357133731246, "bce_synth": 0.018681687880307437, "lr": 0.00043118746889653773, "elapsed": 3308.5388504629955, "steps_per_second": 10.917293394521915} +{"step": 36200, "loss": 0.016388290817849337, "bce_real": 0.006940322306472808, "bce_synth": 0.018738761153072117, "lr": 0.0004295135858745423, "elapsed": 3320.5672242699657, "steps_per_second": 10.938046286898611} +{"step": 36400, "loss": 0.01637820044066757, "bce_real": 0.007000107313506305, "bce_synth": 0.018711287090554835, "lr": 0.0004278348267476658, "elapsed": 3332.534557244042, "steps_per_second": 10.958850266796498} +{"step": 36600, "loss": 0.01629375841934234, "bce_real": 0.006951912618242204, "bce_synth": 0.01861782749183476, "lr": 0.00042615125779044393, "elapsed": 3344.5443958820542, "steps_per_second": 10.979364872904677} +{"step": 36800, "loss": 0.016350619345903396, "bce_real": 0.006943486770614982, "bce_synth": 0.018690930558368565, "lr": 0.0004244629454672963, "elapsed": 3356.5730827490333, "steps_per_second": 10.999670221722214} +{"step": 37000, "loss": 0.01632062894757837, "bce_real": 0.006827871333807706, "bce_synth": 0.01868224182166159, "lr": 0.00042276995642990276, "elapsed": 3368.6431597929914, "steps_per_second": 11.019694237044018} +{"step": 37200, "loss": 0.01627909158822149, "bce_real": 0.006850367102306337, "bce_synth": 0.01862477444112301, "lr": 0.00042107235751457153, "elapsed": 3380.6263546609553, "steps_per_second": 11.0398594474314} +{"step": 37400, "loss": 0.016245395550504325, "bce_real": 0.006801693351007998, "bce_synth": 0.018594804424792527, "lr": 0.0004193702157396011, "elapsed": 3391.5234096039785, "steps_per_second": 11.063435227025243} +{"step": 37600, "loss": 0.016216171612031757, "bce_real": 0.006808263785205782, "bce_synth": 0.01855667566880584, "lr": 0.00041766359830263414, "elapsed": 3401.337825611001, "steps_per_second": 11.09039989577559} +{"step": 37800, "loss": 0.01618474598042667, "bce_real": 0.006798103265464306, "bce_synth": 0.018519959608092905, "lr": 0.0004159525725780049, "elapsed": 3409.8015984110534, "steps_per_second": 11.121626768395185} +{"step": 38000, "loss": 0.016179644488729536, "bce_real": 0.006743734378833324, "bce_synth": 0.018527114847674966, "lr": 0.00041423720611407917, "elapsed": 3418.117209029966, "steps_per_second": 11.153183492525825} +{"step": 38200, "loss": 0.016118214204907416, "bce_real": 0.00666093425359577, "bce_synth": 0.018471001172438262, "lr": 0.00041251756663058793, "elapsed": 3426.268130882061, "steps_per_second": 11.185125888238627} +{"step": 38400, "loss": 0.016134997201152145, "bce_real": 0.006785493083298206, "bce_synth": 0.01846097148023546, "lr": 0.0004107937220159534, "elapsed": 3436.2588008809835, "steps_per_second": 11.210891409178988} +{"step": 38600, "loss": 0.016084761368110777, "bce_real": 0.006757454529870302, "bce_synth": 0.018405213439837097, "lr": 0.00040906574032460925, "elapsed": 3448.5223223989597, "steps_per_second": 11.229077567166403} +{"step": 38800, "loss": 0.016100622694939375, "bce_real": 0.00662926712539047, "bce_synth": 0.018456911239773034, "lr": 0.0004073336897743139, "elapsed": 3460.8588004210033, "steps_per_second": 11.246896573583076} +{"step": 39000, "loss": 0.01604833093006164, "bce_real": 0.006695571348536759, "bce_synth": 0.018375115059316157, "lr": 0.0004055976387434573, "elapsed": 3473.243776993011, "steps_per_second": 11.264430800876717} +{"step": 39200, "loss": 0.01600189977325499, "bce_real": 0.00663521901005879, "bce_synth": 0.018332147132605316, "lr": 0.0004038576557683616, "elapsed": 3485.652909053955, "steps_per_second": 11.281761598668162} +{"step": 39400, "loss": 0.016078014271333815, "bce_real": 0.0067041648854501545, "bce_synth": 0.018410045243799685, "lr": 0.0004021138095405753, "elapsed": 3498.080198000069, "steps_per_second": 11.298910215323655} +{"step": 39600, "loss": 0.015963186235167084, "bce_real": 0.006521630154456943, "bce_synth": 0.01831206114962697, "lr": 0.0004003661689041616, "elapsed": 3510.506838820991, "steps_per_second": 11.315939132198801} +{"step": 39800, "loss": 0.016001487486064433, "bce_real": 0.006591482579242438, "bce_synth": 0.018342513218522073, "lr": 0.0003986148028529802, "elapsed": 3522.9746184969554, "steps_per_second": 11.332714786070214} +{"step": 40000, "loss": 0.01596369732171297, "bce_real": 0.006579443423543125, "bce_synth": 0.018298316532745957, "lr": 0.0003968597805279642, "elapsed": 3535.4348420279566, "steps_per_second": 11.3493960829994} +{"step": 40200, "loss": 0.015878883367404343, "bce_real": 0.006480111125856638, "bce_synth": 0.018217114554718136, "lr": 0.0003951011712143899, "elapsed": 3906.6771341890562, "steps_per_second": 10.319178617774446} +{"step": 40400, "loss": 0.0159329804033041, "bce_real": 0.0066544522973708805, "bce_synth": 0.018241297202184797, "lr": 0.00039333904433914155, "elapsed": 3917.111640652991, "steps_per_second": 10.342814632536518} +{"step": 40600, "loss": 0.015835745627991855, "bce_real": 0.006473608741071075, "bce_synth": 0.01816486267372966, "lr": 0.0003915734694679712, "elapsed": 3927.540840264992, "steps_per_second": 10.366338745824391} +{"step": 40800, "loss": 0.015890480829402805, "bce_real": 0.006532612268347293, "bce_synth": 0.018218536227941513, "lr": 0.00038980451630275136, "elapsed": 3938.60981218901, "steps_per_second": 10.388045505675844} +{"step": 41000, "loss": 0.01589223583228886, "bce_real": 0.006503711326513439, "bce_synth": 0.01822791775688529, "lr": 0.00038803225467872425, "elapsed": 3952.633164928993, "steps_per_second": 10.4018278701457} +{"step": 41200, "loss": 0.015835541123524307, "bce_real": 0.00646451314445585, "bce_synth": 0.018166870074346662, "lr": 0.00038625675456174433, "elapsed": 3966.139813894988, "steps_per_second": 10.416873213717665} +{"step": 41400, "loss": 0.01574849912431091, "bce_real": 0.00639969440875575, "bce_synth": 0.01807429944165051, "lr": 0.0003844780860455157, "elapsed": 3978.6012651349884, "steps_per_second": 10.434564244084457} +{"step": 41600, "loss": 0.015819405829533936, "bce_real": 0.00653044663136825, "bce_synth": 0.01813031770288944, "lr": 0.000382696319348826, "elapsed": 3990.4849985960172, "steps_per_second": 10.453661885565024} +{"step": 41800, "loss": 0.015692842211574316, "bce_real": 0.006371417341288179, "bce_synth": 0.018011830961331726, "lr": 0.00038091152481277364, "elapsed": 4002.3367203000234, "steps_per_second": 10.472729797535449} +{"step": 42000, "loss": 0.015748558272607623, "bce_real": 0.006287669627927244, "bce_synth": 0.01810224293731153, "lr": 0.00037912377289799076, "elapsed": 4013.9182437830605, "steps_per_second": 10.492393000094392} +{"step": 42200, "loss": 0.01570044495165348, "bce_real": 0.006336312491912395, "bce_synth": 0.018030058536678554, "lr": 0.0003773331341818617, "elapsed": 4024.9763053350616, "steps_per_second": 10.513313615247808} +{"step": 42400, "loss": 0.01567626385949552, "bce_real": 0.006314805314177647, "bce_synth": 0.018005212182179094, "lr": 0.0003755396793557371, "elapsed": 4036.0920940879732, "steps_per_second": 10.533968199490838} +{"step": 42600, "loss": 0.015688496534712614, "bce_real": 0.0062577850907109675, "bce_synth": 0.01803467362187803, "lr": 0.0003737434792221425, "elapsed": 4047.2009501530556, "steps_per_second": 10.554527145610635} +{"step": 42800, "loss": 0.015658405818976463, "bce_real": 0.006325164947193116, "bce_synth": 0.017980334050953388, "lr": 0.00037194460469198363, "elapsed": 4057.8074103890685, "steps_per_second": 10.57628608186236} +{"step": 43000, "loss": 0.015700046522542834, "bce_real": 0.006384682131465524, "bce_synth": 0.018017527526244522, "lr": 0.00037014312678174675, "elapsed": 4067.3405877120094, "steps_per_second": 10.600735418324092} +{"step": 43200, "loss": 0.015651082289405167, "bce_real": 0.006270082218106836, "bce_synth": 0.017984892185777427, "lr": 0.00036833911661069525, "elapsed": 4075.411756123998, "steps_per_second": 10.628892059435893} +{"step": 43400, "loss": 0.015622034920379519, "bce_real": 0.006259605581872166, "bce_synth": 0.017951224725693465, "lr": 0.0003665326453980616, "elapsed": 4082.546837083064, "steps_per_second": 10.659387241074757} +{"step": 43600, "loss": 0.01554175694938749, "bce_real": 0.006089821339119225, "bce_synth": 0.01789321403950453, "lr": 0.00036472378446023604, "elapsed": 4089.694098448963, "steps_per_second": 10.689743801799017} +{"step": 43800, "loss": 0.015588628221303224, "bce_real": 0.006299555213190615, "bce_synth": 0.017899568444117903, "lr": 0.00036291260520795126, "elapsed": 4096.51446680096, "steps_per_second": 10.720851898340403} +{"step": 44000, "loss": 0.015526785952970386, "bce_real": 0.00613216693745926, "bce_synth": 0.017863983837887645, "lr": 0.00036109917914346285, "elapsed": 4107.045339545002, "steps_per_second": 10.74211642402888} +{"step": 44200, "loss": 0.01548819649964571, "bce_real": 0.0062384375487454236, "bce_synth": 0.017789356093853712, "lr": 0.0003592835778577268, "elapsed": 4118.197070284979, "steps_per_second": 10.761644867610462} +{"step": 44400, "loss": 0.015529543608427048, "bce_real": 0.006179381213150918, "bce_synth": 0.017855681544169784, "lr": 0.000357465873027573, "elapsed": 4129.336430008989, "steps_per_second": 10.781099937127388} +{"step": 44600, "loss": 0.015453584687784315, "bce_real": 0.006138660137075931, "bce_synth": 0.01777095611207187, "lr": 0.0003556461364128757, "elapsed": 4140.51386076503, "steps_per_second": 10.800350472369606} +{"step": 44800, "loss": 0.015472540468908846, "bce_real": 0.006157225267961621, "bce_synth": 0.017790009174495934, "lr": 0.0003538244398537207, "elapsed": 4151.689720856026, "steps_per_second": 10.819501181458161} +{"step": 45000, "loss": 0.015499896416440607, "bce_real": 0.005997061196248979, "bce_synth": 0.017864016480743886, "lr": 0.0003520008552675689, "elapsed": 4162.84971410397, "steps_per_second": 10.838590212511951} +{"step": 45200, "loss": 0.015431508407928049, "bce_real": 0.006100782596040517, "bce_synth": 0.017752811005339028, "lr": 0.00035017545464641707, "elapsed": 4234.07442730898, "steps_per_second": 10.703149083230752} +{"step": 45400, "loss": 0.015463226744905113, "bce_real": 0.006143644694238901, "bce_synth": 0.017781757013872267, "lr": 0.0003483483100539563, "elapsed": 4245.135116602061, "steps_per_second": 10.722424841534822} +{"step": 45600, "loss": 0.015430869478732347, "bce_real": 0.006039193719625473, "bce_synth": 0.0177673352137208, "lr": 0.0003465194936227266, "elapsed": 4255.845164772007, "steps_per_second": 10.74248745294297} +{"step": 45800, "loss": 0.015376528864726425, "bce_real": 0.006044131380040198, "bce_synth": 0.01769824735354632, "lr": 0.00034468907755126903, "elapsed": 4266.907478729961, "steps_per_second": 10.761558257325266} +{"step": 46000, "loss": 0.015385967772454023, "bce_real": 0.006043006202671677, "bce_synth": 0.017710314355790614, "lr": 0.0003428571341012763, "elapsed": 4277.984094343032, "steps_per_second": 10.780494044144357} +{"step": 46200, "loss": 0.01539615285117179, "bce_real": 0.006050322884693742, "bce_synth": 0.017721212990581988, "lr": 0.0003410237355947386, "elapsed": 4289.057971820002, "steps_per_second": 10.799338684139862} +{"step": 46400, "loss": 0.015339250573888422, "bce_real": 0.005976973036304116, "bce_synth": 0.017668402660638093, "lr": 0.0003391889544110898, "elapsed": 4300.152139454032, "steps_per_second": 10.818034845010356} +{"step": 46600, "loss": 0.01534299838822335, "bce_real": 0.00602535524405539, "bce_synth": 0.017661046292632817, "lr": 0.0003373528629843496, "elapsed": 4311.216179943993, "steps_per_second": 10.836710456015561} +{"step": 46800, "loss": 0.015184917747974395, "bce_real": 0.005926413172855974, "bce_synth": 0.01748825308866799, "lr": 0.00033551553380026337, "elapsed": 4322.263999968069, "steps_per_second": 10.855331054004417} +{"step": 47000, "loss": 0.015367570375092328, "bce_real": 0.005985893390607089, "bce_synth": 0.01770154875703156, "lr": 0.00033367703939344147, "elapsed": 4333.3346735120285, "steps_per_second": 10.87379896919405} +{"step": 47200, "loss": 0.015301844938658177, "bce_real": 0.005924269100651145, "bce_synth": 0.017634803028777242, "lr": 0.00033183745234449495, "elapsed": 4344.420917053008, "steps_per_second": 10.892133387306117} +{"step": 47400, "loss": 0.015224090665578843, "bce_real": 0.005814277771860361, "bce_synth": 0.0175650685839355, "lr": 0.0003299968452771707, "elapsed": 4355.182731881039, "steps_per_second": 10.911189037077333} +{"step": 47600, "loss": 0.015284385127015411, "bce_real": 0.00603512714151293, "bce_synth": 0.017585420096293092, "lr": 0.00032815529085548407, "elapsed": 4365.620828484069, "steps_per_second": 10.930963047027742} +{"step": 47800, "loss": 0.015225001843646169, "bce_real": 0.00593243750045076, "bce_synth": 0.01753681058064103, "lr": 0.0003263128617808504, "elapsed": 4376.080172630027, "steps_per_second": 10.950589182226082} +{"step": 48000, "loss": 0.01517591848038137, "bce_real": 0.005846572761656716, "bce_synth": 0.01749687789939344, "lr": 0.0003244696307892148, "elapsed": 4386.531799908029, "steps_per_second": 10.970140835290994} +{"step": 48200, "loss": 0.01515306303743273, "bce_real": 0.005927290616091341, "bce_synth": 0.017448255317285655, "lr": 0.00032262567064818076, "elapsed": 4397.0183866550215, "steps_per_second": 10.989511711738329} +{"step": 48400, "loss": 0.015086058625020087, "bce_real": 0.005819441410712898, "bce_synth": 0.017391412230208517, "lr": 0.00032078105415413725, "elapsed": 4407.466821986018, "steps_per_second": 11.008885712256719} +{"step": 48600, "loss": 0.01511119661387056, "bce_real": 0.005831367967184633, "bce_synth": 0.017419837079942227, "lr": 0.00031893585412938485, "elapsed": 4417.93832883006, "steps_per_second": 11.028110108420748} +{"step": 48800, "loss": 0.015149239292368293, "bce_real": 0.005819838845636696, "bce_synth": 0.01747021209448576, "lr": 0.00031709014341926124, "elapsed": 4428.982430036063, "steps_per_second": 11.045811572787523} diff --git a/shared/package-files/4c/4ce7ce4a27aa0a862571240af91cfda6b60562524af728d75795c432c24c2c7f/fusion-I3s2-30k.log b/shared/package-files/4c/4ce7ce4a27aa0a862571240af91cfda6b60562524af728d75795c432c24c2c7f/fusion-I3s2-30k.log new file mode 100644 index 0000000000000000000000000000000000000000..4b96c698f659cfddf749c32384df78120f335db6 --- /dev/null +++ b/shared/package-files/4c/4ce7ce4a27aa0a862571240af91cfda6b60562524af728d75795c432c24c2c7f/fusion-I3s2-30k.log @@ -0,0 +1,20 @@ +non-domain pool-size bins: 1-1 2-4 5-15 16-63 64-9999 +simulator (released forward branch) all=0.6539 dom=0.8039 non=0.5034 h5=0.8177 h20=0.8925 macro=0.7519 +--- released +released: inverse alone (pool mean) all=0.5139 dom=0.7207 non=0.3062 h5=0.6450 h20=0.7336 macro=0.5898 | -0.1400 [-0.2022,-0.0909] | non-domain by pool size 0.500 0.442 0.106 0.303 0.119 +released: wd=0.75 wn=0.05 c=0.5 all=0.7384 dom=0.9007 non=0.5755 h5=0.8418 h20=0.9104 macro=0.8210 | +0.0000 [+0.0000,+0.0000] | non-domain by pool size 0.748 0.668 0.352 0.573 0.591 +--- I3s2-30k +I3s2-30k: inverse alone (pool mean) all=0.4796 dom=0.6909 non=0.2675 h5=0.6329 h20=0.7233 macro=0.5771 | -0.1743 [-0.2326,-0.1227] | non-domain by pool size 0.515 0.448 0.111 0.234 0.119 +I3s2-30k: wd=0.75 wn=0.05 c=0.5 all=0.7251 dom=0.8905 non=0.5591 h5=0.8398 h20=0.9041 macro=0.8151 | -0.0133 [-0.0225,-0.0056] | non-domain by pool size 0.745 0.678 0.352 0.540 0.591 +--- I3-30k +I3-30k: inverse alone (pool mean) all=0.5113 dom=0.7010 non=0.3209 h5=0.6323 h20=0.7284 macro=0.5738 | -0.1426 [-0.2061,-0.0932] | non-domain by pool size 0.493 0.435 0.102 0.333 0.119 +I3-30k: wd=0.75 wn=0.05 c=0.5 all=0.7276 dom=0.8860 non=0.5686 h5=0.8504 h20=0.9072 macro=0.8107 | -0.0108 [-0.0175,-0.0055] | non-domain by pool size 0.734 0.666 0.352 0.563 0.591 +--- I3-30k+I3s2-30k +I3-30k+I3s2-30k: inverse alone (pool mean) all=0.5003 dom=0.6945 non=0.3054 h5=0.6381 h20=0.7321 macro=0.5877 | -0.1536 [-0.2143,-0.1027] | non-domain by pool size 0.529 0.449 0.081 0.307 0.119 +I3-30k+I3s2-30k: wd=0.75 wn=0.05 c=0.5 all=0.7294 dom=0.8888 non=0.5693 h5=0.8525 h20=0.9049 macro=0.8151 | -0.0090 [-0.0162,-0.0034] | non-domain by pool size 0.741 0.670 0.352 0.563 0.591 +--- I1+I3-30k+I3s2-30k +I1+I3-30k+I3s2-30k: inverse alone (pool mean) all=0.5128 dom=0.7071 non=0.3177 h5=0.6444 h20=0.7273 macro=0.5821 | -0.1411 [-0.2005,-0.0915] | non-domain by pool size 0.500 0.434 0.084 0.332 0.119 +I1+I3-30k+I3s2-30k: wd=0.75 wn=0.05 c=0.5 all=0.7327 dom=0.8953 non=0.5695 h5=0.8385 h20=0.9057 macro=0.8172 | -0.0057 [-0.0106,-0.0016] | non-domain by pool size 0.748 0.666 0.352 0.563 0.591 +--- released+I3s2-30k +released+I3s2-30k: inverse alone (pool mean) all=0.5183 dom=0.7229 non=0.3129 h5=0.6503 h20=0.7332 macro=0.5930 | -0.1356 [-0.1965,-0.0860] | non-domain by pool size 0.515 0.443 0.077 0.320 0.119 +released+I3s2-30k: wd=0.75 wn=0.05 c=0.5 all=0.7358 dom=0.8989 non=0.5720 h5=0.8414 h20=0.9083 macro=0.8184 | -0.0026 [-0.0055,-0.0004] | non-domain by pool size 0.745 0.663 0.352 0.569 0.591 diff --git a/shared/package-files/4e/4ef82aeaa087aad03269437eefe91002a4ad96cffe649d83668d3e39dff4ef51/fused-I10.log b/shared/package-files/4e/4ef82aeaa087aad03269437eefe91002a4ad96cffe649d83668d3e39dff4ef51/fused-I10.log new file mode 100644 index 0000000000000000000000000000000000000000..f1e1b7f42bf0b8d64ed93670afa1713f5a861ad8 --- /dev/null +++ b/shared/package-files/4e/4ef82aeaa087aad03269437eefe91002a4ad96cffe649d83668d3e39dff4ef51/fused-I10.log @@ -0,0 +1,8 @@ +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 | diff=+0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] + pools +0 -0 | macro 0.8379 +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +I9b all=0.7591 dom=0.9227 non=0.5947 h5=0.8761 h20=0.9364 | diff=+0.0110 [+0.0023,+0.0202] | ind 0.6158 +0.0146 [+0.0107,+0.0187] + pools +79 -26 | macro 0.8535 +0.0157 [+0.0100,+0.0216] | without top 20 +0.0123 [+0.0028,+0.0227] | weight min(n,30) +0.0122 [+0.0027,+0.0225] +I10 all=0.7581 dom=0.9196 non=0.5960 h5=0.8741 h20=0.9309 | diff=+0.0100 [+0.0029,+0.0174] | ind 0.6101 +0.0089 [+0.0050,+0.0134] + pools +71 -31 | macro 0.8497 +0.0118 [+0.0059,+0.0177] | without top 20 +0.0112 [+0.0034,+0.0197] | weight min(n,30) +0.0114 [+0.0034,+0.0198] +I10-idf all=0.7582 dom=0.9232 non=0.5926 h5=0.8753 h20=0.9323 | diff=+0.0101 [+0.0001,+0.0206] | ind 0.6221 +0.0208 [+0.0163,+0.0258] + pools +78 -34 | macro 0.8509 +0.0130 [+0.0068,+0.0192] | without top 20 +0.0114 [+0.0009,+0.0228] | weight min(n,30) +0.0119 [+0.0020,+0.0225] diff --git a/shared/package-files/52/5278b60f93799e084a704b100dd25ff89a8bbf52a12a4b7a2c1ba4418e50cc75/I30-ff512x6-real08-corpus2+train3-noise05-merge05.log b/shared/package-files/52/5278b60f93799e084a704b100dd25ff89a8bbf52a12a4b7a2c1ba4418e50cc75/I30-ff512x6-real08-corpus2+train3-noise05-merge05.log new file mode 100644 index 0000000000000000000000000000000000000000..89b7b11fb234253d30434095905e0cbff7c1760f --- /dev/null +++ b/shared/package-files/52/5278b60f93799e084a704b100dd25ff89a8bbf52a12a4b7a2c1ba4418e50cc75/I30-ff512x6-real08-corpus2+train3-noise05-merge05.log @@ -0,0 +1,20 @@ +{"extra_rows": 2031301, "extra_structures": 434950} +{"args": {"store": "/workspace/research/inv", "out": "runs/I30-ff512x6-real08-corpus2+train3-noise05-merge05", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/selfsim/corpus2+train3.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 1, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "noise_rate": 0.5, "noise_max": 12, "noise_scatter": 0.35, "noise_shape": 3.0, "noise_real_rate": 0.0, "synth_peak_drop": -1.0, "synth_jitter": -1.0, "synth_rank_drop": 0.0, "rank_keep": "inv/rank_keep.json", "noise_near": 0.0, "noise_deltas": "inv/noise_deltas.json", "merge_rate": 0.5, "merge_max": 8, "merge_agg": "mean", "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"gen-lm1.manifest.json": null, "gen-x1.manifest.json": null, "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc"}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 17.529065100010484, "extra_store": {"path": "inv/selfsim/corpus2+train3.npz", "rows": 2031301, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/selfsim/train3.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 17.868643710809152, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 43.40271363919601}], "spectra": 2031301, "structures": 434950}}} +{"merge_groups": "real", "groups": 38817, "rows_in_groups_of_2_or_more": 179073} +{"merge_groups": "synth", "groups": 447686, "rows_in_groups_of_2_or_more": 2333477} +{"merge_groups": "extra", "groups": 924501, "rows_in_groups_of_2_or_more": 1629467} +{"step": 5000, "elapsed": 133.64315328502562, "val_loss": 0.036205494174979855, "val_cos": 0.6460887475612326, "val_loss_ema": 0.03399699827285807, "val_cos_ema": 0.6651474549561867} +{"step": 10000, "elapsed": 249.1235861290479, "val_loss": 0.03151948424140058, "val_cos": 0.6954758928944812, "val_loss_ema": 0.029935348395294045, "val_cos_ema": 0.7103893553531447, "ind_cos": 0.46482062895671417, "agg_cos": 0.5079520304699161, "ind_nll": 0.3264192701631582, "agg_nll": 0.3053167944824747, "retrieval_seconds": 11.574011491960846} +{"step": 15000, "elapsed": 417.5194956959458, "val_loss": 0.02927922988994484, "val_cos": 0.7212478517534999, "val_loss_ema": 0.02847903799094017, "val_cos_ema": 0.729312999414535} +{"step": 20000, "elapsed": 574.464228873956, "val_loss": 0.029228342782635655, "val_cos": 0.726608151494705, "val_loss_ema": 0.027952518273666297, "val_cos_ema": 0.7387111757472721, "ind_cos": 0.5164959596479489, "agg_cos": 0.5584435637449174, "ind_nll": 0.41057182562149364, "agg_nll": 0.3914251891502393, "retrieval_seconds": 11.491130881942809} +{"step": 25000, "elapsed": 759.3793747440213, "val_loss": 0.02888980837794522, "val_cos": 0.7347285760412914, "val_loss_ema": 0.028027093847962856, "val_cos_ema": 0.7423353364534009} +{"step": 30000, "elapsed": 927.1543955350062, "val_loss": 0.02922437788497844, "val_cos": 0.7359125996416439, "val_loss_ema": 0.02805266757529016, "val_cos_ema": 0.7456933915434081, "ind_cos": 0.5269442585825312, "agg_cos": 0.5630243450512121, "ind_nll": 0.43620361315559214, "agg_nll": 0.4369756549487879, "retrieval_seconds": 14.846692395047285} +{"step": 35000, "elapsed": 1108.2125012530014, "val_loss": 0.02854514422655486, "val_cos": 0.7440987558063976, "val_loss_ema": 0.028093127044955753, "val_cos_ema": 0.7476223399742331} +{"step": 40000, "elapsed": 1266.0046689569717, "val_loss": 0.027803080468116685, "val_cos": 0.7507588979827191, "val_loss_ema": 0.027863918891304757, "val_cos_ema": 0.750498220785456, "ind_cos": 0.5338411652684132, "agg_cos": 0.5799063255957589, "ind_nll": 0.4459828092027382, "agg_nll": 0.4363580215142313, "retrieval_seconds": 12.535959998029284} +{"step": 45000, "elapsed": 1434.3376057159621, "val_loss": 0.02770436013178693, "val_cos": 0.7518840760147524, "val_loss_ema": 0.027620042540457804, "val_cos_ema": 0.7525687479090535} +{"extra_rows": 2031301, "extra_structures": 434950} +{"args": {"store": "/workspace/research/inv", "out": "runs/I30-ff512x6-real08-corpus2+train3-noise05-merge05", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/selfsim/corpus2+train3.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 1, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "noise_rate": 0.5, "noise_max": 12, "noise_scatter": 0.35, "noise_shape": 3.0, "noise_real_rate": 0.0, "synth_peak_drop": -1.0, "synth_jitter": -1.0, "synth_rank_drop": 0.0, "rank_keep": "inv/rank_keep.json", "noise_near": 0.0, "noise_deltas": "inv/noise_deltas.json", "merge_rate": 0.5, "merge_max": 8, "merge_agg": "mean", "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"gen-lm1.manifest.json": null, "gen-x1.manifest.json": null, "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc"}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 14.095999487035442, "extra_store": {"path": "inv/selfsim/corpus2+train3.npz", "rows": 2031301, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/selfsim/train3.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 17.868643710809152, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 43.40271363919601}], "spectra": 2031301, "structures": 434950}}} +{"merge_groups": "real", "groups": 38817, "rows_in_groups_of_2_or_more": 179073} +{"merge_groups": "synth", "groups": 447686, "rows_in_groups_of_2_or_more": 2333477} +{"merge_groups": "extra", "groups": 924501, "rows_in_groups_of_2_or_more": 1629467} +{"step": 50000, "elapsed": 196.33350355003495, "val_loss": 0.02773355280501984, "val_cos": 0.7525975486868856, "val_loss_ema": 0.027715912407133825, "val_cos_ema": 0.7525127799053606, "ind_cos": 0.5360028822893612, "agg_cos": 0.5746049719491482, "ind_nll": 0.44989448762159656, "agg_nll": 0.44026969993308973, "retrieval_seconds": 12.932473139022477} diff --git a/shared/package-files/52/52aea1dd50b9ba686b7a275666aa54d05055b79364107402f8a358246baf1c44/prepare_inv_synth.log b/shared/package-files/52/52aea1dd50b9ba686b7a275666aa54d05055b79364107402f8a358246baf1c44/prepare_inv_synth.log new file mode 100644 index 0000000000000000000000000000000000000000..9104fe6b10599a2c8c2db7d5a918f427eabdd4a5 --- /dev/null +++ b/shared/package-files/52/52aea1dd50b9ba686b7a275666aa54d05055b79364107402f8a358246baf1c44/prepare_inv_synth.log @@ -0,0 +1,19 @@ +{"labels": 2333485, "label_smiles": 435076, "described": 435076, "seconds": 25.699707704945467} +{"payloads_kept": 2333477, "seconds": 73.92991224303842} +{ + "schema": "allcond-inverse-synth/v1", + "spectra": 2333477, + "structures": 435076, + "peaks": 55998890, + "skipped": { + "structure": 0, + "formula_mismatch": 0 + }, + "max_peaks": 24, + "intensity": "ms2_inten squared, max scaled to 1", + "sources": { + "labels.tsv": "8d6506976f9105bd49fc12c14e7fab2ddfb6d1130d871a10b651ece59c833705" + }, + "sha256": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc", + "elapsed_seconds": 85.61346875096206 +} diff --git a/shared/package-files/52/52b097625c50b6b968135a224c292fa0f0f04b74239e319b374f613c03e20eff/validation.jsonl b/shared/package-files/52/52b097625c50b6b968135a224c292fa0f0f04b74239e319b374f613c03e20eff/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..02a457c5663226c7d783dba4849a928485e8e15f --- /dev/null +++ b/shared/package-files/52/52b097625c50b6b968135a224c292fa0f0f04b74239e319b374f613c03e20eff/validation.jsonl @@ -0,0 +1,6 @@ +{"step": 5000, "elapsed_seconds": 1720.1470045870083, "validation_loss": 0.6858351361006498, "validation_loss_ema": 0.665763633325696} +{"step": 10000, "elapsed_seconds": 4006.942922823, "validation_loss": 0.6131830904632807, "validation_loss_ema": 0.6021978482604027} +{"step": 15000, "elapsed_seconds": 5413.846305023995, "validation_loss": 0.5972776934504509, "validation_loss_ema": 0.5836679264903069} +{"step": 20000, "elapsed_seconds": 7560.000475987006, "validation_loss": 0.5826876293867826, "validation_loss_ema": 0.5726429810747504} +{"step": 25000, "elapsed_seconds": 9265.723246543203, "validation_loss": 0.5748180178925395, "validation_loss_ema": 0.5666035665199161} +{"step": 30000, "elapsed_seconds": 10830.724410500377, "validation_loss": 0.5699510248377919, "validation_loss_ema": 0.5605013528838754} diff --git a/shared/package-files/58/585cee47589c1c0bd45d3632a759adc8f2f88f3574ed1ddd513faf1447ac43f2/train_inv.py b/shared/package-files/58/585cee47589c1c0bd45d3632a759adc8f2f88f3574ed1ddd513faf1447ac43f2/train_inv.py new file mode 100644 index 0000000000000000000000000000000000000000..bf11bc7e57687c7c0a0adaab095f15ab20de805b --- /dev/null +++ b/shared/package-files/58/585cee47589c1c0bd45d3632a759adc8f2f88f3574ed1ddd513faf1447ac43f2/train_inv.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python3 +"""Train the inverse branch (``pkg/inverse.FormulaFormer``): annotated spectrum + formula -> Morgan-4096. + +Training rows: experimental train-fold spectra annotated under their label formula and the +supplied synthetic corpus (``prepare_inv.py``). Validation: (a) fingerprint loss / cosine on +validation spectra annotated under the label formula (diagnostic), (b) the real retrieval +protocol on an inference-style store (every candidate scored with the fingerprint predicted +under its own formula). Validation never contributes a gradient. +""" +import argparse +import copy +import hashlib +import json +import math +import sys +import time +from pathlib import Path + +import numpy as np +import torch +import torch.nn.functional as F + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +sys.path.insert(0, str(HERE)) +import inverse +import invdata +from invrun import PoolStore + + +def targets_of(input_root, cache): + """Index of the labelled candidate of every validation query (evaluation only).""" + cache = Path(cache) + if cache.exists(): + return np.load(cache) + labels = {} + for line in open('/workspace/data/validation.jsonl'): + row = json.loads(line) + labels[row['query_id']] = hashlib.sha256(row['target_smiles'].encode()).hexdigest() + ids = {} + for line in open(Path(input_root) / 'candidate_pools.jsonl'): + pool = json.loads(line) + ids[pool['candidate_pool_id']] = {c['candidate_id']: n for n, c in enumerate(pool['candidates'])} + target = np.array([ids[q['candidate_pool_id']][labels[q['query_id']]] + for q in map(json.loads, open(Path(input_root) / 'queries.jsonl'))], dtype=np.int32) + np.save(cache, target) + return target + + +def retrieval(store, target, dist, pools=None): + """Hit@1 per spectrum and with the pool mean; domain split is reported by the caller.""" + todo = range(len(store.members)) if pools is None else pools + ind, agg, n = 0, 0, 0 + for s in todo: + members = store.members[s] + d = np.stack([dist[i] for i in members]) + t = target[members] + mean = d.mean(0) + ind += int((np.argmin(d, axis=1) == t).sum()) # ties are measure-zero for float scores + agg += int((np.argmin(mean) == t).sum()) + n += len(members) + return ind / n, agg / n + + +def isomer_library(real, synth): + """Same-formula groups over the label molecules of the train fold and of the synthetic corpus. + + Returns (fps [M, bytes], order [M], start [M], size [M]): molecule m (train molecules first, + then synthetic ones) shares its formula with the molecules order[start[m] : start[m] + size[m]]. + No validation or test structure is involved. + """ + def roots(store): + mol = store['mol'].cpu().numpy() + first = np.full(store['fps'].shape[0], -1, dtype=np.int64) + first[mol[::-1]] = np.arange(len(mol))[::-1] + return store['root'].cpu().numpy()[first] + + parts = [roots(real)] + ([roots(synth)] if synth is not None else []) + _, group, counts = np.unique(np.concatenate(parts), axis=0, return_inverse=True, return_counts=True) + group = group.reshape(-1) + order = np.argsort(group, kind='stable') + begin = np.concatenate([[0], np.cumsum(counts)[:-1]]) + device = real['fps'].device + fps = torch.cat([real['fps']] + ([synth['fps']] if synth is not None else [])) + return (fps, torch.from_numpy(order).to(device), torch.from_numpy(begin[group]).to(device), + torch.from_numpy(counts[group]).to(device)) + + +def contrast_term(logits, bits, molecule, library, k, tau, generator): + """InfoNCE of the packaged score (cosine between predicted bit probabilities and a candidate + fingerprint) against ``k`` molecules sampled from the label's own formula group. + + Returns (loss per row [B], target-first indicator [B], rows with at least one decoy [B]).""" + fps, order, start, size = library + pick = (torch.rand(len(molecule), k, device=logits.device, generator=generator) * size[molecule].unsqueeze(1)).long() + decoy = order[start[molecule].unsqueeze(1) + pick.minimum(size[molecule].unsqueeze(1) - 1)] + packed = fps[decoy] # [B, k, bytes] + valid = (packed != fps[molecule].unsqueeze(1)).any(-1) # same fingerprint (or the label itself) = no decoy + cand = torch.cat([bits.unsqueeze(1), inverse.unpack_bits(packed)], dim=1) # [B, 1 + k, bits] + prob = torch.sigmoid(logits.float()) + sim = torch.einsum('bd,bkd->bk', F.normalize(prob, dim=-1), F.normalize(cand, dim=-1)) / tau + keep = torch.cat([torch.ones_like(valid[:, :1]), valid], dim=1) + sim = sim.masked_fill(~keep, float('-inf')) + return -F.log_softmax(sim, dim=1)[:, 0], sim.argmax(1) == 0, valid.any(1) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--store', type=Path, default=Path('/workspace/research/inv')) + p.add_argument('--out', type=Path, required=True) + p.add_argument('--pools', default='pools-validation-input.npz') + p.add_argument('--input', type=Path, default=Path('/workspace/research/validation-input')) + p.add_argument('--steps', type=int, default=100000) + p.add_argument('--batch', type=int, default=512) + p.add_argument('--real-frac', type=float, default=0.2) + p.add_argument('--real-balance', type=float, default=0.5, help='real sampling weight = spectra_of_molecule ** -x') + p.add_argument('--no-synth', action='store_true') + p.add_argument('--target', default='', + help='E56: alternative fingerprint target (inv/alt-NAME built by altfp.py); empty = released Morgan-4096') + p.add_argument('--heavy-boost', type=float, default=1.0, + help='E53: sampling weight of a row x (1 + (boost - 1) * clip((mass - lo) / (hi - lo), 0, 1)); 1 = off') + p.add_argument('--heavy-lo', type=float, default=450.0) + p.add_argument('--heavy-hi', type=float, default=850.0) + p.add_argument('--lr', type=float, default=6e-4) + p.add_argument('--weight-decay', type=float, default=1e-4) + p.add_argument('--warmup', type=int, default=2000) + p.add_argument('--ema', type=float, default=0.999) + p.add_argument('--dim', type=int, default=512) + p.add_argument('--layers', type=int, default=6) + p.add_argument('--heads', type=int, default=8) + p.add_argument('--dropout', type=float, default=0.1) + p.add_argument('--peak-drop', type=float, default=0.3) + p.add_argument('--truncate', type=float, default=0.3) + p.add_argument('--min-keep', type=int, default=4) + p.add_argument('--jitter', type=float, default=0.15) + p.add_argument('--synth-energy-drop', type=float, default=0.3) + p.add_argument('--synth-instrument-drop', type=float, default=0.3) + p.add_argument('--validate-every', type=int, default=5000) + p.add_argument('--retrieve-every', type=int, default=10000) + p.add_argument('--retrieve-pools', type=int, default=0, help='evaluate retrieval on every k-th pool only (0 = all)') + p.add_argument('--seed', type=int, default=1) + p.add_argument('--contrast-weight', type=float, default=0.0, + help='weight of the same-formula decoy InfoNCE term on the cosine score (0 = off)') + p.add_argument('--contrast-k', type=int, default=31, help='decoys sampled per spectrum from its formula group') + p.add_argument('--contrast-tau', type=float, default=0.05) + p.add_argument('--init', type=Path, help='start model and EMA from the EMA weights of one of OUR OWN runs (fresh optimizer)') + p.add_argument('--max-steps-this-run', type=int, default=0) + args = p.parse_args() + + torch.manual_seed(args.seed) + np.random.seed(args.seed) + device = torch.device('cuda') + torch.backends.cuda.matmul.allow_tf32 = True + torch.backends.cudnn.allow_tf32 = True + args.out.mkdir(parents=True, exist_ok=True) + started = time.monotonic() + real = invdata.load_padded(args.store / 'real-train.npz', device) + val = invdata.load_padded(args.store / 'real-validation.npz', device) + synth = None if args.no_synth else invdata.load_padded(args.store / 'synth.npz', device) + per_mol = torch.bincount(real['mol']).float() + real_weight = per_mol[real['mol']] ** -args.real_balance + synth_weight = None + if args.heavy_boost != 1.0: + mono = torch.tensor(inverse.MONO, dtype=torch.float32, device=device) + + def ramp(store): + mass = store['root'].float() @ mono + return 1.0 + (args.heavy_boost - 1.0) * ((mass - args.heavy_lo) / (args.heavy_hi - args.heavy_lo)).clamp(0, 1) + real_weight = real_weight * ramp(real) + if synth is not None: + synth_weight = ramp(synth) + pools = PoolStore(args.store / args.pools, device) if args.pools else None + fp_bits = inverse.FP_BITS + if args.target: + alt = args.store / f'alt-{args.target}' + for store, name in ((real, 'real-train'), (val, 'real-validation'), (synth, 'synth')): + if store is not None: + fps = torch.from_numpy(np.load(alt / f'{name}.fps.npy')).to(device) + assert fps.shape[0] == store['fps'].shape[0] + store['fps'] = fps + fp_bits = real['fps'].shape[1] * 8 + if pools is not None: + fps = torch.from_numpy(np.load(alt / (Path(args.pools).stem + '.cand_fps.npy'))).to(device) + assert fps.shape[0] == pools.cand_fps.shape[0] + pools.cand_fps = fps + target = targets_of(args.input, args.store / f'targets-{args.input.name}.npy') if pools else None + subset = None if not args.retrieve_pools else list(range(0, len(pools.members), args.retrieve_pools)) + domain = None + + model = inverse.FormulaFormer(dim=args.dim, layers=args.layers, heads=args.heads, dropout=args.dropout, fp_bits=fp_bits).to(device) + ema = copy.deepcopy(model).eval() + for q in ema.parameters(): + q.requires_grad_(False) + decay, no_decay = [], [] + for name, q in model.named_parameters(): + (no_decay if q.ndim < 2 else decay).append(q) + opt = torch.optim.AdamW([{'params': decay, 'weight_decay': args.weight_decay}, {'params': no_decay, 'weight_decay': 0.0}], + lr=args.lr, betas=(0.9, 0.98)) + schedule = lambda s: min(1.0, (s + 1) / args.warmup) * (0.02 + 0.98 * 0.5 * (1 + math.cos(math.pi * min(1.0, s / args.steps)))) + step = 0 + last = args.out / 'last.pt' + if args.init and not last.exists(): + state = torch.load(args.init, map_location=device, weights_only=True) + model.load_state_dict(state['ema']) + ema.load_state_dict(state['ema']) + if last.exists(): + state = torch.load(last, map_location=device) + model.load_state_dict(state['model']) + ema.load_state_dict(state['ema']) + opt.load_state_dict(state['opt']) + step = state['step'] + recipe = {'args': {k: str(v) if isinstance(v, Path) else v for k, v in vars(args).items()}, + 'parameters': sum(q.numel() for q in model.parameters()), 'model': model.config, + 'real_rows': int(real['root'].shape[0]), 'synth_rows': 0 if synth is None else int(synth['root'].shape[0]), + 'stores': {f.name: json.loads(f.read_text()).get('sha256') for f in sorted(args.store.glob('*.manifest.json'))}, + 'gpu': torch.cuda.get_device_name(0), 'load_seconds': time.monotonic() - started} + if args.init: + recipe['init'] = {'path': str(args.init), 'sha256': hashlib.sha256(args.init.read_bytes()).hexdigest()} + library = isomer_library(real, synth) if args.contrast_weight > 0 else None + if library is not None: + recipe['isomer_library'] = {'molecules': int(library[0].shape[0]), + 'with_same_formula_molecule': float((library[3] > 1).float().mean())} + (args.out / 'recipe.json').write_text(json.dumps(recipe, indent=1) + '\n') + print(json.dumps(recipe), flush=True) + + gen = torch.Generator(device=device) + gen.manual_seed(args.seed * 1000003 + step) + n_real = args.batch if synth is None else max(1, round(args.batch * args.real_frac)) + n_synth = args.batch - n_real + aug_real = dict(peak_drop=args.peak_drop, truncate=args.truncate, min_keep=args.min_keep, jitter=args.jitter) + aug_synth = dict(aug_real, energy_drop=args.synth_energy_drop, instrument_drop=args.synth_instrument_drop) + + @torch.no_grad() + def validate(net): + net.eval() + loss, cosine, n = 0.0, 0.0, val['root'].shape[0] + for start in range(0, n, 4096): + index = torch.arange(start, min(start + 4096, n), device=device) + with torch.autocast('cuda', dtype=torch.bfloat16): + logits = net(*invdata.batch_of(val, index)).float() + bits = inverse.unpack_bits(val['fps'][val['mol'][index]]) + loss += F.binary_cross_entropy_with_logits(logits, bits, reduction='none').mean(1).sum().item() + cosine += F.cosine_similarity(torch.sigmoid(logits), bits, dim=-1).sum().item() + return loss / n, cosine / n + + def checkpoint(path, full): + state = {'ema': ema.state_dict(), 'config': model.config, 'step': step} + if full: + state.update(model=model.state_dict(), opt=opt.state_dict()) + tmp = path.with_suffix('.tmp') + torch.save(state, tmp) + tmp.replace(path) + + log = (args.out / 'metrics.jsonl').open('a') + run_started, run_step, window = time.monotonic(), step, [] + model.train() + while step < args.steps: + for group in opt.param_groups: + group['lr'] = args.lr * schedule(step) + index = torch.multinomial(real_weight, n_real, replacement=True, generator=gen) + parts = [invdata.batch_of(real, index, aug_real, gen)] + mols = [real['fps'][real['mol'][index]]] + ids = [real['mol'][index]] + if n_synth: + if synth_weight is None: + index = torch.randint(0, synth['root'].shape[0], (n_synth,), device=device, generator=gen) + else: + index = torch.multinomial(synth_weight, n_synth, replacement=True, generator=gen) + parts.append(invdata.batch_of(synth, index, aug_synth, gen)) + mols.append(synth['fps'][synth['mol'][index]]) + ids.append(synth['mol'][index] + real['fps'].shape[0]) + inputs = [torch.cat(x) for x in zip(*parts)] + bits = inverse.unpack_bits(torch.cat(mols)) + with torch.autocast('cuda', dtype=torch.bfloat16): + logits = model(*inputs) + per = F.binary_cross_entropy_with_logits(logits.float(), bits, reduction='none').mean(1) + loss = per.mean() + extra = (0.0, 0.0, 0.0, 0.0) + if library is not None: + nce, first, has = contrast_term(logits, bits, torch.cat(ids), library, args.contrast_k, args.contrast_tau, gen) + loss = loss + args.contrast_weight * nce.mean() + real_has, synth_has = has[:n_real], has[n_real:] + extra = (nce[:n_real][real_has].mean().item() if real_has.any() else 0.0, + nce[n_real:][synth_has].mean().item() if synth_has.any() else 0.0, + first[:n_real][real_has].float().mean().item() if real_has.any() else 0.0, + first[n_real:][synth_has].float().mean().item() if synth_has.any() else 0.0) + opt.zero_grad(set_to_none=True) + loss.backward() + torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) + opt.step() + step += 1 + with torch.no_grad(): + d = min(args.ema, (1 + step) / (10 + step)) + for a, b in zip(ema.parameters(), model.parameters()): + a.lerp_(b, 1 - d) + window.append((loss.item(), per[:n_real].mean().item(), per[n_real:].mean().item() if n_synth else 0.0) + extra) + if step % 200 == 0: + w = np.mean(window, axis=0) + window = [] + row = {'step': step, 'loss': float(w[0]), 'loss_real': float(w[1]), 'loss_synth': float(w[2]), + 'lr': opt.param_groups[0]['lr'], 'elapsed': time.monotonic() - started, + 'steps_per_second': (step - run_step) / (time.monotonic() - run_started)} + if library is not None: + row.update(nce_real=float(w[3]), nce_synth=float(w[4]), first_real=float(w[5]), first_synth=float(w[6])) + log.write(json.dumps(row) + '\n') + log.flush() + if step % args.validate_every == 0 or step == args.steps: + row = {'step': step, 'elapsed': time.monotonic() - started} + row['val_loss'], row['val_cos'] = validate(model) + row['val_loss_ema'], row['val_cos_ema'] = validate(ema) + if pools is not None and (step % args.retrieve_every == 0 or step == args.steps): + tick = time.monotonic() + cos, nll = pools.distances(ema, subset) + row['ind_cos'], row['agg_cos'] = retrieval(pools, target, cos, subset) + row['ind_nll'], row['agg_nll'] = retrieval(pools, target, nll, subset) + row['retrieval_seconds'] = time.monotonic() - tick + checkpoint(args.out / f'step-{step:07d}-ema.pt', False) + print(json.dumps(row), flush=True) + with (args.out / 'validation.jsonl').open('a') as stream: + stream.write(json.dumps(row) + '\n') + checkpoint(last, True) + model.train() + if args.max_steps_this_run and step - run_step >= args.max_steps_this_run: + break + checkpoint(last, True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/58/5883c41ac1c63fc0081c59675091e41e43e4bd43aa9256cbe6914c5f6efe50b6/eval-score-I29.log b/shared/package-files/58/5883c41ac1c63fc0081c59675091e41e43e4bd43aa9256cbe6914c5f6efe50b6/eval-score-I29.log new file mode 100644 index 0000000000000000000000000000000000000000..397412f316eebe3bef4fae5c760e45982dbfc7f9 --- /dev/null +++ b/shared/package-files/58/5883c41ac1c63fc0081c59675091e41e43e4bd43aa9256cbe6914c5f6efe50b6/eval-score-I29.log @@ -0,0 +1,41 @@ +19429 queries, 1 members, 36.6 s +cos pool rule all=0.5965 dom=0.8207 non=0.3713 h5=0.7124 macro=0.7112 +cen pool rule all=0.5751 dom=0.7980 non=0.3513 h5=0.6964 macro=0.6837 +cos_pm pool rule all=0.5965 dom=0.8207 non=0.3713 h5=0.7124 macro=0.7112 +dot pool rule all=0.5764 dom=0.7899 non=0.3620 h5=0.7132 macro=0.6917 +geo pool rule all=0.5767 dom=0.8050 non=0.3474 h5=0.7019 macro=0.6988 +idf05 pool rule all=0.5934 dom=0.8208 non=0.3650 h5=0.7212 macro=0.7129 +idf1 pool rule all=0.5977 dom=0.8259 non=0.3685 h5=0.7240 macro=0.7147 +lin pool rule all=0.5562 dom=0.7770 non=0.3346 h5=0.6776 macro=0.6630 +log01 pool rule all=0.5918 dom=0.8066 non=0.3763 h5=0.7325 macro=0.7005 +log05 pool rule all=0.6023 dom=0.8293 non=0.3744 h5=0.7278 macro=0.7162 +log20 pool rule all=0.6040 dom=0.8288 non=0.3783 h5=0.7221 macro=0.7188 +nll02 pool rule all=0.4206 dom=0.6702 non=0.1699 h5=0.5808 macro=0.5499 +nll10 pool rule all=0.3813 dom=0.6083 non=0.1535 h5=0.5294 macro=0.4908 +poolcen pool rule all=0.5747 dom=0.7931 non=0.3553 h5=0.6975 macro=0.6784 +pow020 pool rule all=0.5675 dom=0.7964 non=0.3377 h5=0.7168 macro=0.6742 +pow030 pool rule all=0.5754 dom=0.8016 non=0.3482 h5=0.7161 macro=0.6855 +pow040 pool rule all=0.5945 dom=0.8119 non=0.3763 h5=0.7330 macro=0.6999 +pow05 pool rule all=0.5986 dom=0.8173 non=0.3790 h5=0.7292 macro=0.7100 +pow05idf025 pool rule all=0.6012 dom=0.8204 non=0.3811 h5=0.7325 macro=0.7085 +pow05idf05 pool rule all=0.6013 dom=0.8231 non=0.3785 h5=0.7329 macro=0.7115 +pow05m pool rule all=0.5986 dom=0.8173 non=0.3790 h5=0.7292 macro=0.7100 +pow05s pool rule all=0.5964 dom=0.8194 non=0.3726 h5=0.7239 macro=0.7106 +pow060 pool rule all=0.6029 dom=0.8253 non=0.3797 h5=0.7261 macro=0.7177 +pow060idf025 pool rule all=0.6058 dom=0.8294 non=0.3813 h5=0.7293 macro=0.7185 +pow060idf050 pool rule all=0.6040 dom=0.8286 non=0.3785 h5=0.7329 macro=0.7168 +pow060m pool rule all=0.6029 dom=0.8253 non=0.3797 h5=0.7261 macro=0.7177 +pow065 pool rule all=0.6030 dom=0.8263 non=0.3789 h5=0.7209 macro=0.7171 +pow070 pool rule all=0.6017 dom=0.8271 non=0.3755 h5=0.7207 macro=0.7168 +pow070idf025 pool rule all=0.6026 dom=0.8284 non=0.3759 h5=0.7230 macro=0.7177 +pow070idf050 pool rule all=0.6027 dom=0.8286 non=0.3759 h5=0.7266 macro=0.7168 +pow070m pool rule all=0.6017 dom=0.8271 non=0.3755 h5=0.7207 macro=0.7168 +pow075 pool rule all=0.6027 dom=0.8275 non=0.3770 h5=0.7208 macro=0.7185 +pow080 pool rule all=0.5996 dom=0.8257 non=0.3726 h5=0.7195 macro=0.7162 +pow080m pool rule all=0.5996 dom=0.8257 non=0.3726 h5=0.7195 macro=0.7162 +pow085 pool rule all=0.5995 dom=0.8261 non=0.3720 h5=0.7177 macro=0.7159 +pow085idf025 pool rule all=0.6002 dom=0.8277 non=0.3718 h5=0.7213 macro=0.7177 +pow085idf050 pool rule all=0.6028 dom=0.8306 non=0.3741 h5=0.7247 macro=0.7174 +pow090 pool rule all=0.5974 dom=0.8239 non=0.3700 h5=0.7175 macro=0.7153 +pow2 pool rule all=0.5645 dom=0.7893 non=0.3388 h5=0.6893 macro=0.6787 +tani pool rule all=0.5748 dom=0.7960 non=0.3527 h5=0.7132 macro=0.6881 diff --git a/shared/package-files/58/589f634ffe9a69adeedf8d3781457df44ef41c63e956f9f231f23583752c1125/formula_strata.py b/shared/package-files/58/589f634ffe9a69adeedf8d3781457df44ef41c63e956f9f231f23583752c1125/formula_strata.py new file mode 100644 index 0000000000000000000000000000000000000000..cbb7e46820eea20c4f5f1d89507df7bea4e9a2ff --- /dev/null +++ b/shared/package-files/58/589f634ffe9a69adeedf8d3781457df44ef41c63e956f9f231f23583752c1125/formula_strata.py @@ -0,0 +1,116 @@ +"""Branches and fusion weights by the formula make-up of the candidate pool (lab, E74; labels evaluate only) + +formula_strata.py [--pred evals/fullfold/5Ms-N5u48-L-ion-net2/pred] [--scan] + +A pool whose candidates share one formula asks for isomer discrimination; a pool with many formulae +can be solved by the formula alone. ``hom`` = share of the pool's candidates that carry the pool's +most frequent formula (a property of the candidate pool, no label). Prints, by stratum of ``hom``, +Hit@1 of the forward and inverse branches alone, of the released rule without and with the consensus +term; ``--scan`` rescales the inverse / library weights inside one stratum (rule without consensus). +""" +import argparse +import json +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import netprop +import scorelab + +ROOT = netprop.ROOT + + +def fused(queries, pools, pred, config, factor): + """netprop.released with a per-query factor on the inverse and library weights: factor[i] = (inverse, library).""" + sizes = {} + for q in queries: + sizes[q['candidate_pool_id']] = sizes.get(q['candidate_pool_id'], 0) + 1 + out = [] + for i, q in enumerate(queries): + qid = q['query_id'] + n = len(pools[q['candidate_pool_id']]) + domain = q['adduct'] == '[M+H]+' and q.get('collision_energy') is not None + size = sizes[q['candidate_pool_id']] + d = pred['distances'].get(qid) + for name, fill, scale in (('inverse', 1.0, factor[i][0]), ('library', 0.0, factor[i][1]), ('ion', None, 1.0)): + part = config[name] + extra = pred[name].get(qid) + if extra is None: + continue + weight = scale * (part['weight_domain'] if domain else max(part['weight_other'], part.get('weight_other_single', 0.0) / size)) + if weight == 0: + continue + if fill is not None: + extra = np.where(np.isfinite(extra), extra, fill) + d = (d if d is not None else np.ones(n)) + weight * extra + out.append(d) + return out + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--pred', default='evals/fullfold/5Ms-N5u48-L-ion-net2/pred') + p.add_argument('--config', default='builds/5Ms-N5u48-L-ion-net2/model_config.json') + p.add_argument('--store', default='inv/p48/pools-validation-input.npz') + p.add_argument('--scan', action='store_true') + args = p.parse_args() + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + config = json.load(open(ROOT / args.config)) + pred = {name: pickle.load(open(ROOT / args.pred / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion', 'consensus')} + z = np.load(ROOT / args.store) + start, cf = z['pool_cand_start'], z['cand_formula'] + slot = {pid: n for n, pid in enumerate(z['pool_id'].tolist())} + hom, distinct, label_share = np.zeros(len(queries)), np.zeros(len(queries)), np.zeros(len(queries)) + for i, q in enumerate(queries): + s = slot[q['candidate_pool_id']] + f = cf[start[s]:start[s + 1]] + assert len(f) == len(pools[q['candidate_pool_id']]) + _, counts = np.unique(f, return_counts=True) + hom[i], distinct[i] = counts.max() / len(f), len(counts) + label_share[i] = np.mean(f == f[ev.target[i]]) + first = np.array([m[0] for m in ev.by_pool.values()]) + dom = ev.domain + ones = [(1.0, 1.0)] * len(queries) + get = lambda name: [pred[name].get(q['query_id']) for q in queries] + base = fused(queries, pools, pred, config, ones) + check = netprop.released(queries, pools, pred, config) + assert all((a is None and b is None) or np.array_equal(a, b) for a, b in zip(base, check)) + full = [b if (b is None or t is None) else b + t for b, t in zip(base, get('consensus'))] + ranks = {'forward': ev.ranks(get('distances'), 1.0), 'inverse': ev.ranks(get('inverse'), 1.0), + 'rule': ev.ranks(base, 1.0), 'full': ev.ranks(full, 1.0)} + print('all: ' + ' '.join(f'{k} {np.mean(r == 0):.4f} / macro {np.mean(r[first] == 0):.4f}' for k, r in ranks.items())) + edges = [0, 0.1, 0.25, 0.5, 0.75, 0.95, 1.0001] + for title, value in (('hom (share of the modal formula; label-free)', hom), ('share of candidates with the label formula (analysis only)', label_share)): + print(title) + for part, mask in (('domain', dom), ('other', ~dom)): + for lo, hi in zip(edges[:-1], edges[1:]): + m = mask & (value >= lo) & (value < hi) + mp = m[first] + if not m.any(): + continue + print(f' {part:6s} [{lo:.2f}, {min(hi, 1.0):.2f}{")" if hi <= 1 else "]"} queries {int(m.sum()):5d} pools {int(mp.sum()):4d} | ' + + ' '.join(f'{k} {np.mean(r[m] == 0):.3f}/{np.mean(r[first][mp] == 0) if mp.any() else float("nan"):.3f}' for k, r in ranks.items()) + + f' | full Hit@5 {np.mean(ranks["full"][m] < 5):.3f} Hit@20 {np.mean(ranks["full"][m] < 20):.3f}') + if not args.scan: + return + hr = ranks['rule'] == 0 + print('scan (rule without consensus): factor on the inverse / library weight inside a stratum of hom; per-query and pool-macro difference') + for lo, hi in ((0.75, 1.0001), (0.5, 1.0001), (0.95, 1.0001), (0.0, 0.25), (0.0, 0.5)): + for part, mask in (('domain', dom), ('other', ~dom)): + m = mask & (hom >= lo) & (hom < hi) + for fi, fl in ((0.0, 1.0), (0.5, 1.0), (2.0, 1.0), (4.0, 1.0), (1.0, 0.0), (1.0, 2.0), (1.0, 4.0)): + factor = [(fi, fl) if x else (1.0, 1.0) for x in m] + r = ev.ranks(fused(queries, pools, pred, config, factor), 1.0) + h = r == 0 + d = h[first].astype(float) - hr[first].astype(float) + macro = d[ev.boot].mean(axis=1) + print(f' {part:6s} hom [{lo:.2f}, {min(hi, 1.0):.2f}] inverse x{fi:g} library x{fl:g}: stratum {np.mean(h[m]):.4f} ({np.mean(h[m]) - np.mean(hr[m]):+.4f}) | all {h.mean() - hr.mean():+.4f} ' + f'macro {d.mean():+.4f} [{np.percentile(macro, 2.5):+.4f}, {np.percentile(macro, 97.5):+.4f}] pools +{int((d > 0).sum())} -{int((d < 0).sum())}', flush=True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/59/593c17d4ed48967f6df338f0084ebdd2dcff4de7cda59effb29d26707aad6659/verify-5Ms-N5-L-ion-net2.sh b/shared/package-files/59/593c17d4ed48967f6df338f0084ebdd2dcff4de7cda59effb29d26707aad6659/verify-5Ms-N5-L-ion-net2.sh new file mode 100644 index 0000000000000000000000000000000000000000..a4786e1d34b33341e5184e90a464db860c1d7270 --- /dev/null +++ b/shared/package-files/59/593c17d4ed48967f6df338f0084ebdd2dcff4de7cda59effb29d26707aad6659/verify-5Ms-N5-L-ion-net2.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# Candidate build 5Ms-N5-L-ion-net2 (= 5Ms-N5-L-ion-net with the bit-reproducible consensus sums): +# (1) packaged full-fold run with the five members' saved simulations + official scorer paired against the release, +# (2) the same run again (clean timing, rankings must be byte-identical), (3) end-to-end replays. +cd /workspace/research +PY=/opt/glacier/bin/python +N=5Ms-N5-L-ion-net2; B=5Ms-I9b+I13-L-ion-net +mkdir -p evals/fullfold/$N evals/fullfold/$N-again +CUDA_MPS_PIPE_DIRECTORY=/tmp/mps $PY allcond/checks/measure.py taskset -c 11-24 $PY builds/$N/infer.py validation-input evals/fullfold/$N --load-predictions evals/stack/5M-S2-30k --save-predictions evals/fullfold/$N/pred --workers 13 > logs/fullfold-$N-saved-simulations.log 2>&1 +CUDA_MPS_PIPE_DIRECTORY=/tmp/mps $PY allcond/checks/measure.py taskset -c 11-24 $PY builds/$N/infer.py validation-input evals/fullfold/$N-again --load-predictions evals/stack/5M-S2-30k --save-predictions evals/fullfold/$N-again/pred --workers 13 > logs/fullfold-$N-saved-simulations-again.log 2>&1 +cmp evals/fullfold/$N/rankings.jsonl evals/fullfold/$N-again/rankings.jsonl > logs/fullfold-$N-again.cmp 2>&1; echo "cmp exit $?" >> logs/fullfold-$N-again.cmp +for f in distances inverse library ion consensus; do cmp evals/fullfold/$N/pred/$f.pkl evals/fullfold/$N-again/pred/$f.pkl >> logs/fullfold-$N-again.cmp 2>&1; echo "cmp $f exit $?" >> logs/fullfold-$N-again.cmp; done +rm -rf evals/fullfold/$N-again/pred +date -u +%H:%M:%S > logs/fullfold-$N.done +for pair in val-tiny:tiny edge-input:edge val-sub:sub; do + input=${pair%%:*}; tag=${pair##*:}; name=$input; [ "$input" = edge-input ] && name=edge + bash allcond/checks/replay.sh builds/$N /workspace/research/$input n52-$tag 8-23 > logs/replay-$N-$name.log 2>&1 + mkdir -p evals/replay/$N-$tag; cp /tmp/reloc-n52-$tag/out/rankings.jsonl evals/replay/$N-$tag/rankings.jsonl +done +date -u +%H:%M:%S > logs/replays-$N.done diff --git a/shared/package-files/59/593c6357461942d018b8d7a742b855315338b87fd0dbac62c8d5d9874be7143a/summary.txt b/shared/package-files/59/593c6357461942d018b8d7a742b855315338b87fd0dbac62c8d5d9874be7143a/summary.txt new file mode 100644 index 0000000000000000000000000000000000000000..aa64ba3304a1ff27e5176ab5dd73c4bf3b235f43 --- /dev/null +++ b/shared/package-files/59/593c6357461942d018b8d7a742b855315338b87fd0dbac62c8d5d9874be7143a/summary.txt @@ -0,0 +1,48 @@ +evals/B45k-full/report-ind.json + {'hit_rate_at_1': 0.459, 'hit_rate_at_20': 0.6892, 'hit_rate_at_5': 0.5976} CI 0.426 0.4912 n 19429 valid 19429 err None + adduct {'[M+H]+': (0.565, 14692), '[M+Na]+': (0.13, 4737)} + instrument_type {'': (0.533, 486), 'Orbitrap': (0.454, 16439), 'QTOF': (0.476, 2504)} + collision_energy {'20-39.999': (0.725, 4088), '40-59.999': (0.713, 1567), '<20': (0.529, 1200), '>=60': (0.702, 3120), 'missing': (0.213, 9454)} + routing_domain {'fallback': (0.215, 9695), 'glacier_released': (0.702, 9734)} +evals/B45k-full/report-agg1.json + {'hit_rate_at_1': 0.6033, 'hit_rate_at_20': 0.8615, 'hit_rate_at_5': 0.7666} CI 0.5534 0.6505 n 19429 valid 19429 err None + adduct {'[M+H]+': (0.697, 14692), '[M+Na]+': (0.314, 4737)} + instrument_type {'': (0.621, 486), 'Orbitrap': (0.607, 16439), 'QTOF': (0.578, 2504)} + collision_energy {'20-39.999': (0.827, 4088), '40-59.999': (0.766, 1567), '<20': (0.659, 1200), '>=60': (0.833, 3120), 'missing': (0.397, 9454)} + routing_domain {'fallback': (0.399, 9695), 'glacier_released': (0.807, 9734)} +all n=19429 hit1_ind=0.464 hit1_agg=0.603 h5_agg=0.767 h20_agg=0.862 npk=15 d_t=0.646 d_min=0.591 ties=0.22 cands=256 +('H', 'ce') n= 9734 hit1_ind=0.702 hit1_agg=0.807 h5_agg=0.937 h20_agg=0.977 npk=19 d_t=0.501 d_min=0.477 ties=0.01 cands=256 +('H', 'ceNA') n= 4958 hit1_ind=0.303 hit1_agg=0.480 h5_agg=0.644 h20_agg=0.772 npk=12 d_t=0.924 d_min=0.803 ties=0.41 cands=256 +('Na', 'ce') n= 241 hit1_ind=0.290 hit1_agg=0.502 h5_agg=0.784 h20_agg=0.892 npk=10 d_t=0.604 d_min=0.535 ties=0.06 cands=256 +('Na', 'ceNA') n= 4496 hit1_ind=0.137 hit1_agg=0.304 h5_agg=0.532 h20_agg=0.708 npk=9 d_t=0.987 d_min=0.817 ties=0.46 cands=256 +('H', 'ce', 'Orbitrap') n= 8211 hit1_ind=0.752 hit1_agg=0.854 h5_agg=0.962 h20_agg=0.990 npk=20 d_t=0.481 d_min=0.462 ties=0.00 cands=256 +('H', 'ce', 'QTOF') n= 1523 hit1_ind=0.432 hit1_agg=0.549 h5_agg=0.803 h20_agg=0.909 npk=18 d_t=0.651 d_min=0.576 ties=0.02 cands=256 +('H', 'ceNA', 'Orbitrap') n= 3987 hit1_ind=0.223 hit1_agg=0.434 h5_agg=0.588 h20_agg=0.729 npk=9 d_t=1.000 d_min=0.880 ties=0.51 cands=256 +('H', 'ceNA', 'QTOF') n= 672 hit1_ind=0.637 hit1_agg=0.670 h5_agg=0.874 h20_agg=0.946 npk=64 d_t=0.599 d_min=0.585 ties=0.01 cands=256 +('H', 'ceNA', 'none') n= 299 hit1_ind=0.619 hit1_agg=0.672 h5_agg=0.880 h20_agg=0.960 npk=111 d_t=0.603 d_min=0.582 ties=0.01 cands=256 +('Na', 'ce', 'Orbitrap') n= 159 hit1_ind=0.289 hit1_agg=0.484 h5_agg=0.799 h20_agg=0.918 npk=10 d_t=0.602 d_min=0.561 ties=0.05 cands=256 +('Na', 'ce', 'QTOF') n= 82 hit1_ind=0.293 hit1_agg=0.537 h5_agg=0.756 h20_agg=0.841 npk=9 d_t=0.651 d_min=0.399 ties=0.09 cands=256 +('Na', 'ceNA', 'Orbitrap') n= 4082 hit1_ind=0.112 hit1_agg=0.281 h5_agg=0.508 h20_agg=0.687 npk=8 d_t=1.000 d_min=0.861 ties=0.51 cands=256 +('Na', 'ceNA', 'QTOF') n= 227 hit1_ind=0.366 hit1_agg=0.520 h5_agg=0.767 h20_agg=0.903 npk=88 d_t=0.610 d_min=0.575 ties=0.03 cands=256 +('Na', 'ceNA', 'none') n= 187 hit1_ind=0.396 hit1_agg=0.540 h5_agg=0.781 h20_agg=0.925 npk=102 d_t=0.625 d_min=0.589 ties=0.01 cands=256 +--- non-domain queries by pool composition +nondomain, pool has domain spectra n= 1272 hit1_ind=0.344 hit1_agg=0.478 h5_agg=0.725 h20_agg=0.856 npk=28 d_t=0.649 d_min=0.595 ties=0.18 cands=256 +nondomain, pool has no domain spectra n= 8423 hit1_ind=0.208 hit1_agg=0.387 h5_agg=0.576 h20_agg=0.729 npk=9 d_t=0.985 d_min=0.838 ties=0.46 cands=256 +--- by number of peaks +npk [1,3) n= 1370 hit1_ind=0.132 hit1_agg=0.361 h5_agg=0.531 h20_agg=0.643 npk=2 d_t=1.000 d_min=0.964 ties=0.68 cands=256 +npk [3,6) n= 2640 hit1_ind=0.266 hit1_agg=0.477 h5_agg=0.660 h20_agg=0.770 npk=4 d_t=0.947 d_min=0.715 ties=0.45 cands=256 +npk [6,11) n= 3655 hit1_ind=0.335 hit1_agg=0.491 h5_agg=0.700 h20_agg=0.825 npk=8 d_t=0.742 d_min=0.618 ties=0.31 cands=256 +npk [11,21) n= 4376 hit1_ind=0.509 hit1_agg=0.647 h5_agg=0.783 h20_agg=0.878 npk=15 d_t=0.594 d_min=0.549 ties=0.16 cands=256 +npk [21,51) n= 4471 hit1_ind=0.637 hit1_agg=0.728 h5_agg=0.860 h20_agg=0.933 npk=31 d_t=0.582 d_min=0.555 ties=0.05 cands=256 +npk [51,1000000) n= 2917 hit1_ind=0.632 hit1_agg=0.716 h5_agg=0.890 h20_agg=0.958 npk=86 d_t=0.597 d_min=0.577 ties=0.01 cands=256 +--- by pool size (queries per pool) +pool_n [1,2) n= 431 hit1_ind=0.698 hit1_agg=0.698 h5_agg=0.868 h20_agg=0.940 npk=41 d_t=0.588 d_min=0.566 ties=0.03 cands=256 +pool_n [2,4) n= 5762 hit1_ind=0.765 hit1_agg=0.838 h5_agg=0.937 h20_agg=0.968 npk=22 d_t=0.483 d_min=0.469 ties=0.01 cands=256 +pool_n [4,8) n= 1969 hit1_ind=0.583 hit1_agg=0.713 h5_agg=0.848 h20_agg=0.921 npk=22 d_t=0.538 d_min=0.503 ties=0.06 cands=256 +pool_n [8,16) n= 2219 hit1_ind=0.502 hit1_agg=0.626 h5_agg=0.807 h20_agg=0.867 npk=17 d_t=0.597 d_min=0.544 ties=0.12 cands=256 +pool_n [16,1000000) n= 9048 hit1_ind=0.227 hit1_agg=0.420 h5_agg=0.626 h20_agg=0.776 npk=9 d_t=0.937 d_min=0.791 ties=0.41 cands=256 +--- by candidates +cands [32,128) n= 36 hit1_ind=0.111 hit1_agg=0.111 h5_agg=0.167 h20_agg=0.167 npk=5 d_t=1.000 d_min=1.000 ties=0.83 cands=90 +cands [128,256) n= 241 hit1_ind=0.278 hit1_agg=0.390 h5_agg=0.481 h20_agg=0.913 npk=20 d_t=0.689 d_min=0.627 ties=0.12 cands=219 +cands [256,257) n=19152 hit1_ind=0.467 hit1_agg=0.607 h5_agg=0.771 h20_agg=0.862 npk=15 d_t=0.644 d_min=0.590 ties=0.22 cands=256 +pool-level hit1_agg (pools weighted equally): 0.7525103366804489 3386 diff --git a/shared/package-files/59/5988144966ac18c19fdea348fe6e62d70ea1eb66c4dbdb3d1aa5ad07cb7fb207/preparation.json b/shared/package-files/59/5988144966ac18c19fdea348fe6e62d70ea1eb66c4dbdb3d1aa5ad07cb7fb207/preparation.json new file mode 100644 index 0000000000000000000000000000000000000000..950d888111c262c53a8f585c4cdf80bbdfa01a3d --- /dev/null +++ b/shared/package-files/59/5988144966ac18c19fdea348fe6e62d70ea1eb66c4dbdb3d1aa5ad07cb7fb207/preparation.json @@ -0,0 +1,14 @@ +{ + "source_files": { + "train": "de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc", + "validation": "26788b56a3cb9d19c265c925504a4ce4e77e4c6b65b2a11068be6f24d15bf70f" + }, + "limits": [ + null, + null + ], + "max_peaks": 50, + "ppm_diff": 20, + "domain": "all_conditions", + "reuse": "/workspace/data/glacier/targets.sqlite" +} diff --git a/shared/package-files/59/5999fa5940a7291464cfc9046341adb3c981b1c319a0e0ed74c52f7a886fe8f5/recipe.json b/shared/package-files/59/5999fa5940a7291464cfc9046341adb3c981b1c319a0e0ed74c52f7a886fe8f5/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..9fb2797effae463e09be72a63f40bfce6d96b4a2 --- /dev/null +++ b/shared/package-files/59/5999fa5940a7291464cfc9046341adb3c981b1c319a0e0ed74c52f7a886fe8f5/recipe.json @@ -0,0 +1,56 @@ +{ + "args": { + "store": "/workspace/research/inv", + "out": "runs/I3s2-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 2, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "init": null, + "max_steps_this_run": 0 + }, + "parameters": 24997832, + "model": { + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "pair_dim": 64, + "fp_bits": 4096, + "max_energy": 200.0 + }, + "real_rows": 194119, + "synth_rows": 2333477, + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "gpu": "NVIDIA H100 80GB HBM3", + "load_seconds": 10.510149601032026 +} diff --git a/shared/package-files/59/59b83597c19a4476c68fa2f8eab8a6caf862980f0689b65841158d55d9b3fb6b/metrics.jsonl b/shared/package-files/59/59b83597c19a4476c68fa2f8eab8a6caf862980f0689b65841158d55d9b3fb6b/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..8ce90412719a7cff11f02557bbd50f1b2a38148b --- /dev/null +++ b/shared/package-files/59/59b83597c19a4476c68fa2f8eab8a6caf862980f0689b65841158d55d9b3fb6b/metrics.jsonl @@ -0,0 +1,268 @@ +{"step": 200, "loss": 0.32957695741206405, "loss_real": 0.32818865064531566, "loss_synth": 0.32942220907658337, "lr": 5.999770185426209e-05, "elapsed": 23.115930685773492, "steps_per_second": 29.343780134199328, "loss_extra": 0.3297665154933929} +{"step": 400, "loss": 0.04817979151383042, "loss_real": 0.04408035719767213, "loss_synth": 0.04873022448271513, "lr": 0.0001199815230572914, "elapsed": 29.484689720906317, "steps_per_second": 30.338624968581435, "loss_extra": 0.0484883738681674} +{"step": 600, "loss": 0.044727759622037414, "loss_real": 0.038977617640048264, "loss_synth": 0.04538078075274825, "lr": 0.00017993754018322624, "elapsed": 35.87830583192408, "steps_per_second": 30.64644162651474, "loss_extra": 0.045190283227711917} +{"step": 800, "loss": 0.042550722546875475, "loss_real": 0.03563130935654044, "loss_synth": 0.043177874181419613, "lr": 0.0002398518371215969, "elapsed": 42.24628462875262, "steps_per_second": 30.83314059433162, "loss_extra": 0.043146858345717194} +{"step": 1000, "loss": 0.04147294733673334, "loss_real": 0.03433993637561798, "loss_synth": 0.04210268238559365, "lr": 0.0002997105087403322, "elapsed": 48.59847662365064, "steps_per_second": 30.961381754209235, "loss_extra": 0.04209166871383786} +{"step": 1200, "loss": 0.04054982645437121, "loss_real": 0.03328712325543165, "loss_synth": 0.041220223717391494, "lr": 0.00035949966454633923, "elapsed": 55.008544127922505, "steps_per_second": 31.001049042453477, "loss_extra": 0.041172513589262966} +{"step": 1400, "loss": 0.03973406661301851, "loss_real": 0.03242598676122725, "loss_synth": 0.04038068456575274, "lr": 0.0004192054323428467, "elapsed": 61.313961348030716, "steps_per_second": 31.101583829868023, "loss_extra": 0.04036761783063412} +{"step": 1600, "loss": 0.03895475467666984, "loss_real": 0.0319119786657393, "loss_synth": 0.03967155704274774, "lr": 0.0004788139618827038, "elapsed": 67.64474737970158, "steps_per_second": 31.16200934734992, "loss_extra": 0.03954195342957974} +{"step": 1800, "loss": 0.038362546879798176, "loss_real": 0.031205358086153864, "loss_synth": 0.03885487115010619, "lr": 0.000538311428516825, "elapsed": 74.04780572094023, "steps_per_second": 31.170110279544925, "loss_extra": 0.03901815952733159} +{"step": 2000, "loss": 0.037688605189323425, "loss_real": 0.030520912036299707, "loss_synth": 0.03837374646216631, "lr": 0.0005976840368369773, "elapsed": 80.41504769492894, "steps_per_second": 31.194011102712867, "loss_extra": 0.038297283593565226} +{"step": 2200, "loss": 0.037091736141592266, "loss_real": 0.030292816488072277, "loss_synth": 0.03766398856416345, "lr": 0.0005971982039200904, "elapsed": 86.79548451164737, "steps_per_second": 31.20775078245672, "loss_extra": 0.03768845647573471} +{"step": 2400, "loss": 0.03638402730226517, "loss_real": 0.029634642461314798, "loss_synth": 0.036959289461374285, "lr": 0.000596666387431128, "elapsed": 93.19304493069649, "steps_per_second": 31.212257417753836, "loss_extra": 0.03697461036965251} +{"step": 2600, "loss": 0.03575370080769062, "loss_real": 0.02918797836638987, "loss_synth": 0.03650140881538391, "lr": 0.0005960886713500785, "elapsed": 99.56197053007782, "steps_per_second": 31.22680736632159, "loss_extra": 0.03628131281584501} +{"step": 2800, "loss": 0.03519040327519178, "loss_real": 0.028928626570850612, "loss_synth": 0.03582253275439143, "lr": 0.0005954651469050082, "elapsed": 105.93975950684398, "steps_per_second": 31.23620067565087, "loss_extra": 0.03571377824991941} +{"step": 3000, "loss": 0.03473290169611573, "loss_real": 0.028368132207542657, "loss_synth": 0.03552446890622377, "lr": 0.0005947959125576553, "elapsed": 112.38392994692549, "steps_per_second": 31.222760313932028, "loss_extra": 0.03522772382944822} +{"step": 3200, "loss": 0.03426121897995472, "loss_real": 0.02784906596876681, "loss_synth": 0.03487357808277011, "lr": 0.000594081073987881, "elapsed": 118.86750110890716, "steps_per_second": 31.199019914327184, "loss_extra": 0.034805877152830365} +{"step": 3400, "loss": 0.03388602044433355, "loss_real": 0.02769606270827353, "loss_synth": 0.03456632876768708, "lr": 0.0005933207440769824, "elapsed": 125.34595886804163, "steps_per_second": 31.17956445290888, "loss_extra": 0.03438957178965211} +{"step": 3600, "loss": 0.03353863764554262, "loss_real": 0.027291189441457392, "loss_synth": 0.03424252321943641, "lr": 0.0005925150428898661, "elapsed": 131.8096608100459, "steps_per_second": 31.166271976239813, "loss_extra": 0.03404256299138069} +{"step": 3800, "loss": 0.033200780395418406, "loss_real": 0.027108564814552663, "loss_synth": 0.034111530873924496, "lr": 0.0005916640976560898, "elapsed": 138.2637044689618, "steps_per_second": 31.156855387856602, "loss_extra": 0.03363624403253198} +{"step": 4000, "loss": 0.032779595162719485, "loss_real": 0.02660316308028996, "loss_synth": 0.033759163282811644, "lr": 0.0005907680427497705, "elapsed": 144.7255579456687, "steps_per_second": 31.146491138075458, "loss_extra": 0.03320705903694034} +{"step": 4200, "loss": 0.03247777834534645, "loss_real": 0.026676429454237222, "loss_synth": 0.033028265526518226, "lr": 0.000589827019668365, "elapsed": 151.1881873169914, "steps_per_second": 31.136940749233617, "loss_extra": 0.03297143623232841} +{"step": 4400, "loss": 0.03223966836929321, "loss_real": 0.026396122267469763, "loss_synth": 0.03289422219619155, "lr": 0.0005888411770103267, "elapsed": 157.64698242396116, "steps_per_second": 31.129108087404333, "loss_extra": 0.03271196803078055} +{"step": 4600, "loss": 0.03196478578262031, "loss_real": 0.02631563170813024, "loss_synth": 0.03274953199550509, "lr": 0.0005878106704516395, "elapsed": 164.20104348799214, "steps_per_second": 31.10191371741033, "loss_extra": 0.032383483005687594} +{"step": 4800, "loss": 0.031682245740666984, "loss_real": 0.02630255381576717, "loss_synth": 0.03235966286621988, "lr": 0.0005867356627212351, "elapsed": 170.71045984886587, "steps_per_second": 31.08601249684905, "loss_extra": 0.0320983990188688} +{"step": 5000, "loss": 0.031451104069128634, "loss_real": 0.02613168613985181, "loss_synth": 0.03214803615584969, "lr": 0.000585616323575296, "elapsed": 177.18541580298916, "steps_per_second": 31.07805305810804, "loss_extra": 0.03185583642683923} +{"step": 5200, "loss": 0.031241862904280424, "loss_real": 0.025741358892992137, "loss_synth": 0.03205850842408836, "lr": 0.000584452829770449, "elapsed": 184.8975640097633, "steps_per_second": 30.842708043368102, "loss_extra": 0.03163644003681838} +{"step": 5400, "loss": 0.030950934877619147, "loss_real": 0.02544438431970775, "loss_synth": 0.031638168208301065, "lr": 0.0005832453650358537, "elapsed": 191.50864270469174, "steps_per_second": 30.820428453267446, "loss_extra": 0.03137843698263168} +{"step": 5600, "loss": 0.030743547501042485, "loss_real": 0.025593215813860298, "loss_synth": 0.03145322040654719, "lr": 0.0005819941200441891, "elapsed": 198.0946574760601, "steps_per_second": 30.80401544133238, "loss_extra": 0.031126714646816253} +{"step": 5800, "loss": 0.030587258627638222, "loss_real": 0.02533946760930121, "loss_synth": 0.031375052025541667, "lr": 0.0005806992923815441, "elapsed": 204.7109687277116, "steps_per_second": 30.783799220694043, "loss_extra": 0.03096154659986496} +{"step": 6000, "loss": 0.030406038174405695, "loss_real": 0.024795288471505045, "loss_synth": 0.031209796499460936, "lr": 0.0005793610865162167, "elapsed": 211.32495246594772, "steps_per_second": 30.765321859464375, "loss_extra": 0.03081581830047071} +{"step": 6200, "loss": 0.030247221980243922, "loss_real": 0.024964301586151122, "loss_synth": 0.031022169664502143, "lr": 0.0005779797137664262, "elapsed": 217.95806881366298, "steps_per_second": 30.745139358946002, "loss_extra": 0.030628533186390996} +{"step": 6400, "loss": 0.03003448155708611, "loss_real": 0.024711329862475394, "loss_synth": 0.030869073448702693, "lr": 0.0005765553922669433, "elapsed": 224.65449800388888, "steps_per_second": 30.716905495090852, "loss_extra": 0.030405296608805657} +{"step": 6600, "loss": 0.029870325811207295, "loss_real": 0.024394756611436606, "loss_synth": 0.03077283107675612, "lr": 0.0005750883469346437, "elapsed": 231.29389999993145, "steps_per_second": 30.69857062123339, "loss_extra": 0.030240783393383028} +{"step": 6800, "loss": 0.02971546380780637, "loss_real": 0.024813474267721177, "loss_synth": 0.03047858741134405, "lr": 0.000573578809432992, "elapsed": 238.00716094998643, "steps_per_second": 30.671113118812762, "loss_extra": 0.03005829580128193} +{"step": 7000, "loss": 0.02959337887354195, "loss_real": 0.024295184845104813, "loss_synth": 0.030364551255479454, "lr": 0.000572027018135459, "elapsed": 244.90234805690125, "steps_per_second": 30.62088146032385, "loss_extra": 0.02997729226015508} +{"step": 7200, "loss": 0.029489838629961015, "loss_real": 0.024557949658483267, "loss_synth": 0.03018572867847979, "lr": 0.0005704332180878793, "elapsed": 251.70106220571324, "steps_per_second": 30.586121122348114, "loss_extra": 0.02985268603079021} +{"step": 7400, "loss": 0.029403963591903448, "loss_real": 0.02434395528398454, "loss_synth": 0.030153197627514602, "lr": 0.0005687976609697565, "elapsed": 258.72691581305116, "steps_per_second": 30.524685603269297, "loss_extra": 0.029767443723976612} +{"step": 7600, "loss": 0.02909306863322854, "loss_real": 0.023848388828337192, "loss_synth": 0.029892249703407286, "lr": 0.0005671206050545193, "elapsed": 265.569357059896, "steps_per_second": 30.489128188421827, "loss_extra": 0.02946417880244553} +{"step": 7800, "loss": 0.028955404907464982, "loss_real": 0.02402504020370543, "loss_synth": 0.02970114564523101, "lr": 0.000565402315168738, "elapsed": 272.39806488808244, "steps_per_second": 30.457103913995812, "loss_extra": 0.029305656729266046} +{"step": 8000, "loss": 0.028899707160890103, "loss_real": 0.023706914139911533, "loss_synth": 0.029690451528877018, "lr": 0.0005636430626503045, "elapsed": 279.2832627929747, "steps_per_second": 30.420207295047867, "loss_extra": 0.02926727800630033} +{"step": 8200, "loss": 0.028744278606027365, "loss_real": 0.023483216939494015, "loss_synth": 0.029473878713324665, "lr": 0.0005618431253055855, "elapsed": 286.3184994440526, "steps_per_second": 30.368309505703724, "loss_extra": 0.029134519258514048} +{"step": 8400, "loss": 0.02864556367509067, "loss_real": 0.023346760561689734, "loss_synth": 0.029400094971060754, "lr": 0.000560002787365553, "elapsed": 293.2740300488658, "steps_per_second": 30.327772435345533, "loss_extra": 0.029033692916855217} +{"step": 8600, "loss": 0.028477777084335684, "loss_real": 0.023586636520922185, "loss_synth": 0.029223126620054246, "lr": 0.0005581223394409018, "elapsed": 300.2772677158937, "steps_per_second": 30.284132999050208, "loss_extra": 0.028823860958218574} +{"step": 5200, "loss": 0.0312808096036315, "loss_real": 0.025858098696917294, "loss_synth": 0.0318758624792099, "lr": 0.000584452829770449, "elapsed": 275.42932908894727, "steps_per_second": 28.84412564088597, "loss_extra": 0.031722178040072324} +{"step": 5400, "loss": 0.03103438707999885, "loss_real": 0.025634654657915236, "loss_synth": 0.03189021490514279, "lr": 0.0005832453650358537, "elapsed": 282.02680110099027, "steps_per_second": 29.561107346358753, "loss_extra": 0.03140823557972908} +{"step": 5600, "loss": 0.03074563338421285, "loss_real": 0.025370628284290434, "loss_synth": 0.03157721983268857, "lr": 0.0005819941200441891, "elapsed": 288.61077282298356, "steps_per_second": 29.828093984570106, "loss_extra": 0.031122836796566845} +{"step": 5800, "loss": 0.030576182091608645, "loss_real": 0.025314585771411657, "loss_synth": 0.03143515705130994, "lr": 0.0005806992923815441, "elapsed": 295.24843149096705, "steps_per_second": 29.903274315714178, "loss_extra": 0.030934223160147666} +{"step": 6000, "loss": 0.03043502813205123, "loss_real": 0.02514855895191431, "loss_synth": 0.03114263344556093, "lr": 0.0005793610865162167, "elapsed": 301.88290613295976, "steps_per_second": 29.951420733721307, "loss_extra": 0.030833516241982578} +{"step": 6200, "loss": 0.03025001580826938, "loss_real": 0.024970391504466533, "loss_synth": 0.031152966003865003, "lr": 0.0005779797137664262, "elapsed": 308.4303041519597, "steps_per_second": 30.04898298690657, "loss_extra": 0.030599052719771862} +{"step": 6400, "loss": 0.02996792081743479, "loss_real": 0.024576046811416744, "loss_synth": 0.030832879524677993, "lr": 0.0005765553922669433, "elapsed": 314.9878546149703, "steps_per_second": 30.112483320078425, "loss_extra": 0.030338637884706258} +{"step": 6600, "loss": 0.029875389626249672, "loss_real": 0.02478415360674262, "loss_synth": 0.030617145877331494, "lr": 0.0005750883469346437, "elapsed": 321.5536117829615, "steps_per_second": 30.155619897517447, "loss_extra": 0.030244130324572325} +{"step": 6800, "loss": 0.02967553671449423, "loss_real": 0.024502906491979958, "loss_synth": 0.030472806887701154, "lr": 0.000573578809432992, "elapsed": 328.12252812396036, "steps_per_second": 30.18765664746407, "loss_extra": 0.030039287991821765} +{"step": 7000, "loss": 0.029539255946874617, "loss_real": 0.024440268697217108, "loss_synth": 0.030245602130889893, "lr": 0.000572027018135459, "elapsed": 334.7199943959713, "steps_per_second": 30.20030988104597, "loss_extra": 0.02991766868159175} +{"step": 7200, "loss": 0.029356192657724024, "loss_real": 0.024164043189957737, "loss_synth": 0.030127195259556174, "lr": 0.0005704332180878793, "elapsed": 341.31109120999463, "steps_per_second": 30.21331305388642, "loss_extra": 0.02972861599177122} +{"step": 7400, "loss": 0.029284131843596697, "loss_real": 0.0241786187607795, "loss_synth": 0.030077622411772607, "lr": 0.0005687976609697565, "elapsed": 347.9978869939805, "steps_per_second": 30.187776016394032, "loss_extra": 0.029641526071354746} +{"step": 7600, "loss": 0.029089167462661863, "loss_real": 0.0239613647852093, "loss_synth": 0.029865456987172367, "lr": 0.0005671206050545193, "elapsed": 354.71540897199884, "steps_per_second": 30.155451101996025, "loss_extra": 0.029453274570405485} +{"step": 7800, "loss": 0.02887950879521668, "loss_real": 0.023880378119647504, "loss_synth": 0.029715853026136756, "lr": 0.000565402315168738, "elapsed": 361.4669389280025, "steps_per_second": 30.11677865962072, "loss_extra": 0.02921464850194752} +{"step": 8000, "loss": 0.028805796653032303, "loss_real": 0.023796300161629914, "loss_synth": 0.029563565757125616, "lr": 0.0005636430626503045, "elapsed": 368.19791505497415, "steps_per_second": 30.089544437859463, "loss_extra": 0.029161655344069004} +{"step": 8200, "loss": 0.028750967709347607, "loss_real": 0.02377550533041358, "loss_synth": 0.029559404756873846, "lr": 0.0005618431253055855, "elapsed": 374.93109848495806, "steps_per_second": 30.065131380154092, "loss_extra": 0.029090491756796837} +{"step": 8400, "loss": 0.0286360558308661, "loss_real": 0.023543843626976015, "loss_synth": 0.02927944405004382, "lr": 0.000560002787365553, "elapsed": 381.7127102059894, "steps_per_second": 30.030772207071728, "loss_extra": 0.029029429592192173} +{"step": 8600, "loss": 0.02844967690296471, "loss_real": 0.023289813306182624, "loss_synth": 0.0291899383533746, "lr": 0.0005581223394409018, "elapsed": 388.42346707498655, "steps_per_second": 30.01802113788827, "loss_extra": 0.028826253954321146} +{"step": 8800, "loss": 0.028360237600281835, "loss_real": 0.02348217104561627, "loss_synth": 0.029059026502072812, "lr": 0.0005562020784761579, "elapsed": 395.07227607496316, "steps_per_second": 30.021306976774383, "loss_extra": 0.028716508923098447} +{"step": 9000, "loss": 0.028226651949808, "loss_real": 0.023250455083325506, "loss_synth": 0.02912273189984262, "lr": 0.0005542423077027882, "elapsed": 401.7449890279677, "steps_per_second": 30.01887870305495, "loss_extra": 0.028544403165578842} +{"step": 9200, "loss": 0.028106916761025787, "loss_real": 0.023100767768919468, "loss_synth": 0.02897020285949111, "lr": 0.0005522433365913161, "elapsed": 408.3153282759595, "steps_per_second": 30.03865976821565, "loss_extra": 0.02843610219657421} +{"step": 9400, "loss": 0.028035002136602996, "loss_real": 0.022967805601656437, "loss_synth": 0.0289918577671051, "lr": 0.0005502054808024529, "elapsed": 414.94716076896293, "steps_per_second": 30.04404476039842, "loss_extra": 0.028347496502101423} +{"step": 9600, "loss": 0.027907358249649405, "loss_real": 0.022921940609812737, "loss_synth": 0.028644764088094233, "lr": 0.0005481290621372514, "elapsed": 421.5899420809583, "steps_per_second": 30.04681415943303, "loss_extra": 0.02826567563228309} +{"step": 9800, "loss": 0.02782315411604941, "loss_real": 0.022928223833441733, "loss_synth": 0.028606943795457484, "lr": 0.000546014408486289, "elapsed": 428.2101768879802, "steps_per_second": 30.05359522232331, "loss_extra": 0.02816006531007588} +{"step": 10000, "loss": 0.027689797179773448, "loss_real": 0.02276453534141183, "loss_synth": 0.028442929638549684, "lr": 0.0005438618537778916, "elapsed": 434.8504400840029, "steps_per_second": 30.056217414749867, "loss_extra": 0.028037651237100364} +{"step": 10200, "loss": 0.02758555312640965, "loss_real": 0.022730293655768036, "loss_synth": 0.028114529876038432, "lr": 0.0005416717379254006, "elapsed": 457.9116306049982, "steps_per_second": 27.45278456232473, "loss_extra": 0.027981684431433677} +{"step": 10400, "loss": 0.027507938034832476, "loss_real": 0.022608868423849345, "loss_synth": 0.028433257192373277, "lr": 0.0005394444067734975, "elapsed": 464.5091997869895, "steps_per_second": 27.54909592094953, "loss_extra": 0.02781001099385321} +{"step": 10600, "loss": 0.027400014773011207, "loss_real": 0.022576237358152867, "loss_synth": 0.028146052956581114, "lr": 0.0005371802120435915, "elapsed": 471.28536584897665, "steps_per_second": 27.61479328614052, "loss_extra": 0.027738600987941026} +{"step": 10800, "loss": 0.02724476171657443, "loss_real": 0.02253424917347729, "loss_synth": 0.028004238028079272, "lr": 0.0005348795112782779, "elapsed": 477.9883906019968, "steps_per_second": 27.68590480774993, "loss_extra": 0.027567679323256017} +{"step": 11000, "loss": 0.02722088265232742, "loss_real": 0.02203964996151626, "loss_synth": 0.028091474985703826, "lr": 0.0005325426677848778, "elapsed": 484.72268128895666, "steps_per_second": 27.748593837182188, "loss_extra": 0.027567287236452104} +{"step": 11200, "loss": 0.02718255980871618, "loss_real": 0.022196024479344486, "loss_synth": 0.028065708633512258, "lr": 0.0005301700505780687, "elapsed": 491.3682948129717, "steps_per_second": 27.818560061275523, "loss_extra": 0.0275046599842608} +{"step": 11400, "loss": 0.02700719526037574, "loss_real": 0.022253758804872632, "loss_synth": 0.02778656396083534, "lr": 0.0005277620343216117, "elapsed": 498.1277636970044, "steps_per_second": 27.870648895717377, "loss_extra": 0.02732982109300792} +{"step": 11600, "loss": 0.026978258797898887, "loss_real": 0.022054297905415295, "loss_synth": 0.027630679458379746, "lr": 0.0005253189992691882, "elapsed": 504.86536373599665, "steps_per_second": 27.922342242298573, "loss_extra": 0.02735108254477382} +{"step": 11800, "loss": 0.026932974439114334, "loss_real": 0.022110178279690446, "loss_synth": 0.027841153964400293, "lr": 0.0005228413312043536, "elapsed": 511.54961284797173, "steps_per_second": 27.97730987476748, "loss_extra": 0.027231026347726582} +{"step": 12000, "loss": 0.02679976181127131, "loss_real": 0.022017474975436924, "loss_synth": 0.027607273804023863, "lr": 0.0005203294213796174, "elapsed": 518.2691505689872, "steps_per_second": 28.02537502416397, "loss_extra": 0.02711850794032216} +{"step": 12200, "loss": 0.026632792763412, "loss_real": 0.0216178491525352, "loss_synth": 0.027436807407066225, "lr": 0.0005177836664546598, "elapsed": 525.0530446579796, "steps_per_second": 28.063880317020224, "loss_extra": 0.026977713312953712} +{"step": 12400, "loss": 0.02654717745259404, "loss_real": 0.02153936724178493, "loss_synth": 0.027345690811052918, "lr": 0.000515204468433695, "elapsed": 531.7596633269568, "steps_per_second": 28.108650030010523, "loss_extra": 0.02689269369468093} +{"step": 12600, "loss": 0.026499535823240876, "loss_real": 0.02143801283556968, "loss_synth": 0.027346943728625773, "lr": 0.0005125922346019892, "elapsed": 538.4792611129815, "steps_per_second": 28.149842053323212, "loss_extra": 0.02683870228007436} +{"step": 12800, "loss": 0.026493240101262926, "loss_real": 0.021581815932877363, "loss_synth": 0.027167520644143225, "lr": 0.0005099473774615467, "elapsed": 545.1478989439784, "steps_per_second": 28.194225905748688, "loss_extra": 0.02685924995690584} +{"step": 13000, "loss": 0.026371854143217206, "loss_real": 0.02153562189079821, "loss_synth": 0.027145781461149453, "lr": 0.00050727031466597, "elapsed": 551.876813766954, "steps_per_second": 28.230514219376833, "loss_extra": 0.026704840967431663} +{"step": 13200, "loss": 0.026406226521357892, "loss_real": 0.021863297345116734, "loss_synth": 0.02717043480835855, "lr": 0.000504561468954508, "elapsed": 558.5834862269694, "steps_per_second": 28.267286560444663, "loss_extra": 0.026709738951176405} +{"step": 13400, "loss": 0.026258348021656275, "loss_real": 0.021349422754719852, "loss_synth": 0.027152012269943952, "lr": 0.0005018212680853004, "elapsed": 565.3326443340047, "steps_per_second": 28.298346057154045, "loss_extra": 0.026569385696202517} +{"step": 13600, "loss": 0.026187333250418304, "loss_real": 0.021540470095351337, "loss_synth": 0.027103291833773257, "lr": 0.0004990501447678302, "elapsed": 572.0568768009543, "steps_per_second": 28.330350590091168, "loss_extra": 0.026464312300086022} +{"step": 13800, "loss": 0.02608675175346434, "loss_real": 0.021371174976229666, "loss_synth": 0.027024238696321846, "lr": 0.0004962485365945929, "elapsed": 578.800140678999, "steps_per_second": 28.35922858702448, "loss_extra": 0.02636583567596972} +{"step": 14000, "loss": 0.026096934648230673, "loss_real": 0.02134702761657536, "loss_synth": 0.026865138448774816, "lr": 0.0004934168859719962, "elapsed": 585.5518704779679, "steps_per_second": 28.38612016444283, "loss_extra": 0.026421960415318607} +{"step": 14200, "loss": 0.025978561863303183, "loss_real": 0.02144981164485216, "loss_synth": 0.02665507295168936, "lr": 0.0004905556400504991, "elapsed": 592.3601174989599, "steps_per_second": 28.406932207767195, "loss_extra": 0.02630239867605269} +{"step": 14400, "loss": 0.025929168295115233, "loss_real": 0.02139069013297558, "loss_synth": 0.026631687693297865, "lr": 0.0004876652506540011, "elapsed": 599.1345086259535, "steps_per_second": 28.429798023824763, "loss_extra": 0.026247578198090194} +{"step": 14600, "loss": 0.025764110907912256, "loss_real": 0.02076240338385105, "loss_synth": 0.02665938040241599, "lr": 0.00048474617420849446, "elapsed": 605.906359216955, "steps_per_second": 28.45195989620355, "loss_extra": 0.026084838742390273} +{"step": 14800, "loss": 0.025731448819860815, "loss_real": 0.020941540664061904, "loss_synth": 0.026473193950951098, "lr": 0.000481798871669989, "elapsed": 612.6565234549926, "steps_per_second": 28.475043852917132, "loss_extra": 0.026067422172054648} +{"step": 15000, "loss": 0.025749292774125934, "loss_real": 0.020816664453595878, "loss_synth": 0.02664454438723624, "lr": 0.00047882380845172155, "elapsed": 619.4075744019938, "steps_per_second": 28.49716770781667, "loss_extra": 0.02606251258403063} +{"step": 15200, "loss": 0.025642522694543004, "loss_real": 0.020821425942704083, "loss_synth": 0.026641555428504944, "lr": 0.0004758214543506626, "elapsed": 627.0419725459651, "steps_per_second": 28.448195738737322, "loss_extra": 0.025917736403644084} +{"step": 15400, "loss": 0.025648719714954495, "loss_real": 0.02071968087926507, "loss_synth": 0.026675816336646677, "lr": 0.0004727922834733288, "elapsed": 633.8229411399807, "steps_per_second": 28.467613067090955, "loss_extra": 0.025928675197064877} +{"step": 15600, "loss": 0.025453792354092, "loss_real": 0.020512188561260702, "loss_synth": 0.0264000404253602, "lr": 0.0004697367741609171, "elapsed": 640.6527580449474, "steps_per_second": 28.482583658249812, "loss_extra": 0.0257552729267627} +{"step": 15800, "loss": 0.025505801560357214, "loss_real": 0.020801528594456612, "loss_synth": 0.026363246422261, "lr": 0.0004666554089137685, "elapsed": 647.4475709809922, "steps_per_second": 28.499646958484828, "loss_extra": 0.02580361341126263} +{"step": 16000, "loss": 0.025366765512153507, "loss_real": 0.02052838811650872, "loss_synth": 0.026008125748485326, "lr": 0.00046354867431517584, "elapsed": 654.2341257719672, "steps_per_second": 28.516719618743988, "loss_extra": 0.02573303964920342} +{"step": 16200, "loss": 0.02532931840978563, "loss_real": 0.02048760485369712, "loss_synth": 0.026032149493694305, "lr": 0.0004604170609545466, "elapsed": 661.0873386519961, "steps_per_second": 28.52835726399287, "loss_extra": 0.025680628484115006} +{"step": 16400, "loss": 0.025294812312349677, "loss_real": 0.020549559285864234, "loss_synth": 0.026136828307062387, "lr": 0.00045726106334993325, "elapsed": 667.8741049019736, "steps_per_second": 28.544343880061646, "loss_extra": 0.025600927844643594} +{"step": 16600, "loss": 0.02527745342813432, "loss_real": 0.02052953568752855, "loss_synth": 0.026210255566984416, "lr": 0.0004540811798699431, "elapsed": 674.7615467829746, "steps_per_second": 28.552718911902733, "loss_extra": 0.025561222545802592} +{"step": 16800, "loss": 0.02518760710954666, "loss_real": 0.020336001608520747, "loss_synth": 0.025926885744556784, "lr": 0.00045087791265504006, "elapsed": 681.5860460669501, "steps_per_second": 28.565166528416633, "loss_extra": 0.02553090525791049} +{"step": 17000, "loss": 0.025165164079517126, "loss_real": 0.02000641625840217, "loss_synth": 0.026067048367112874, "lr": 0.0004476517675382507, "elapsed": 688.444919208996, "steps_per_second": 28.57487042981399, "loss_extra": 0.025501321237534284} +{"step": 17200, "loss": 0.02508990707807243, "loss_real": 0.020588810509070753, "loss_synth": 0.025964450407773256, "lr": 0.00044440325396528766, "elapsed": 695.2363827659865, "steps_per_second": 28.588777710951735, "loss_extra": 0.02536135969683528} +{"step": 17400, "loss": 0.02504890412092209, "loss_real": 0.020398276560008526, "loss_synth": 0.025791797982528807, "lr": 0.00044113288491410207, "elapsed": 702.032651875983, "steps_per_second": 28.60193223031778, "loss_extra": 0.02536944377236068} +{"step": 17600, "loss": 0.025013704411685468, "loss_real": 0.020050000548362732, "loss_synth": 0.025831641023978592, "lr": 0.00043784117681387844, "elapsed": 708.8763847099617, "steps_per_second": 28.611596630692276, "loss_extra": 0.025349581064656377} +{"step": 17800, "loss": 0.024853433296084405, "loss_real": 0.019775740168988705, "loss_synth": 0.025522999316453934, "lr": 0.00043452864946348456, "elapsed": 715.7127776870038, "steps_per_second": 28.621434988743164, "loss_extra": 0.0252387011051178} +{"step": 18000, "loss": 0.02491448155604303, "loss_real": 0.0202483978215605, "loss_synth": 0.025555345956236125, "lr": 0.00043119582594938896, "elapsed": 722.4832632109756, "steps_per_second": 28.635133569960832, "loss_extra": 0.02526214173063636} +{"step": 18200, "loss": 0.024919507997110485, "loss_real": 0.02029703154228628, "loss_synth": 0.02560646182857454, "lr": 0.0004278432325630599, "elapsed": 729.238006945001, "steps_per_second": 28.649408375250097, "loss_extra": 0.025250934194773436} +{"step": 18400, "loss": 0.024834510525688528, "loss_real": 0.020070819216780365, "loss_synth": 0.025586630702018737, "lr": 0.00042447139871785766, "elapsed": 736.0113825539593, "steps_per_second": 28.66212836580091, "loss_extra": 0.02516504575498402} +{"step": 18600, "loss": 0.0246454397123307, "loss_real": 0.019896729392930867, "loss_synth": 0.025549885695800186, "lr": 0.0004210808568654337, "elapsed": 742.7894510889892, "steps_per_second": 28.6742013160373, "loss_extra": 0.024936365121975543} +{"step": 18800, "loss": 0.024691675873473286, "loss_real": 0.01973304246086627, "loss_synth": 0.025504692420363427, "lr": 0.00041767214241165117, "elapsed": 749.5978241799749, "steps_per_second": 28.684127143201184, "loss_extra": 0.02502822787500918} +{"step": 19000, "loss": 0.024641630658879875, "loss_real": 0.01993017627391964, "loss_synth": 0.025521895196288825, "lr": 0.00041424579363203725, "elapsed": 756.4663726049475, "steps_per_second": 28.690237524216066, "loss_extra": 0.024934533834457397} +{"step": 19200, "loss": 0.024588975021615625, "loss_real": 0.019942903090268374, "loss_synth": 0.025278832782059907, "lr": 0.00041080235158678376, "elapsed": 763.3323936459492, "steps_per_second": 28.696324830149848, "loss_extra": 0.02492224325425923} +{"step": 19400, "loss": 0.02448670720681548, "loss_real": 0.01977371919900179, "loss_synth": 0.02532434733584523, "lr": 0.00040734236003530744, "elapsed": 770.2936412289855, "steps_per_second": 28.69679867397108, "loss_extra": 0.024790404997766018} +{"step": 19600, "loss": 0.024495552964508532, "loss_real": 0.019853848307393493, "loss_synth": 0.025297241164371372, "lr": 0.0004038663653503835, "elapsed": 777.2509190400015, "steps_per_second": 28.697483489970487, "loss_extra": 0.024800462452694773} +{"step": 19800, "loss": 0.024434857675805687, "loss_real": 0.019822269035503267, "loss_synth": 0.025145543543621897, "lr": 0.000400374916431868, "elapsed": 784.2897843059618, "steps_per_second": 28.69361039193456, "loss_extra": 0.024759291149675847} +{"step": 20000, "loss": 0.02441555249504745, "loss_real": 0.019414084921590982, "loss_synth": 0.02521371780894697, "lr": 0.00039686856462001896, "elapsed": 791.1897466069786, "steps_per_second": 28.697465743929207, "loss_extra": 0.024760465826839207} +{"step": 20200, "loss": 0.02432645340450108, "loss_real": 0.019460364184342323, "loss_synth": 0.025171252880245448, "lr": 0.00039334786360843476, "elapsed": 815.4101313689607, "steps_per_second": 27.792272064605868, "loss_extra": 0.024645016361027956} +{"step": 20400, "loss": 0.024274060474708675, "loss_real": 0.01928959820885211, "loss_synth": 0.02502922381274402, "lr": 0.00038981336935661813, "elapsed": 822.3267405259539, "steps_per_second": 27.806304711213986, "loss_extra": 0.024627846479415894} +{"step": 20600, "loss": 0.024229086991399525, "loss_real": 0.01939258323982358, "loss_synth": 0.025036009205505253, "lr": 0.00038626564000218466, "elapsed": 829.2310082079493, "steps_per_second": 27.820603482005687, "loss_extra": 0.024553876398131252} +{"step": 20800, "loss": 0.024218152845278382, "loss_real": 0.019356143097393214, "loss_synth": 0.025077215377241373, "lr": 0.00038270523577272616, "elapsed": 836.1948369519669, "steps_per_second": 27.831634113515562, "loss_extra": 0.024532715696841477} +{"step": 21000, "loss": 0.024137550788000225, "loss_real": 0.01947453829459846, "loss_synth": 0.0249336794950068, "lr": 0.0003791327188973438, "elapsed": 844.0164709099918, "steps_per_second": 27.80089873456526, "loss_extra": 0.024446164034307005} +{"step": 21200, "loss": 0.024071804136037826, "loss_real": 0.019394439272582532, "loss_synth": 0.02486144447699189, "lr": 0.00037554865351786614, "elapsed": 859.9296318289707, "steps_per_second": 27.39104721331937, "loss_extra": 0.024383596014231443} +{"step": 21400, "loss": 0.024098225478082894, "loss_real": 0.019142401800490916, "loss_synth": 0.02492085361853242, "lr": 0.00037195360559976446, "elapsed": 866.9714253499988, "steps_per_second": 27.402940595377434, "loss_extra": 0.024432075461372733} +{"step": 21600, "loss": 0.023975564828142525, "loss_real": 0.018899051826447247, "loss_synth": 0.02476430599577725, "lr": 0.0003683481428427801, "elapsed": 873.88273260399, "steps_per_second": 27.420466332748802, "loss_extra": 0.024330989532172678} +{"step": 21800, "loss": 0.02401596026495099, "loss_real": 0.019384760707616806, "loss_synth": 0.024892639834433794, "lr": 0.0003647328345912784, "elapsed": 880.8240340169868, "steps_per_second": 27.436252433513967, "loss_extra": 0.024301029425114393} +{"step": 22000, "loss": 0.023917127586901187, "loss_real": 0.01902289826888591, "loss_synth": 0.024791447278112173, "lr": 0.0003611082517443419, "elapsed": 887.7336238779826, "steps_per_second": 27.453090457466974, "loss_extra": 0.024231390468776225} +{"step": 22200, "loss": 0.023785319179296494, "loss_real": 0.0187907948018983, "loss_synth": 0.024601600067690015, "lr": 0.00035747496666562, "elapsed": 894.6882650459884, "steps_per_second": 27.46758057153177, "loss_extra": 0.024124960601329803} +{"step": 22400, "loss": 0.023857920225709678, "loss_real": 0.0186465169955045, "loss_synth": 0.024782095504924655, "lr": 0.00035383355309294483, "elapsed": 901.6132850769791, "steps_per_second": 27.48303812948285, "loss_extra": 0.02419424578547478} +{"step": 22600, "loss": 0.02379597960971296, "loss_real": 0.018956315242685377, "loss_synth": 0.024568413961678744, "lr": 0.00035018458604773206, "elapsed": 908.6139016379602, "steps_per_second": 27.494913723085283, "loss_extra": 0.02412971219047904} +{"step": 22800, "loss": 0.02374992615543306, "loss_real": 0.018764669531956314, "loss_synth": 0.02466130293905735, "lr": 0.0003465286417441785, "elapsed": 915.6070589639712, "steps_per_second": 27.50684945002316, "loss_extra": 0.02406484879553318} +{"step": 23000, "loss": 0.023741441266611218, "loss_real": 0.01900346132926643, "loss_synth": 0.024484542021527885, "lr": 0.0003428662974982705, "elapsed": 922.5884810870048, "steps_per_second": 27.519023671330658, "loss_extra": 0.024071429232135413} +{"step": 23200, "loss": 0.02364984979853034, "loss_real": 0.018737386986613272, "loss_synth": 0.024725227309390904, "lr": 0.00033919813163662, "elapsed": 929.6419450299582, "steps_per_second": 27.527940843970146, "loss_extra": 0.023915964495390653} +{"step": 23400, "loss": 0.023637885199859737, "loss_real": 0.018961231191642582, "loss_synth": 0.024373961659148336, "lr": 0.000335524723405139, "elapsed": 936.7457594059524, "steps_per_second": 27.534594963002448, "loss_extra": 0.023962955102324487} +{"step": 23600, "loss": 0.023630938241258264, "loss_real": 0.018767809220589696, "loss_synth": 0.024458317244425418, "lr": 0.00033184665287757097, "elapsed": 943.818508477998, "steps_per_second": 27.54237601096021, "loss_extra": 0.02395352305844426} +{"step": 23800, "loss": 0.023638545535504818, "loss_real": 0.019044779357500374, "loss_synth": 0.02440626248717308, "lr": 0.0003281645008638895, "elapsed": 950.8540592109784, "steps_per_second": 27.55149763412133, "loss_extra": 0.02394671198911965} +{"step": 24000, "loss": 0.023492559669539333, "loss_real": 0.018678502310067416, "loss_synth": 0.024384368220344187, "lr": 0.0003244788488185826, "elapsed": 957.8921696249745, "steps_per_second": 27.5603307473061, "loss_extra": 0.023793742768466474} +{"step": 24200, "loss": 0.02350926911458373, "loss_real": 0.01853345033712685, "loss_synth": 0.02450924724340439, "lr": 0.00032079027874883385, "elapsed": 964.9445287470007, "steps_per_second": 27.568421286729595, "loss_extra": 0.023801073944196106} +{"step": 24400, "loss": 0.02344784712418914, "loss_real": 0.018428487884812057, "loss_synth": 0.024287667777389287, "lr": 0.00031709937312261613, "elapsed": 972.0012495049741, "steps_per_second": 27.576178648789156, "loss_extra": 0.023784320158883928} +{"step": 24600, "loss": 0.023408932462334633, "loss_real": 0.018549169809557498, "loss_synth": 0.024278165670111776, "lr": 0.0003134067147767145, "elapsed": 979.0566534329555, "steps_per_second": 27.58383304799105, "loss_extra": 0.02372071526944637} +{"step": 24800, "loss": 0.023343136757612227, "loss_real": 0.01830092802643776, "loss_synth": 0.02438890989869833, "lr": 0.0003097128868246881, "elapsed": 986.1728451629751, "steps_per_second": 27.58899993579394, "loss_extra": 0.02363074348308146} +{"step": 25000, "loss": 0.023281044326722622, "loss_real": 0.01844846472609788, "loss_synth": 0.023897264851257205, "lr": 0.0003060184725647909, "elapsed": 993.2621125019505, "steps_per_second": 27.595090454763042, "loss_extra": 0.023652956597507} +{"step": 25200, "loss": 0.023258013874292372, "loss_real": 0.01835580059327185, "loss_synth": 0.024047974068671464, "lr": 0.0003023240553878617, "elapsed": 1001.2287518709782, "steps_per_second": 27.568013567781975, "loss_extra": 0.023594178948551415} +{"step": 25400, "loss": 0.023257109727710487, "loss_real": 0.01821931272279471, "loss_synth": 0.024267099099233747, "lr": 0.0002986302186851996, "elapsed": 1008.3686499319738, "steps_per_second": 27.572294292237448, "loss_extra": 0.023553158771246672} +{"step": 25600, "loss": 0.023206992214545606, "loss_real": 0.018394662970677017, "loss_synth": 0.02396256785839796, "lr": 0.00029493754575644036, "elapsed": 1015.4290043499786, "steps_per_second": 27.579429907482176, "loss_extra": 0.023541955482214688} +{"step": 25800, "loss": 0.023278260100632907, "loss_real": 0.018269064459018408, "loss_synth": 0.02424084795638919, "lr": 0.0002912466197174462, "elapsed": 1022.514043328003, "steps_per_second": 27.58552878070637, "loss_extra": 0.0235830173548311} +{"step": 26000, "loss": 0.023178480258211495, "loss_real": 0.018361137616448104, "loss_synth": 0.02406176956370473, "lr": 0.00028755802340822527, "elapsed": 1029.632777558989, "steps_per_second": 27.590292643991376, "loss_extra": 0.023482144884765146} +{"step": 26200, "loss": 0.023160763503983616, "loss_real": 0.018437649374827742, "loss_synth": 0.02404274173080921, "lr": 0.0002838723393008943, "elapsed": 1036.6927697399515, "steps_per_second": 27.597078337618793, "loss_extra": 0.023454507421702145} +{"step": 26400, "loss": 0.023092660047113897, "loss_real": 0.018341069822199643, "loss_synth": 0.02385334965772927, "lr": 0.00028019014940769974, "elapsed": 1043.8175664979499, "steps_per_second": 27.601433204533087, "loss_extra": 0.023419742519035936} +{"step": 26600, "loss": 0.023099121367558838, "loss_real": 0.01792615318670869, "loss_synth": 0.024064928544685244, "lr": 0.000276512035189111, "elapsed": 1051.3364229789586, "steps_per_second": 27.59181283193705, "loss_extra": 0.023420886639505624} +{"step": 26800, "loss": 0.022991151502355932, "loss_real": 0.017871798546984792, "loss_synth": 0.023802553294226526, "lr": 0.00027283857746200125, "elapsed": 1059.0990902239573, "steps_per_second": 27.5738695076794, "loss_extra": 0.023345584850758314} +{"step": 27000, "loss": 0.023009294057264925, "loss_real": 0.018109093410894273, "loss_synth": 0.023714111456647514, "lr": 0.0002691703563079296, "elapsed": 1066.8386184609844, "steps_per_second": 27.55707379631715, "loss_extra": 0.02336646960116923} +{"step": 27200, "loss": 0.023000258347019555, "loss_real": 0.018163409219123423, "loss_synth": 0.023786932276561857, "lr": 0.0002655079509815397, "elapsed": 1074.5188269629725, "steps_per_second": 27.54262746870697, "loss_extra": 0.023330134116113187} +{"step": 27400, "loss": 0.022964883437380193, "loss_real": 0.018034432958811523, "loss_synth": 0.02391697306185961, "lr": 0.00026185193981908867, "elapsed": 1082.2193016849924, "steps_per_second": 27.527768246023893, "loss_extra": 0.023263694504275918} +{"step": 27600, "loss": 0.02288944512605667, "loss_real": 0.01811702977400273, "loss_synth": 0.02358986236155033, "lr": 0.0002582029001471206, "elapsed": 1089.9720484939753, "steps_per_second": 27.511436902655213, "loss_extra": 0.023233820712193848} +{"step": 27800, "loss": 0.022920161411166193, "loss_real": 0.01801701189018786, "loss_synth": 0.023780125975608826, "lr": 0.00025456140819130085, "elapsed": 1097.283643638948, "steps_per_second": 27.51004633103445, "loss_extra": 0.023238973738625646} +{"step": 28000, "loss": 0.022900124182924628, "loss_real": 0.01774126689415425, "loss_synth": 0.023888762025162578, "lr": 0.0002509280389854229, "elapsed": 1104.5420535599696, "steps_per_second": 27.510430050008246, "loss_extra": 0.023214662335813045} +{"step": 28200, "loss": 0.02272984047420323, "loss_real": 0.017671581944450735, "loss_synth": 0.023561344407498838, "lr": 0.00024730336628060344, "elapsed": 1111.7176225569565, "steps_per_second": 27.513509911637488, "loss_extra": 0.02307261756621301} +{"step": 28400, "loss": 0.022777555398643016, "loss_real": 0.0177320936974138, "loss_synth": 0.023563762912526726, "lr": 0.00024368796245468133, "elapsed": 1118.9354593429598, "steps_per_second": 27.515170203590177, "loss_extra": 0.023130234759300948} +{"step": 28600, "loss": 0.022741403430700302, "loss_real": 0.017724742302671074, "loss_synth": 0.02356492606922984, "lr": 0.00024008239842183163, "elapsed": 1126.1680306819617, "steps_per_second": 27.51632981768671, "loss_extra": 0.023081646719947457} +{"step": 28800, "loss": 0.022790084769949318, "loss_real": 0.01760927722789347, "loss_synth": 0.02371165736578405, "lr": 0.00023648724354241227, "elapsed": 1133.5476460539503, "steps_per_second": 27.512792538349146, "loss_extra": 0.023123732060194014} +{"step": 29000, "loss": 0.02274701033718884, "loss_real": 0.017866802834905684, "loss_synth": 0.023620141446590425, "lr": 0.00023290306553305494, "elapsed": 1140.8768024229794, "steps_per_second": 27.51090625346088, "loss_extra": 0.02306004469282925} +{"step": 29200, "loss": 0.022706420421600343, "loss_real": 0.017704942557029427, "loss_synth": 0.02372449552640319, "lr": 0.00022933043037701642, "elapsed": 1147.9114458980039, "steps_per_second": 27.51826407453228, "loss_extra": 0.02299650348722935} +{"step": 29400, "loss": 0.022683783238753676, "loss_real": 0.017794684143736958, "loss_synth": 0.023618523245677352, "lr": 0.00022576990223480343, "elapsed": 1155.2393899419694, "steps_per_second": 27.51640073861975, "loss_extra": 0.02298242318443954} +{"step": 29600, "loss": 0.022571146860718726, "loss_real": 0.01756830170750618, "loss_synth": 0.02347274268977344, "lr": 0.00022222204335508425, "elapsed": 1162.5391063150018, "steps_per_second": 27.515436661108893, "loss_extra": 0.022890421142801643} +{"step": 29800, "loss": 0.022507381215691565, "loss_real": 0.017512907492928206, "loss_synth": 0.02346418406814337, "lr": 0.00021868741398590414, "elapsed": 1169.9017746689497, "steps_per_second": 27.512566669528937, "loss_extra": 0.022811979986727238} +{"step": 30000, "loss": 0.022575598284602164, "loss_real": 0.01726635491475463, "loss_synth": 0.023492517611011864, "lr": 0.00021516657228621528, "elapsed": 1177.309418019955, "steps_per_second": 27.50838178483448, "loss_extra": 0.02292437366209924} +{"step": 30200, "loss": 0.022567189391702415, "loss_real": 0.01754477166570723, "loss_synth": 0.023323603039607406, "lr": 0.00021166007423773693, "elapsed": 1204.1006216029637, "steps_per_second": 26.934440219184925, "loss_extra": 0.022924791369587184} +{"step": 30400, "loss": 0.022518908251076938, "loss_real": 0.01731943488586694, "loss_synth": 0.02339298337697983, "lr": 0.0002081684735571596, "elapsed": 1211.5805011249613, "steps_per_second": 26.93288535929295, "loss_extra": 0.02286642854101956} +{"step": 30600, "loss": 0.022439746418967843, "loss_real": 0.01743948336225003, "loss_synth": 0.023331119269132613, "lr": 0.00020469232160870657, "elapsed": 1219.1003751249518, "steps_per_second": 26.930221894287932, "loss_extra": 0.02276128894649446} +{"step": 30800, "loss": 0.02242211125791073, "loss_real": 0.017311503482051193, "loss_synth": 0.023395946156233548, "lr": 0.00020123216731706737, "elapsed": 1226.6601704319473, "steps_per_second": 26.92647831752524, "loss_extra": 0.02273509293794632} +{"step": 31000, "loss": 0.022363293757662175, "loss_real": 0.017207620022818445, "loss_synth": 0.02339886230416596, "lr": 0.00019778855708071612, "elapsed": 1234.2954446479562, "steps_per_second": 26.92068928313585, "loss_extra": 0.0226657840795815} +{"step": 31200, "loss": 0.022373907584697008, "loss_real": 0.0171757373213768, "loss_synth": 0.02337146569043398, "lr": 0.00019436203468562864, "elapsed": 1241.9087264440022, "steps_per_second": 26.91559915936338, "loss_extra": 0.022690497413277624} +{"step": 31400, "loss": 0.022297670328989626, "loss_real": 0.017086189393885433, "loss_synth": 0.023325437465682625, "lr": 0.00019095314121941266, "elapsed": 1249.4129626139766, "steps_per_second": 26.913579605753313, "loss_extra": 0.022608175352215768} +{"step": 31600, "loss": 0.022321202578023076, "loss_real": 0.017311737593263387, "loss_synth": 0.02316317248158157, "lr": 0.0001875624149858636, "elapsed": 1257.2198579639662, "steps_per_second": 26.903352795381878, "loss_extra": 0.022656063847243786} +{"step": 31800, "loss": 0.02229889802634716, "loss_real": 0.017272896012291313, "loss_synth": 0.023334646057337524, "lr": 0.00018419039141996036, "elapsed": 1265.1779612669488, "steps_per_second": 26.88920620667495, "loss_extra": 0.02258724153973162} +{"step": 32000, "loss": 0.022345805428922175, "loss_real": 0.01749817803967744, "loss_synth": 0.023200842272490262, "lr": 0.0001808376030033136, "elapsed": 1273.281326030963, "steps_per_second": 26.871398361804694, "loss_extra": 0.02265980835072696} +{"step": 32200, "loss": 0.022292502177879214, "loss_real": 0.016986288363114, "loss_synth": 0.023209088006988166, "lr": 0.0001775045791800812, "elapsed": 1281.8863524339977, "steps_per_second": 26.840581945547903, "loss_extra": 0.02264103134162724} +{"step": 32400, "loss": 0.022213215976953506, "loss_real": 0.01692744018509984, "loss_synth": 0.023083528997376562, "lr": 0.00017419184627336242, "elapsed": 1290.8547815499478, "steps_per_second": 26.800754601976248, "loss_extra": 0.022571059875190258} +{"step": 32600, "loss": 0.02217823041602969, "loss_real": 0.016962953549809753, "loss_synth": 0.023188437782227993, "lr": 0.00017089992740208575, "elapsed": 1300.368059706001, "steps_per_second": 26.747489269919434, "loss_extra": 0.022493526423349976} +{"step": 32800, "loss": 0.022180830091238023, "loss_real": 0.01683359027840197, "loss_synth": 0.02316719138994813, "lr": 0.00016762934239840198, "elapsed": 1311.1278586769477, "steps_per_second": 26.66328163282966, "loss_extra": 0.022516423435881734} +{"step": 33000, "loss": 0.022168011935427785, "loss_real": 0.01712404724676162, "loss_synth": 0.02311786636710167, "lr": 0.000164380607725597, "elapsed": 1323.0430742959725, "steps_per_second": 26.551670973087365, "loss_extra": 0.02247972526587546} +{"step": 33200, "loss": 0.022228321740403772, "loss_real": 0.016940712104551493, "loss_synth": 0.023308072304353118, "lr": 0.00016115423639653619, "elapsed": 1335.02960265195, "steps_per_second": 26.440786208407847, "loss_extra": 0.02253414482809603} +{"step": 33400, "loss": 0.022097765877842904, "loss_real": 0.01710004299879074, "loss_synth": 0.023044214881956578, "lr": 0.0001579507378926539, "elapsed": 1339.3578207259998, "steps_per_second": 26.520683066866052, "loss_extra": 0.02240529970265925} +{"step": 33600, "loss": 0.022106742244213818, "loss_real": 0.01695958009455353, "loss_synth": 0.02301077405922115, "lr": 0.00015477061808349973, "elapsed": 1343.9570281239576, "steps_per_second": 26.593234133248238, "loss_extra": 0.02244110407307744} +{"step": 33800, "loss": 0.02199271705932915, "loss_real": 0.017086704773828388, "loss_synth": 0.02289842492900789, "lr": 0.0001516143791468568, "elapsed": 1348.4900148939923, "steps_per_second": 26.666802303948945, "loss_extra": 0.022300435258075596} +{"step": 34000, "loss": 0.022068135756999254, "loss_real": 0.016597578041255473, "loss_synth": 0.023005111161619424, "lr": 0.00014848251948944142, "elapsed": 1352.8596252159914, "steps_per_second": 26.743784255757785, "loss_extra": 0.022429453628137707} +{"step": 34200, "loss": 0.02202778615988791, "loss_real": 0.01711794319096953, "loss_synth": 0.02287962137721479, "lr": 0.00014537553366819925, "elapsed": 1357.1151818289654, "steps_per_second": 26.822958194012728, "loss_extra": 0.0223493533115834} +{"step": 34400, "loss": 0.021974821984767915, "loss_real": 0.0170318594481796, "loss_synth": 0.022929871305823326, "lr": 0.0001422939123122089, "elapsed": 1361.4237101829494, "steps_per_second": 26.90021169546867, "loss_extra": 0.02227425600402057} +{"step": 34600, "loss": 0.02202212031930685, "loss_real": 0.017112328479997815, "loss_synth": 0.023139506485313176, "lr": 0.00013923814204520548, "elapsed": 1365.6845426469808, "steps_per_second": 26.9780311986782, "loss_extra": 0.02227747017517686} +{"step": 34800, "loss": 0.021952865170314907, "loss_real": 0.01658915893174708, "loss_synth": 0.022825979720801116, "lr": 0.00013620870540873793, "elapsed": 1370.0157324439497, "steps_per_second": 27.053520530506432, "loss_extra": 0.0223184859380126} +{"step": 35000, "loss": 0.021843318361788988, "loss_real": 0.01675063426606357, "loss_synth": 0.022644333811476826, "lr": 0.00013320608078596944, "elapsed": 1381.7934865799616, "steps_per_second": 26.946963509929443, "loss_extra": 0.022197441244497896} +{"step": 35200, "loss": 0.021920393630862237, "loss_real": 0.01693078489974141, "loss_synth": 0.022693455424159764, "lr": 0.00013023074232613552, "elapsed": 1396.4575170509634, "steps_per_second": 26.773951392310096, "loss_extra": 0.022270276732742785} +{"step": 35400, "loss": 0.02179852127097547, "loss_real": 0.016559402612037956, "loss_synth": 0.022767514679580925, "lr": 0.0001272831598696703, "elapsed": 1407.358598865976, "steps_per_second": 26.693287586596007, "loss_extra": 0.022126686470583082} +{"step": 35600, "loss": 0.021847345009446142, "loss_real": 0.016827276432886718, "loss_synth": 0.022888023490086198, "lr": 0.00012436379887401295, "elapsed": 1411.8141902060015, "steps_per_second": 26.764191371600145, "loss_extra": 0.022133814021945} +{"step": 35800, "loss": 0.02178638808429241, "loss_real": 0.01676317666191608, "loss_synth": 0.022600631536915897, "lr": 0.00012147312034010696, "elapsed": 1416.126098195964, "steps_per_second": 26.837904344938536, "loss_extra": 0.02212965751066804} +{"step": 36000, "loss": 0.021821939162909986, "loss_real": 0.016731785661540925, "loss_synth": 0.02280692595988512, "lr": 0.00011861158073960271, "elapsed": 1420.4593611069722, "steps_per_second": 26.91056661745038, "loss_extra": 0.02212991607375443} +{"step": 36200, "loss": 0.02182092849165201, "loss_real": 0.016600225977599622, "loss_synth": 0.022694721603766083, "lr": 0.00011577963194277514, "elapsed": 1424.9007391269552, "steps_per_second": 26.980161598536952, "loss_extra": 0.02217082753777504} +{"step": 36400, "loss": 0.021788258217275144, "loss_real": 0.01639975263737142, "loss_synth": 0.02284815115854144, "lr": 0.0001129777211471684, "elapsed": 1429.164215103956, "steps_per_second": 27.05337002163499, "loss_extra": 0.02211000516079366} +{"step": 36600, "loss": 0.02177844686433673, "loss_real": 0.016624795198440553, "loss_synth": 0.02263218956068158, "lr": 0.00011020629080697766, "elapsed": 1433.448602821969, "steps_per_second": 27.125555655023913, "loss_extra": 0.022126053562387824} +{"step": 36800, "loss": 0.021718698535114527, "loss_real": 0.016503284908831118, "loss_synth": 0.022498527010902762, "lr": 0.00010746577856318116, "elapsed": 1437.7193576789577, "steps_per_second": 27.19752938550031, "loss_extra": 0.0220914513990283} +{"step": 37000, "loss": 0.021780966175720097, "loss_real": 0.016452357145026325, "loss_synth": 0.022844342943280936, "lr": 0.00010475661717443124, "elapsed": 1441.9363124039955, "steps_per_second": 27.2702294660767, "loss_extra": 0.022095330646261572} +{"step": 37200, "loss": 0.021786279547959565, "loss_real": 0.016571363885886967, "loss_synth": 0.022786443382501603, "lr": 0.00010207923444871681, "elapsed": 1446.0980638199835, "steps_per_second": 27.34369066142821, "loss_extra": 0.022104040514677764} +{"step": 37400, "loss": 0.02179535969160497, "loss_real": 0.016487002703361214, "loss_synth": 0.02269860764965415, "lr": 9.94340531758075e-05, "elapsed": 1450.2954856559518, "steps_per_second": 27.415806920306466, "loss_extra": 0.022147447681054474} +{"step": 37600, "loss": 0.021663763392716646, "loss_real": 0.016425729817710816, "loss_synth": 0.022475221771746875, "lr": 9.682149106049004e-05, "elapsed": 1454.7501978669898, "steps_per_second": 27.481450891875166, "loss_extra": 0.02203108976595104} +{"step": 37800, "loss": 0.021666818307712676, "loss_real": 0.01646563408896327, "loss_synth": 0.0224808578658849, "lr": 9.424196065660837e-05, "elapsed": 1459.0258452609996, "steps_per_second": 27.550746906665776, "loss_extra": 0.022029493730515243} +{"step": 38000, "loss": 0.02161797705106437, "loss_real": 0.016268780063837765, "loss_synth": 0.022496854923665523, "lr": 9.169586930191606e-05, "elapsed": 1463.2785179579514, "steps_per_second": 27.62007806687002, "loss_extra": 0.021980582643300293} +{"step": 38200, "loss": 0.021634936574846508, "loss_real": 0.016381816058419645, "loss_synth": 0.0225778953358531, "lr": 8.91836190537533e-05, "elapsed": 1467.7617072809953, "steps_per_second": 27.683595210561453, "loss_extra": 0.021971115730702876} +{"step": 38400, "loss": 0.021593918269500138, "loss_real": 0.0162943547219038, "loss_synth": 0.022638006247580052, "lr": 8.670560662555727e-05, "elapsed": 1471.9198389810044, "steps_per_second": 27.754133887270847, "loss_extra": 0.02190993291325867} +{"step": 38600, "loss": 0.021571766631677747, "loss_real": 0.016384504279121758, "loss_synth": 0.02253067895770073, "lr": 8.426222332421624e-05, "elapsed": 1476.0823434759513, "steps_per_second": 27.82408603211261, "loss_extra": 0.021896805902943014} +{"step": 38800, "loss": 0.02156829080544412, "loss_real": 0.016379407211206853, "loss_synth": 0.02264336384832859, "lr": 8.185385498827815e-05, "elapsed": 1480.6266016229638, "steps_per_second": 27.88477268055798, "loss_extra": 0.02186454327777028} +{"step": 39000, "loss": 0.021525612864643336, "loss_real": 0.01626474785618484, "loss_synth": 0.022358553456142544, "lr": 7.948088192702195e-05, "elapsed": 1484.81002471596, "steps_per_second": 27.953296238819238, "loss_extra": 0.02189006601460278} +{"step": 39200, "loss": 0.021605946887284518, "loss_real": 0.016447588545270266, "loss_synth": 0.02249613813124597, "lr": 7.714367886040248e-05, "elapsed": 1489.165077166981, "steps_per_second": 28.01741017567934, "loss_extra": 0.021944977436214687} +{"step": 39400, "loss": 0.021509311785921456, "loss_real": 0.016460365173406898, "loss_synth": 0.02239486248232424, "lr": 7.48426148598775e-05, "elapsed": 1493.3390692339744, "steps_per_second": 28.08521928623811, "loss_extra": 0.021837600385770203} +{"step": 39600, "loss": 0.0215575872734189, "loss_real": 0.016165901208296418, "loss_synth": 0.022590327644720673, "lr": 7.25780532901276e-05, "elapsed": 1498.7055291489814, "steps_per_second": 28.12527894617827, "loss_extra": 0.021886450247839095} +{"step": 39800, "loss": 0.02154196516610682, "loss_real": 0.01636251136660576, "loss_synth": 0.02247419873252511, "lr": 7.035035175167622e-05, "elapsed": 1513.2478723329841, "steps_per_second": 27.957368071651587, "loss_extra": 0.02187280707061291} +{"step": 40000, "loss": 0.02150614439509809, "loss_real": 0.016226168982684613, "loss_synth": 0.02247552468441427, "lr": 6.81598620244206e-05, "elapsed": 1519.4571393809747, "steps_per_second": 27.978476023002184, "loss_extra": 0.021838656421750785} +{"step": 40200, "loss": 0.0215177736338228, "loss_real": 0.016460450356826185, "loss_synth": 0.022368467403575776, "lr": 6.600693001208181e-05, "elapsed": 1549.4559249859885, "steps_per_second": 27.479381518593016, "loss_extra": 0.021855664290487766} +{"step": 40400, "loss": 0.02150900091044605, "loss_real": 0.016213260786607862, "loss_synth": 0.02256010509096086, "lr": 6.38918956875819e-05, "elapsed": 1555.45773035998, "steps_per_second": 27.506634919089542, "loss_extra": 0.021822850527241824} +{"step": 40600, "loss": 0.02148939379490912, "loss_real": 0.016014945111237466, "loss_synth": 0.02258495452813804, "lr": 6.181509303935915e-05, "elapsed": 1561.557569711993, "steps_per_second": 27.53154783310173, "loss_extra": 0.021811593817546965} +{"step": 40800, "loss": 0.02138078141026199, "loss_real": 0.01634861569851637, "loss_synth": 0.022293758885934947, "lr": 5.977685001862671e-05, "elapsed": 1567.8012169689755, "steps_per_second": 27.55317686746717, "loss_extra": 0.021700406577438117} +{"step": 41000, "loss": 0.021448818556964396, "loss_real": 0.016200224440544843, "loss_synth": 0.022552608819678424, "lr": 5.7777488487585654e-05, "elapsed": 1574.005968813959, "steps_per_second": 27.57542056181716, "loss_extra": 0.021744404314085843} +{"step": 41200, "loss": 0.021369386529549957, "loss_real": 0.016247282954864203, "loss_synth": 0.022162963906303047, "lr": 5.581732416859908e-05, "elapsed": 1580.1018334779656, "steps_per_second": 27.59974491076734, "loss_extra": 0.021728563541546463} +{"step": 41400, "loss": 0.021447173934429884, "loss_real": 0.016246048463508488, "loss_synth": 0.02226650628261268, "lr": 5.3896666594335835e-05, "elapsed": 1586.175262689998, "steps_per_second": 27.624314540440533, "loss_extra": 0.0218085231911391} +{"step": 41600, "loss": 0.021417638380080463, "loss_real": 0.01606242161244154, "loss_synth": 0.022385130720213055, "lr": 5.20158190588919e-05, "elapsed": 1592.4006173509988, "steps_per_second": 27.645485879791064, "loss_extra": 0.021758804051205515} +{"step": 41800, "loss": 0.021411644499748944, "loss_real": 0.016042404505424202, "loss_synth": 0.022444267068058254, "lr": 5.017507856989665e-05, "elapsed": 1598.520129182958, "steps_per_second": 27.668660730894675, "loss_extra": 0.021738095814362167} +{"step": 42000, "loss": 0.021290733264759183, "loss_real": 0.015805275230668485, "loss_synth": 0.022352867117151617, "lr": 4.837473580161169e-05, "elapsed": 1604.8898666229798, "steps_per_second": 27.686438340273877, "loss_extra": 0.021622465373948217} +{"step": 42200, "loss": 0.02135034669190645, "loss_real": 0.01612731799017638, "loss_synth": 0.022240436729043724, "lr": 4.6615075049030575e-05, "elapsed": 1611.1187313319533, "steps_per_second": 27.70695408862174, "loss_extra": 0.021696435278281568} +{"step": 42400, "loss": 0.02132586290128529, "loss_real": 0.016066068881191314, "loss_synth": 0.02236335783265531, "lr": 4.489637418298455e-05, "elapsed": 1617.356346806977, "steps_per_second": 27.727100475873375, "loss_extra": 0.021639196537435054} +{"step": 42600, "loss": 0.02141464116051793, "loss_real": 0.01615800986997783, "loss_synth": 0.022520778039470314, "lr": 4.321890460626433e-05, "elapsed": 1623.6166567089967, "steps_per_second": 27.74659670995115, "loss_extra": 0.021710516037419438} +{"step": 42800, "loss": 0.021375443022698164, "loss_real": 0.016027159527875482, "loss_synth": 0.02232836185954511, "lr": 4.158293121076186e-05, "elapsed": 1630.0112830299768, "steps_per_second": 27.763174467645538, "loss_extra": 0.02171948818489909} +{"step": 43000, "loss": 0.02132429980672896, "loss_real": 0.015893762093037368, "loss_synth": 0.022339794831350446, "lr": 3.99887123356411e-05, "elapsed": 1636.5189881539554, "steps_per_second": 27.777300993462557, "loss_extra": 0.021661687837913633} +{"step": 43200, "loss": 0.021323019107803702, "loss_real": 0.016176568530499934, "loss_synth": 0.02229137685149908, "lr": 3.843649972654328e-05, "elapsed": 1643.059534695989, "steps_per_second": 27.79062980321523, "loss_extra": 0.021641264725476502} +{"step": 43400, "loss": 0.021270751506090164, "loss_real": 0.016042208429425955, "loss_synth": 0.022243161741644143, "lr": 3.69265384958331e-05, "elapsed": 1649.6406247599516, "steps_per_second": 27.803016165012412, "loss_extra": 0.02159691453911364} +{"step": 43600, "loss": 0.021371689969673754, "loss_real": 0.016161490874364973, "loss_synth": 0.022359383357688785, "lr": 3.545906708389291e-05, "elapsed": 1656.33534233697, "steps_per_second": 27.813007686328987, "loss_extra": 0.021692047324031592} +{"step": 43800, "loss": 0.021307437969371675, "loss_real": 0.015990460184402765, "loss_synth": 0.022264362182468175, "lr": 3.403431722147019e-05, "elapsed": 1663.2675463649794, "steps_per_second": 27.818165935792955, "loss_extra": 0.02164707955904305} +{"step": 44000, "loss": 0.02128668020479381, "loss_real": 0.016121676862239837, "loss_synth": 0.022325844736769795, "lr": 3.265251389308442e-05, "elapsed": 1670.4742441999842, "steps_per_second": 27.81782561496391, "loss_extra": 0.02158928893506527} +{"step": 44200, "loss": 0.021337251095101237, "loss_real": 0.015964808403514327, "loss_synth": 0.022385127088055016, "lr": 3.1313875301499545e-05, "elapsed": 1678.0536421059514, "steps_per_second": 27.81013358097615, "loss_extra": 0.02166024761274457} +{"step": 44400, "loss": 0.021273093968629836, "loss_real": 0.0160647866781801, "loss_synth": 0.02228106154128909, "lr": 3.0018612833267117e-05, "elapsed": 1685.659607405949, "steps_per_second": 27.80200261822593, "loss_extra": 0.021588190533220766} +{"step": 44600, "loss": 0.021314838584512472, "loss_real": 0.016018330459482966, "loss_synth": 0.022313240207731722, "lr": 2.8766931025346027e-05, "elapsed": 1691.0932734429953, "steps_per_second": 27.836399698624394, "loss_extra": 0.02164191265590489} +{"step": 44800, "loss": 0.021217872789129615, "loss_real": 0.016020219828933476, "loss_synth": 0.02198691848665476, "lr": 2.755902753280375e-05, "elapsed": 1695.3403226219816, "steps_per_second": 27.893713176109465, "loss_extra": 0.02159138281829655} +{"step": 45000, "loss": 0.021297628032043575, "loss_real": 0.016001368006691337, "loss_synth": 0.022384117553010584, "lr": 2.639509309760422e-05, "elapsed": 1699.5244454449858, "steps_per_second": 27.951915546553536, "loss_extra": 0.021602711295709013} +{"step": 45200, "loss": 0.02129564084112644, "loss_real": 0.01612239621579647, "loss_synth": 0.022258088560774922, "lr": 2.5275311518487436e-05, "elapsed": 1704.745097520994, "steps_per_second": 27.989564141263237, "loss_extra": 0.021618273993954062} +{"step": 45400, "loss": 0.021199696315452456, "loss_real": 0.015993672157637775, "loss_synth": 0.022157399551942944, "lr": 2.4199859621945708e-05, "elapsed": 1708.8697811299935, "steps_per_second": 28.048265482841256, "loss_extra": 0.02152707749977708} +{"step": 45600, "loss": 0.021272744005545973, "loss_real": 0.015936251473613085, "loss_synth": 0.022289044754579664, "lr": 2.316890723430054e-05, "elapsed": 1713.6401595209609, "steps_per_second": 28.094073466229315, "loss_extra": 0.02159970342181623} +{"step": 45800, "loss": 0.021208719983696937, "loss_real": 0.01605449628084898, "loss_synth": 0.022242452511563898, "lr": 2.218261715488513e-05, "elapsed": 1719.4323907859507, "steps_per_second": 28.119762126378397, "loss_extra": 0.02151151083409786} +{"step": 46000, "loss": 0.02120051902718842, "loss_real": 0.015683906562626363, "loss_synth": 0.022111991764977575, "lr": 2.1241145130336496e-05, "elapsed": 1725.3816596989636, "steps_per_second": 28.142212729380773, "loss_extra": 0.021573204565793275} +{"step": 46200, "loss": 0.021175848906859755, "loss_real": 0.015646008211188018, "loss_synth": 0.022133836681023242, "lr": 2.0344639830001105e-05, "elapsed": 1731.3214119829936, "steps_per_second": 28.164663954008194, "loss_extra": 0.021538375178352} +{"step": 46400, "loss": 0.02115998715162277, "loss_real": 0.015789207816123963, "loss_synth": 0.022121870890259743, "lr": 1.949324282245851e-05, "elapsed": 1737.3184402969782, "steps_per_second": 28.18583445147855, "loss_extra": 0.021504243584349752} +{"step": 46600, "loss": 0.021217459812760353, "loss_real": 0.015909226574003697, "loss_synth": 0.022038782788440583, "lr": 1.8687088553165976e-05, "elapsed": 1743.2398508399492, "steps_per_second": 28.208279090895406, "loss_extra": 0.021589960968121887} +{"step": 46800, "loss": 0.021219519972801207, "loss_real": 0.01584743995219469, "loss_synth": 0.022285446263849734, "lr": 1.7926304323227836e-05, "elapsed": 1749.348112972977, "steps_per_second": 28.226982109388068, "loss_extra": 0.021537975948303936} +{"step": 47000, "loss": 0.021181705798953773, "loss_real": 0.01581797215156257, "loss_synth": 0.02224280869588256, "lr": 1.721101026929328e-05, "elapsed": 1755.3266585989622, "steps_per_second": 28.247995740303978, "loss_extra": 0.02150045705027878} +{"step": 47200, "loss": 0.02119176653213799, "loss_real": 0.016162783717736603, "loss_synth": 0.022096258141100406, "lr": 1.6541319344585365e-05, "elapsed": 1761.2170899079647, "steps_per_second": 28.270509731042758, "loss_extra": 0.021513161472976206} +{"step": 47400, "loss": 0.021182176107540727, "loss_real": 0.016102555957622826, "loss_synth": 0.02210323713719845, "lr": 1.5917337301064426e-05, "elapsed": 1767.3117644789745, "steps_per_second": 28.28899128099191, "loss_extra": 0.021504946611821653} +{"step": 47600, "loss": 0.02123750953003764, "loss_real": 0.01588912802748382, "loss_synth": 0.022337619299069047, "lr": 1.533916267272854e-05, "elapsed": 1773.3660917169764, "steps_per_second": 28.308082083771758, "loss_extra": 0.021544865500181913} +{"step": 47800, "loss": 0.021128973411396145, "loss_real": 0.015850582015700637, "loss_synth": 0.022141905007883905, "lr": 1.480688676005397e-05, "elapsed": 1779.4411136769922, "steps_per_second": 28.326631911312404, "loss_extra": 0.021450454257428645} +{"step": 48000, "loss": 0.021159204449504615, "loss_real": 0.015996343223378062, "loss_synth": 0.02211165824905038, "lr": 1.432059361557764e-05, "elapsed": 1785.6909810619545, "steps_per_second": 28.341766617036832, "loss_extra": 0.021483200239017605} +{"step": 48200, "loss": 0.021218351935967803, "loss_real": 0.015749467755667865, "loss_synth": 0.022232129899784923, "lr": 1.3880360030624374e-05, "elapsed": 1791.9006759139593, "steps_per_second": 28.35752491777563, "loss_extra": 0.021560338465496896} +{"step": 48400, "loss": 0.021190971359610556, "loss_real": 0.015795878288336097, "loss_synth": 0.022161338021978737, "lr": 1.3486255523180529e-05, "elapsed": 1798.0689664249658, "steps_per_second": 28.37392330925349, "loss_extra": 0.02153575680218637} +{"step": 48600, "loss": 0.021223732577636836, "loss_real": 0.01601109142880887, "loss_synth": 0.022120733382180333, "lr": 1.313834232691649e-05, "elapsed": 1804.1807205699733, "steps_per_second": 28.391235164738074, "loss_extra": 0.021566968550905584} +{"step": 48800, "loss": 0.021120564378798008, "loss_real": 0.015769710731692612, "loss_synth": 0.02204622750170529, "lr": 1.2836675381359077e-05, "elapsed": 1810.295806545997, "steps_per_second": 28.408348373595828, "loss_extra": 0.02147168489173055} +{"step": 49000, "loss": 0.02117406630888581, "loss_real": 0.015852914317511024, "loss_synth": 0.02200672077946365, "lr": 1.2581302323216026e-05, "elapsed": 1816.4245901789982, "steps_per_second": 28.42507484101559, "loss_extra": 0.021545147048309444} +{"step": 49200, "loss": 0.021181119391694665, "loss_real": 0.015758864781819284, "loss_synth": 0.022200068812817334, "lr": 1.2372263478853567e-05, "elapsed": 1822.6720423569786, "steps_per_second": 28.439497721716936, "loss_extra": 0.021516745034605263} +{"step": 49400, "loss": 0.021183063061907887, "loss_real": 0.0158627442875877, "loss_synth": 0.022287113973870874, "lr": 1.2209591857928498e-05, "elapsed": 1828.9147167539923, "steps_per_second": 28.453892234290674, "loss_extra": 0.02148638425394893} +{"step": 49600, "loss": 0.021167519092559813, "loss_real": 0.016057286635041235, "loss_synth": 0.022160213394090533, "lr": 1.2093313148175555e-05, "elapsed": 1835.1348805209855, "steps_per_second": 28.468581086675258, "loss_extra": 0.021475758021697402} +{"step": 49800, "loss": 0.021243602922186255, "loss_real": 0.015980454105883838, "loss_synth": 0.022235417859628796, "lr": 1.2023445711350887e-05, "elapsed": 1841.2922386109713, "steps_per_second": 28.48429114832284, "loss_extra": 0.021568691255524755} +{"step": 50000, "loss": 0.021087485607713462, "loss_real": 0.01596258480101824, "loss_synth": 0.02205322351306677, "lr": 1.2000000580332747e-05, "elapsed": 1847.6269576419727, "steps_per_second": 28.4966777125726, "loss_extra": 0.021404040865600108} diff --git a/shared/package-files/59/59df6403286cfcfc73c3d70ed49f9a03834095418668ab8415f8766005941818/v4.json b/shared/package-files/59/59df6403286cfcfc73c3d70ed49f9a03834095418668ab8415f8766005941818/v4.json new file mode 100644 index 0000000000000000000000000000000000000000..052b932db2126636ef5f6a6564d42469cd829487 --- /dev/null +++ b/shared/package-files/59/59df6403286cfcfc73c3d70ed49f9a03834095418668ab8415f8766005941818/v4.json @@ -0,0 +1,4 @@ +{ + "base": {}, + "noprec_pp0.75": {"drop_precursor": true, "pred_power": 0.75} +} diff --git a/shared/package-files/5f/5f0735dba42dc4cc2a6edb5c6e7d8399c6de986938b55f09b159d4ec507b76d7/E72-draft-part2.md b/shared/package-files/5f/5f0735dba42dc4cc2a6edb5c6e7d8399c6de986938b55f09b159d4ec507b76d7/E72-draft-part2.md new file mode 100644 index 0000000000000000000000000000000000000000..ed912e7f30b6959274edeabe597722a03dd6b912 --- /dev/null +++ b/shared/package-files/5f/5f0735dba42dc4cc2a6edb5c6e7d8399c6de986938b55f09b159d4ec507b76d7/E72-draft-part2.md @@ -0,0 +1,69 @@ +- **Changed factor (d): the union input inside the release rule, and the inverse weights.** + The inverse distances of the saved full-fold branch outputs are replaced by those of the + candidate input (hybrid, 100 / 48), the consensus term is recomputed with the packaged + code and the result is compared with the release by a paired bootstrap over pools + (`analysis/inv_swap.py`, `logs/swap-grid2.sh`, `logs/swap-N5-recur-hyb-s10-f5-p48-w*.log`; + one setting takes about 2.5 minutes, mostly the consensus term). The weight of a + non-domain spectrum is `max(other, 0.5 / n)`. Hit@5 / Hit@20 columns: per-query + difference; the pool-macro columns count pools. + | weights domain / other | Hit@1 (difference [interval]) | pool-macro Hit@1 difference, pools + / - | Hit@5 / Hit@20 per query | pool-macro Hit@5 | pool-macro Hit@20 | + |---|---|---|---|---|---| + | 0.75 / 0.05 (released weights) | 0.8079 (+0.0016 [-0.0021, +0.0061]) | +0.0021 [-0.0006, +0.0047], 15 / 8 | +0.0097 / -0.0023 | +0.0012 (11 / 7) | -0.0012 [-0.0030, +0.0003] (2 / 6) | + | 0.75 / 0.1 | 0.8093 (+0.0030 [-0.0084, +0.0129]) | +0.0030 [+0.0003, +0.0056], 18 / 8 | +0.0063 / -0.0082 | +0.0012 (11 / 7) | -0.0021 [-0.0041, 0.0000] (3 / 10) | + | 0.75 / 0.15 | 0.8110 (+0.0047) | +0.0030 [-0.0006, +0.0065], 23 / 13 | -0.0005 / -0.0144 | | | + | 0.75 / 0.2 | 0.8164 (+0.0101 [-0.0034, +0.0250]) | +0.0044 [+0.0012, +0.0080], 27 / 12 | -0.0009 / -0.0122 | +0.0006 (13 / 11) | -0.0035 [-0.0062, -0.0009] (4 / 16) | + | 0.75 / 0.3 | 0.8080 (+0.0017) | +0.0032 [-0.0003, +0.0071], 29 / 18 | -0.0089 / -0.0137 | | | + | 0.75 / 0.5 | 0.7935 (-0.0128) | +0.0021 [-0.0027, +0.0068], 36 / 29 | -0.0151 / -0.0218 | | | + | 1.0 / 0.1 | 0.8102 (+0.0039 [-0.0081, +0.0137]) | +0.0041 [+0.0006, +0.0077], 27 / 13 | +0.0055 / +0.0195 | 0.0000 (11 / 11) | -0.0018 [-0.0041, +0.0006] (5 / 11) | + | 1.0 / 0.15 | 0.8113 (+0.0050) | +0.0035 [-0.0003, +0.0074], 30 / 18 | -0.0016 / -0.0146 | -0.0012 (11 / 15) | -0.0035 (4 / 16) | + | **1.0 / 0.2 (chosen)** | **0.8173 (+0.0111 [-0.0032, +0.0263])** | **+0.0053 [+0.0012, +0.0097], 35 / 17** | -0.0020 / -0.0124 | -0.0009 [-0.0041, +0.0021] (13 / 16) | -0.0035 [-0.0062, -0.0009] (5 / 17) | + | 1.0 / 0.3 | 0.8082 (+0.0019) | +0.0038 [-0.0003, +0.0083], 36 / 23 | -0.0093 / -0.0141 | | | + | 1.25 / 0.2 | 0.8168 (+0.0106) | +0.0041 [0.0000, +0.0092], 38 / 24 | -0.0021 / -0.0125 | | | + All eleven pairs have a positive pool-macro Hit@1 difference (+0.0021 to +0.0053). The + per-query Hit@20 column jumps by +/- 0.028 between neighbouring rows: that is the pool of + 542 spectra entering or leaving the first twenty; the pool-macro Hit@20 column is the + stable reading, and it is negative from an other-weight of 0.15 on (17 pools lose the + label from the first twenty, 5 gain it, twelve of the 17 are non-domain pools of three or + more spectra). A larger weight outside the domain converts more pools at rank 1 (36 at + 0.5) and loses more (29). Chosen: **1.0 / 0.2 / 0.5** - the largest pool-macro Hit@1 + gain, interval above zero - knowing that Hit@20 pays for it. Hit@1 is the task's primary + metric. The weights were picked among eleven on this fold; with the released weights the + input alone gives +0.0021 [-0.0006, +0.0047]. +- **Changed factor (e): bounded forms of the inverse term for non-domain spectra + (negative in the full rule).** `clipK`: every candidate beyond the inverse branch's K-th + best of the pool gets the K-th best distance, so the term separates only the branch's + first K candidates from the rest (`analysis/inv_bonus.py`, `logs/inv-bonus-hyb-p48-d1.log`; + domain weight 1.0; first **without** the consensus term, against the released rule + without it: 0.7685, pool-macro 0.8650). + | form, other-weight | pool-macro Hit@1 difference, pools + / - | pool-macro Hit@20 difference | + |---|---|---| + | linear 0.1 / 0.2 / 0.3 / 0.5 | +0.0059 [+0.0018, +0.0100] 37 / 17; +0.0056 38 / 19; +0.0065 48 / 26; +0.0080 [+0.0021, +0.0139] 62 / 35 | -0.0018; -0.0035 [-0.0062, -0.0009]; -0.0041; -0.0077 [-0.0112, -0.0044] | + | clip5, 0.1 - 0.5 | +0.0021 to +0.0056 | -0.0027 to -0.0032 | + | clip10, 0.1 / 0.3 / 0.5 | +0.0032; +0.0038; **+0.0086 [+0.0032, +0.0139] 60 / 31** | -0.0024; -0.0012; -0.0012 [-0.0041, +0.0021] | + | clip20, 0.1 / 0.3 / 0.5 | +0.0032; +0.0047; +0.0083 [+0.0027, +0.0136] 61 / 33 | -0.0009; 0.0000; -0.0009 | + | clip40, 0.1 / 0.3 / 0.5 | +0.0038; +0.0059; +0.0083 | -0.0003; -0.0030; -0.0041 [-0.0074, -0.0012] | + Without the consensus term clip10 / clip20 at weight 0.5 looked like the answer: the + largest gain at rank 1 and no loss at rank 20. **With the consensus term** (the full + rule; `logs/swap-N5-recur-hyb-s10-f5-p48-clip{10,20}-w*.log`): clip10 1.0 / 0.5: Hit@1 + 0.8022 (-0.0041), pool-macro +0.0015 [-0.0030, +0.0065] (36 / 31); clip10 1.0 / 0.3: + 0.8026, +0.0012; clip20 1.0 / 0.5: 0.7982 (-0.0081), +0.0012; clip20 1.0 / 0.3: 0.8033, + +0.0015 (pool-macro Hit@20 0.0000). Flat. The clipped term moves many pools both ways + (60 / 31 without the consensus term), and the consensus term, which reads the first ten + candidates of every pool, already repairs most of what the clipped term repairs and is + hurt by the pools it breaks. Dropped. Lesson for the next screens: a form is chosen in the + full rule, not without the consensus term. +- **Package.** Build `5Ms-N5u48-L-ion-net2` (`logs/build-5Ms-N5u48-L-ion-net2.cmd`; 8 s): + `model.pt` byte-identical to the release (sha256 + `983068f579f829c65c3f3f63d33319876c383c3150834a6729354d4972a8ce6c`), `infer.py` (sha256 + `4f49a2bf196cbea3639df8e8d42045060298db274ab42e677efd6be10960f1e4`) and `invrun.py` + (`1971da48c1dfb6e45816c8eb288108a0e28bee877895366d25306a27fa8ce60a`) changed, + `model_config.json` -> `inverse`: `{"pooled": true, "score": {"members": "probability", + "power": 0.7}, "weight_domain": 1.0, "weight_other": 0.2, "weight_other_single": 0.5, + "batch": 2048, "input": {"min_group": 3, "top_peaks": 100, "max_peaks": 48, "domain": + {"agg": "sqrt", "tol_mda": 10}, "other": {"agg": "freq", "tol_mda": 5}}}`. Code: + `invrun.py` - `clean_spectrum`, `union_spectrum(spectra, agg, tol)` (sums in an order + fixed by the peak values, so the union does not depend on the order of the queries), + `merged_queries(queries, options)` (groups keyed by pool, adduct and domain flag), + `build_store(..., top_peaks, max_peaks)`; `infer.py` builds the inverse store from the + merged queries and logs `merged_spectra`. Without `inverse.input` the code computes what + the release computed. Every other inference file is byte-identical to the release. diff --git a/shared/package-files/5f/5f4f853de1a44616d5ee26e2cd86f3c43493c978cca64e9ebc122bfeaa5a87f3/I31-ff512x6-real08-corpus2+train3-noise05-p48.log b/shared/package-files/5f/5f4f853de1a44616d5ee26e2cd86f3c43493c978cca64e9ebc122bfeaa5a87f3/I31-ff512x6-real08-corpus2+train3-noise05-p48.log new file mode 100644 index 0000000000000000000000000000000000000000..ae76a45cc1686804f75b4b15fe9d5c15849963d3 --- /dev/null +++ b/shared/package-files/5f/5f4f853de1a44616d5ee26e2cd86f3c43493c978cca64e9ebc122bfeaa5a87f3/I31-ff512x6-real08-corpus2+train3-noise05-p48.log @@ -0,0 +1,12 @@ +{"extra_rows": 2031301, "extra_structures": 434950} +{"args": {"store": "inv/p48", "out": "runs/I31-ff512x6-real08-corpus2+train3-noise05-p48", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/p48/corpus2+train3.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 1, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "noise_rate": 0.5, "noise_max": 12, "noise_scatter": 0.35, "noise_shape": 3.0, "noise_real_rate": 0.0, "synth_peak_drop": -1.0, "synth_jitter": -1.0, "synth_rank_drop": 0.0, "rank_keep": "inv/rank_keep.json", "noise_near": 0.0, "noise_deltas": "inv/noise_deltas.json", "merge_rate": 0.0, "merge_max": 8, "max_peaks": 48, "merge_agg": "mean", "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"corpus2+train3.manifest.json": null, "real-train.manifest.json": "285c6276063d8a0447d69e9f06b3cebdd0055a74d710c6f48dccbe667ce662f5", "real-validation.manifest.json": "4c0dec880ce9abc3419fabbb4b8d501fa4858c972c748fe6c03ade121918efc9", "synth.manifest.json": "684578a185d001a57622f60abe379ec25323f8f7d0396912b84477ab560e8c1c", "train3.manifest.json": null}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 18.605299021000974, "extra_store": {"path": "inv/p48/corpus2+train3.npz", "rows": 2031301, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/p48/train3.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 24.995693842426785, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 48, "annotate_seconds": 48.04048602702096}], "spectra": 2031301, "structures": 434950}}} +{"step": 5000, "elapsed": 188.44014291994972, "val_loss": 0.03683927150103723, "val_cos": 0.6407414596897679, "val_loss_ema": 0.03504845598929516, "val_cos_ema": 0.6564498713665783} +{"step": 10000, "elapsed": 359.877319569001, "val_loss": 0.032584244018661494, "val_cos": 0.6887826712907413, "val_loss_ema": 0.03080546809909237, "val_cos_ema": 0.7040772351414123, "ind_cos": 0.4557105357970045, "agg_cos": 0.48731277986515004, "ind_nll": 0.3242575531422101, "agg_nll": 0.3030006691028874, "retrieval_seconds": 27.676224961003754} +{"step": 15000, "elapsed": 558.8881023199647, "val_loss": 0.030491862247236733, "val_cos": 0.7125364709326265, "val_loss_ema": 0.0292606568752483, "val_cos_ema": 0.7239501362533134} +{"step": 20000, "elapsed": 733.2714164649951, "val_loss": 0.029328797197211844, "val_cos": 0.7257959243230159, "val_loss_ema": 0.02855716261396664, "val_cos_ema": 0.7353564631559139, "ind_cos": 0.5196870657264914, "agg_cos": 0.5466055895825828, "ind_nll": 0.4023881826136188, "agg_nll": 0.38658706057954606, "retrieval_seconds": 35.30785546597326} +{"step": 25000, "elapsed": 944.2061427379958, "val_loss": 0.029477505401905052, "val_cos": 0.7303897112161588, "val_loss_ema": 0.02820178730942229, "val_cos_ema": 0.7418727271009188} +{"step": 30000, "elapsed": 1121.4613957649563, "val_loss": 0.02867507993472427, "val_cos": 0.7396895728517937, "val_loss_ema": 0.02798429989116523, "val_cos_ema": 0.7466197286031834, "ind_cos": 0.5459879561480262, "agg_cos": 0.5643625508260847, "ind_nll": 0.435328632456637, "agg_nll": 0.4202480827628802, "retrieval_seconds": 34.90799390495522} +{"step": 35000, "elapsed": 1338.5153633349692, "val_loss": 0.028347130239982355, "val_cos": 0.7458107182722992, "val_loss_ema": 0.02797236278867125, "val_cos_ema": 0.7495803781959314} +{"step": 40000, "elapsed": 1510.6951300670044, "val_loss": 0.028978511820708774, "val_cos": 0.743869505635905, "val_loss_ema": 0.028269017004697996, "val_cos_ema": 0.7488284416577667, "ind_cos": 0.5453188532605898, "agg_cos": 0.5658036955067167, "ind_nll": 0.4457254619383396, "agg_nll": 0.4395491275927737, "retrieval_seconds": 32.74387503496837} +{"step": 45000, "elapsed": 1835.5638341539889, "val_loss": 0.02826723698280237, "val_cos": 0.7493500724995497, "val_loss_ema": 0.028099759030350693, "val_cos_ema": 0.7508085705284304} +{"step": 50000, "elapsed": 2020.5254812449566, "val_loss": 0.028140015876742926, "val_cos": 0.7513877652285244, "val_loss_ema": 0.028102371535462453, "val_cos_ema": 0.7513449159037393, "ind_cos": 0.5476349786401771, "agg_cos": 0.5697153739255751, "ind_nll": 0.4457254619383396, "agg_nll": 0.4357403880796747, "retrieval_seconds": 27.92800392699428} diff --git a/shared/package-files/5f/5fa054bda0e1429c4b214713ff89f205962305bed3c96f9a63ef6e260bcc30c6/scorelab-v4.log b/shared/package-files/5f/5fa054bda0e1429c4b214713ff89f205962305bed3c96f9a63ef6e260bcc30c6/scorelab-v4.log new file mode 100644 index 0000000000000000000000000000000000000000..90e1b8016707afea5af098d940eb5a07757d4edc --- /dev/null +++ b/shared/package-files/5f/5fa054bda0e1429c4b214713ff89f205962305bed3c96f9a63ef6e260bcc30c6/scorelab-v4.log @@ -0,0 +1,6 @@ +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 6.228125552996062} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 6.555059119942598} +ind base all=0.4825 dom=0.7344 non=0.1887 h5=0.5906 h20=0.6791 | diff=+0.0000 [+0.0000,+0.0000] +agg base all=0.6092 dom=0.8218 non=0.3613 h5=0.7112 h20=0.8337 | diff=+0.0000 [+0.0000,+0.0000] +ind noprec_pp0.75 all=0.5072 dom=0.7535 non=0.2200 h5=0.6344 h20=0.7163 | diff=+0.0247 [+0.0136,+0.0346] +agg noprec_pp0.75 all=0.6465 dom=0.8028 non=0.4642 h5=0.8151 h20=0.9204 | diff=+0.0373 [-0.0159,+0.1040] diff --git a/shared/package-files/5f/5fb5c8786faa09bcd15095e8eb72a9e1201d805cc3522d97d7a2e639679228cc/report-ind.json b/shared/package-files/5f/5fb5c8786faa09bcd15095e8eb72a9e1201d805cc3522d97d7a2e639679228cc/report-ind.json new file mode 100644 index 0000000000000000000000000000000000000000..af452c922536697e4aa6f28f5af88be893cfdc80 --- /dev/null +++ b/shared/package-files/5f/5fb5c8786faa09bcd15095e8eb72a9e1201d805cc3522d97d7a2e639679228cc/report-ind.json @@ -0,0 +1,111 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": false, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.44361521437027124, + "saturation": null, + "score": 0.8891953694132131, + "unclipped_score": 0.8891953694132131, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.44361521437027124, + "hit_rate_at_20": 0.6717792989860518, + "hit_rate_at_5": 0.5885531936795512 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.5416553226245576, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.13953979311800718, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.444175132793564, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.15789473684210525, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.6974070450097848, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.6866624122527122, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.515, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.669551282051282, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.20996403638671463, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.5637860082304527, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.43926029563842084, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.4488817891373802, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.21268695203713253, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.6736182453256626, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.44361521437027124, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.41335082156244946, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.47327252680824555 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/61/618b32316fba6aa3c5612f7f1527895cefce8a96baf2e5c8e6e540adee104849/scorelab-v4.log b/shared/package-files/61/618b32316fba6aa3c5612f7f1527895cefce8a96baf2e5c8e6e540adee104849/scorelab-v4.log new file mode 100644 index 0000000000000000000000000000000000000000..3c8d1d1a7158788c51591bbd1ea0873fc0da0061 --- /dev/null +++ b/shared/package-files/61/618b32316fba6aa3c5612f7f1527895cefce8a96baf2e5c8e6e540adee104849/scorelab-v4.log @@ -0,0 +1,6 @@ +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 6.320709923049435} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 6.6532866910565645} +ind base all=0.4844 dom=0.7284 non=0.1998 h5=0.5929 h20=0.6926 | diff=+0.0000 [+0.0000,+0.0000] +agg base all=0.6083 dom=0.8088 non=0.3744 h5=0.7010 h20=0.8328 | diff=+0.0000 [+0.0000,+0.0000] +ind noprec_pp0.75 all=0.4956 dom=0.7413 non=0.2089 h5=0.6344 h20=0.7210 | diff=+0.0112 [-0.0005,+0.0230] +agg noprec_pp0.75 all=0.6437 dom=0.8071 non=0.4531 h5=0.8067 h20=0.9180 | diff=+0.0354 [-0.0114,+0.0985] diff --git a/shared/package-files/61/61a24c5c93217e6a38b7a701d8f025e6ee0bc6cac35e5e18e4c5a8ee14d7114c/synth_library.py b/shared/package-files/61/61a24c5c93217e6a38b7a701d8f025e6ee0bc6cac35e5e18e4c5a8ee14d7114c/synth_library.py new file mode 100644 index 0000000000000000000000000000000000000000..49bbac292111d5e24558c3b458649a41d347a44c --- /dev/null +++ b/shared/package-files/61/61a24c5c93217e6a38b7a701d8f025e6ee0bc6cac35e5e18e4c5a8ee14d7114c/synth_library.py @@ -0,0 +1,164 @@ +"""Synthetic-corpus library (lab, E49): neighbours of validation queries among the supplied ICEBERG simulations. + +synth_library.py build LIB_DIR [--bin 0.01] [--min-mz 0] [--workers 6] +synth_library.py neighbours LIB_DIR OUT.npz [--top 32] [--chunk 200] [--workers 6] [--queries validation-input] + +Hypothesis (E49): the library-neighbour branch of E48 is limited by the train fold's 25,046 +structures (best neighbour's Tanimoto to the label 0.16). The supplied synthetic_augmentation +corpus holds simulated spectra of 432,467 further structures (optional training data for any +method, held-out-clean); as a second library it offers seventeen times more analogues, at the +price of comparing measured with simulated spectra. + +`build` reads only the prepared synthetic store (`synth/spectra.npz`, `synth/structures.json`, +made by prepare_synth.py from the supplied corpus); no train, validation or test record. +Vectors as in pkg/library.py: peaks at or above precursor - 0.5 dropped, 0.01 Da bins, fragment +and neutral-loss view, L2-normalised rows. The stored intensity (ICEBERG intensity squared, +maximum 1) has the peak-height distribution of square-rooted measured intensities +(prepare_synth.py) and is used as it is. `neighbours` reads query spectra only (no labels). +""" +import argparse +import json +import multiprocessing +import sys +import time +from pathlib import Path + +import numpy as np +import scipy.sparse as sp + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +sys.path.insert(0, str(HERE.parent / 'pkg')) +ROOT = Path('/workspace/research') +KINDS = ('frag', 'loss', 'sum') +SHIFT = {0: 1.007276, 1: 22.989218} +STATE = {} + + +def fingerprint_chunk(chunk): + from rdkit import Chem, RDLogger + import inverse + RDLogger.DisableLog('rdApp.*') + out = np.zeros((len(chunk), inverse.FP_BITS // 8), np.uint8) + for n, smiles in enumerate(chunk): + mol = Chem.MolFromSmiles(smiles) + if mol is not None: + out[n] = inverse.fingerprint(mol) + return out + + +def build(args): + started = time.monotonic() + out = Path(args.lib) + out.mkdir(parents=True, exist_ok=True) + store = np.load(ROOT / 'synth/spectra.npz') + structures = json.load(open(ROOT / 'synth/structures.json')) + mass = np.array([s['mass'] for s in structures]) + structure, adduct, offset = store['structure'], store['adduct'], store['offset'] + order = np.argsort(structure, kind='stable') + rank = np.empty(len(order), np.int64) + rank[order] = np.arange(len(order)) + counts = np.diff(offset) + precursor = mass[structure] + np.where(adduct == 0, SHIFT[0], SHIFT[1]) + row = np.repeat(rank, counts) + limit = np.repeat(precursor, counts) + mz = store['mz'].astype(np.float64) + inten = store['inten'].astype(np.float64) + keep = (mz < limit - 0.5) & (inten > 0) & (mz >= args.min_mz) + bins = int(2000 / args.bin) + 3 + sorted_structure = structure[order] + starts = np.flatnonzero(np.diff(sorted_structure, prepend=-1) != 0) + assert np.array_equal(sorted_structure[starts], np.arange(len(structures))) + print(f'spectra {len(order)}, structures {len(structures)}, peaks {len(mz)} (kept {int(keep.sum())}), {time.monotonic() - started:.0f} s', flush=True) + for kind in ('frag', 'loss'): + value = mz if kind == 'frag' else limit - mz + index = np.rint(value / args.bin).astype(np.int64) + ok = keep & (index > 0) & (index < bins - 1) + matrix = sp.csr_matrix((inten[ok], (row[ok], index[ok])), shape=(len(order), bins)) + matrix.sum_duplicates() + norm = np.sqrt(np.asarray(matrix.multiply(matrix).sum(1)).ravel()) + matrix.data /= np.repeat(np.maximum(norm, 1e-30), np.diff(matrix.indptr)) + transposed = matrix.astype(np.float32).T.tocsr() + sp.save_npz(out / f'{kind}_T.npz', transposed, compressed=False) + print(f'{kind}: {matrix.nnz} entries, empty rows {int((norm == 0).sum())}, {time.monotonic() - started:.0f} s', flush=True) + np.save(out / 'starts.npy', starts) + np.save(out / 'adduct.npy', adduct[order]) + smiles = [s['smiles'] for s in structures] + chunks = [smiles[i:i + 2000] for i in range(0, len(smiles), 2000)] + with multiprocessing.Pool(args.workers) as pool: + fps = np.concatenate(pool.map(fingerprint_chunk, chunks, chunksize=1)) + np.save(out / 'fps.npy', fps) + (out / 'manifest.json').write_text(json.dumps({ + 'spectra': int(len(order)), 'structures': len(structures), 'bin': args.bin, 'min_mz': args.min_mz, + 'empty_fingerprints': int((fps.sum(1) == 0).sum()), 'elapsed_seconds': time.monotonic() - started}, indent=1) + '\n') + print(f'fingerprints {fps.shape}, empty {int((fps.sum(1) == 0).sum())}, {time.monotonic() - started:.0f} s', flush=True) + + +def search(bounds): + low, high = bounds + qf, ql, tf, tl, starts, top = (STATE[k] for k in ('qf', 'ql', 'tf', 'tl', 'starts', 'top')) + sf = np.asarray((qf[low:high] @ tf).todense(), dtype=np.float32) + sl = np.asarray((ql[low:high] @ tl).todense(), dtype=np.float32) + out = {} + for kind in KINDS: + sim = sf if kind == 'frag' else sl if kind == 'loss' else 0.5 * (sf + sl) + per_mol = np.maximum.reduceat(sim, starts, axis=1) + wide = min(4 * top, per_mol.shape[1] - 1) + part = np.argpartition(-per_mol, wide, axis=1)[:, :wide] + part.sort(axis=1) # ties -> lower structure row first + value = np.take_along_axis(per_mol, part, axis=1) + rank = np.argsort(-value, axis=1, kind='stable')[:, :top] + out[kind] = (np.take_along_axis(part, rank, axis=1).astype(np.int32), np.take_along_axis(value, rank, axis=1)) + return low, high, out + + +def neighbours(args): + import knn_branch + started = time.monotonic() + lib = Path(args.lib) + STATE['tf'] = sp.load_npz(lib / 'frag_T.npz') + STATE['tl'] = sp.load_npz(lib / 'loss_T.npz') + STATE['starts'] = np.load(lib / 'starts.npy') + STATE['top'] = args.top + queries = knn_branch.read_spectra(ROOT / args.queries / 'queries.jsonl') + STATE['qf'], STATE['ql'] = knn_branch.vectors(queries, json.loads((lib / 'manifest.json').read_text())['bin'], spread=True) + print(f'library spectra {STATE["tf"].shape[1]}, structures {len(STATE["starts"])}, queries {len(queries)}, {time.monotonic() - started:.0f} s', flush=True) + result = {kind: (np.zeros((len(queries), args.top), np.int32), np.zeros((len(queries), args.top), np.float32)) for kind in KINDS} + jobs = [(low, min(len(queries), low + args.chunk)) for low in range(0, len(queries), args.chunk)] + done = 0 + with multiprocessing.get_context('fork').Pool(args.workers) as pool: + for low, high, out in pool.imap_unordered(search, jobs): + for kind in KINDS: + result[kind][0][low:high], result[kind][1][low:high] = out[kind] + done += high - low + if done % (10 * args.chunk) < args.chunk: + print(f'{done} / {len(queries)} queries, {time.monotonic() - started:.0f} s', flush=True) + np.savez(args.out, **{f'{kind}_mol': result[kind][0] for kind in KINDS}, + **{f'{kind}_sim': result[kind][1] for kind in KINDS}) + for kind in KINDS: + sim = result[kind][1] + print(f'{kind}: best similarity median {np.median(sim[:, 0]):.3f}, mean {sim[:, 0].mean():.3f}, 10th neighbour median {np.median(sim[:, 9]):.3f}') + print(f'finished in {time.monotonic() - started:.0f} s') + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + sub = p.add_subparsers(dest='command', required=True) + a = sub.add_parser('build') + a.add_argument('lib') + a.add_argument('--bin', type=float, default=0.01) + a.add_argument('--min-mz', type=float, default=0.0) + a.add_argument('--workers', type=int, default=6) + b = sub.add_parser('neighbours') + b.add_argument('lib') + b.add_argument('out') + b.add_argument('--top', type=int, default=32) + b.add_argument('--chunk', type=int, default=200) + b.add_argument('--workers', type=int, default=6) + b.add_argument('--queries', default='validation-input') + args = p.parse_args() + {'build': build, 'neighbours': neighbours}[args.command](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/61/61b42c8d67a3971dabb1ea5113899d62197d4ed604e8dd037ce0e2d88dca73d3/train-S1.log b/shared/package-files/61/61b42c8d67a3971dabb1ea5113899d62197d4ed604e8dd037ce0e2d88dca73d3/train-S1.log new file mode 100644 index 0000000000000000000000000000000000000000..bded6d87f8f4879742d229cee1883323ee143d38 --- /dev/null +++ b/shared/package-files/61/61b42c8d67a3971dabb1ea5113899d62197d4ed604e8dd037ce0e2d88dca73d3/train-S1.log @@ -0,0 +1,7 @@ +{"event": "resumed", "source": "/workspace/research/forks/B-step0035000-resume.ckpt", "step": 35000, "epoch": 5, "batch_in_epoch": 5460, "elapsed": 9512.104094705079, "skipped": 0} +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "own-checkpoint:0739bdd163a52753b55f2558914ac1fb8383b00c0436512105f4f0e28d55a5a8", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 37500, "elapsed_seconds": 12713.62058708514, "validation_loss": 0.5682035563513637, "validation_loss_ema": 0.5665822857990861} +/opt/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 32 leaked semaphore objects to clean up at shutdown + warnings.warn('resource_tracker: There appear to be %d ' diff --git a/shared/package-files/62/620ae743233962e0acfa08d02e56d6da735ece157e797e49d4439dbf94fb5db3/inv-strata-I9b.log b/shared/package-files/62/620ae743233962e0acfa08d02e56d6da735ece157e797e49d4439dbf94fb5db3/inv-strata-I9b.log new file mode 100644 index 0000000000000000000000000000000000000000..80b4254b40d0834f52dc1c8db62bf7e824e5ee6e --- /dev/null +++ b/shared/package-files/62/620ae743233962e0acfa08d02e56d6da735ece157e797e49d4439dbf94fb5db3/inv-strata-I9b.log @@ -0,0 +1,19 @@ +stratum queries rel3 I8 I9a I9b I9b-idf +all 19429 0.5272 0.5575 0.5725 0.5887 0.5970 +[M+H]+ energy 9734 0.7292 0.7955 0.8057 0.8242 0.8260 +[M+H]+ no energy 4958 0.3816 0.3778 0.3998 0.4177 0.4381 +[M+Na]+ energy 241 0.3485 0.4398 0.4564 0.5187 0.5270 +[M+Na]+ no energy 4496 0.2600 0.2469 0.2645 0.2709 0.2802 +instrument ? 486 0.4033 0.4486 0.4712 0.4897 0.4918 +instrument Orbitrap 16439 0.5230 0.5463 0.5640 0.5797 0.5884 +instrument QTOF 2504 0.5791 0.6522 0.6482 0.6669 0.6737 +m/z 0-300 274 0.6131 0.6934 0.7299 0.7628 0.7847 +m/z 0-300 not domain 56 0.3393 0.4643 0.4464 0.5357 0.5714 +m/z 300-450 6977 0.6900 0.7634 0.7674 0.7917 0.7998 +m/z 300-450 not domain 1293 0.4602 0.5097 0.5251 0.5584 0.5816 +m/z 450-700 6227 0.5534 0.5865 0.6229 0.6523 0.6568 +m/z 450-700 not domain 3078 0.3441 0.3645 0.3996 0.4321 0.4454 +m/z 700-850 2347 0.3498 0.3081 0.3336 0.3046 0.3225 +m/z 700-850 not domain 2056 0.3166 0.2510 0.3006 0.2685 0.2889 +m/z 850-2000 3604 0.2758 0.2611 0.2519 0.2572 0.2655 +m/z 850-2000 not domain 3212 0.2556 0.2385 0.2270 0.2428 0.2522 diff --git a/shared/package-files/62/625c5fb3cde8196ed46b65ff0120f433dd04195e73f377223d50bae0f25a0bdb/netprop-neigh-g-mut_10_0.5-raw.log b/shared/package-files/62/625c5fb3cde8196ed46b65ff0120f433dd04195e73f377223d50bae0f25a0bdb/netprop-neigh-g-mut_10_0.5-raw.log new file mode 100644 index 0000000000000000000000000000000000000000..2aa5e716892d4a4e67de8f243e1b6a09230a1c4f --- /dev/null +++ b/shared/package-files/62/625c5fb3cde8196ed46b65ff0120f433dd04195e73f377223d50bae0f25a0bdb/netprop-neigh-g-mut_10_0.5-raw.log @@ -0,0 +1,7 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4459 (domain 0.4139 / other 0.4781) macro 0.3757 + lam 1.00/1.00: Hit@1 0.8013 (+0.0300 [+0.0086, +0.0549]) macro +0.0145 [+0.0086, +0.0207] pools +82 -33 | no top 20 +0.0236 cap30 +0.0235 [+0.0091, +0.0386] | Hit@5 -0.0085 macro@5 +0.0074 cap30@5 +0.0108 + +k=10 p=3.0 half=0.4 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4469 (domain 0.4151 / other 0.4787) macro 0.3771 + lam 1.00/1.00: Hit@1 0.8065 (+0.0352 [+0.0136, +0.0618]) macro +0.0148 [+0.0089, +0.0210] pools +85 -35 | no top 20 +0.0257 cap30 +0.0275 [+0.0127, +0.0424] | Hit@5 -0.0084 macro@5 +0.0077 cap30@5 +0.0110 diff --git a/shared/package-files/62/627a1e3bbcbc9f79da7b305d07fe9e177d519a628203f5a697f8c04c7a917340/report-agg1.json b/shared/package-files/62/627a1e3bbcbc9f79da7b305d07fe9e177d519a628203f5a697f8c04c7a917340/report-agg1.json new file mode 100644 index 0000000000000000000000000000000000000000..9f87332dacf1f4221dafa2c6a6cf7dbe6f46ed0b --- /dev/null +++ b/shared/package-files/62/627a1e3bbcbc9f79da7b305d07fe9e177d519a628203f5a697f8c04c7a917340/report-agg1.json @@ -0,0 +1,111 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.583509187297339, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.1974256139799304, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.583509187297339, + "hit_rate_at_20": 0.8482680529105976, + "hit_rate_at_5": 0.7566009573318235 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.6832289681459297, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.27422419252691577, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.5842916817080088, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.18421052631578946, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.8282778864970646, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.7549457562220804, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.67, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.8227564102564102, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.3593188068542416, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6337448559670782, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.5828821704483241, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.5778753993610224, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.3636926250644662, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.8024450380110951, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.583509187297339, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.5333519044398306, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.6298895475107613 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/62/62d33a00ea52068bc078e5cf43b7441d9a6b84c95524bf853408d22d2d0c3233/eval-score-N5-recur-plain-p48.log b/shared/package-files/62/62d33a00ea52068bc078e5cf43b7441d9a6b84c95524bf853408d22d2d0c3233/eval-score-N5-recur-plain-p48.log new file mode 100644 index 0000000000000000000000000000000000000000..9f7a3fe59d9c3dd1b5cd42e0a5e56339e9ed14fb --- /dev/null +++ b/shared/package-files/62/62d33a00ea52068bc078e5cf43b7441d9a6b84c95524bf853408d22d2d0c3233/eval-score-N5-recur-plain-p48.log @@ -0,0 +1,41 @@ +19429 queries, 5 members, 159.8 s +cos pool rule all=0.6178 dom=0.8534 non=0.3812 h5=0.7175 macro=0.7392 +cen pool rule all=0.6004 dom=0.8348 non=0.3651 h5=0.7198 macro=0.7159 +cos_pm pool rule all=0.6135 dom=0.8502 non=0.3759 h5=0.7216 macro=0.7369 +dot pool rule all=0.6045 dom=0.8151 non=0.3930 h5=0.7588 macro=0.7286 +geo pool rule all=0.5968 dom=0.8353 non=0.3573 h5=0.7072 macro=0.7242 +idf05 pool rule all=0.6133 dom=0.8528 non=0.3728 h5=0.7332 macro=0.7401 +idf1 pool rule all=0.6186 dom=0.8543 non=0.3818 h5=0.7366 macro=0.7401 +lin pool rule all=0.5781 dom=0.8037 non=0.3516 h5=0.6923 macro=0.6920 +log01 pool rule all=0.6194 dom=0.8456 non=0.3923 h5=0.7667 macro=0.7351 +log05 pool rule all=0.6211 dom=0.8622 non=0.3791 h5=0.7334 macro=0.7442 +log20 pool rule all=0.6206 dom=0.8609 non=0.3794 h5=0.7298 macro=0.7457 +nll02 pool rule all=0.4615 dom=0.7364 non=0.1855 h5=0.6132 macro=0.6019 +nll10 pool rule all=0.4335 dom=0.6897 non=0.1763 h5=0.5730 macro=0.5561 +poolcen pool rule all=0.6018 dom=0.8273 non=0.3755 h5=0.7261 macro=0.7150 +pow020 pool rule all=0.5828 dom=0.8195 non=0.3451 h5=0.7504 macro=0.7126 +pow030 pool rule all=0.5980 dom=0.8330 non=0.3620 h5=0.7510 macro=0.7209 +pow040 pool rule all=0.6135 dom=0.8434 non=0.3827 h5=0.7383 macro=0.7336 +pow05 pool rule all=0.6183 dom=0.8572 non=0.3784 h5=0.7354 macro=0.7413 +pow05idf025 pool rule all=0.6208 dom=0.8594 non=0.3813 h5=0.7375 macro=0.7434 +pow05idf05 pool rule all=0.6199 dom=0.8549 non=0.3839 h5=0.7377 macro=0.7428 +pow05m pool rule all=0.6201 dom=0.8592 non=0.3800 h5=0.7348 macro=0.7416 +pow05s pool rule all=0.6164 dom=0.8536 non=0.3783 h5=0.7284 macro=0.7386 +pow060 pool rule all=0.6214 dom=0.8602 non=0.3816 h5=0.7282 macro=0.7448 +pow060idf025 pool rule all=0.6212 dom=0.8620 non=0.3795 h5=0.7324 macro=0.7475 +pow060idf050 pool rule all=0.6241 dom=0.8608 non=0.3864 h5=0.7347 macro=0.7472 +pow060m pool rule all=0.6219 dom=0.8613 non=0.3814 h5=0.7305 macro=0.7439 +pow065 pool rule all=0.6210 dom=0.8594 non=0.3816 h5=0.7281 macro=0.7439 +pow070 pool rule all=0.6206 dom=0.8581 non=0.3822 h5=0.7269 macro=0.7425 +pow070idf025 pool rule all=0.6212 dom=0.8600 non=0.3815 h5=0.7301 macro=0.7463 +pow070idf050 pool rule all=0.6189 dom=0.8593 non=0.3775 h5=0.7331 macro=0.7451 +pow070m pool rule all=0.6227 dom=0.8598 non=0.3847 h5=0.7274 macro=0.7422 +pow075 pool rule all=0.6161 dom=0.8524 non=0.3789 h5=0.7267 macro=0.7416 +pow080 pool rule all=0.6134 dom=0.8514 non=0.3743 h5=0.7272 macro=0.7401 +pow080m pool rule all=0.6192 dom=0.8542 non=0.3833 h5=0.7258 macro=0.7422 +pow085 pool rule all=0.6155 dom=0.8518 non=0.3783 h5=0.7257 macro=0.7404 +pow085idf025 pool rule all=0.6177 dom=0.8533 non=0.3811 h5=0.7312 macro=0.7425 +pow085idf050 pool rule all=0.6191 dom=0.8569 non=0.3803 h5=0.7345 macro=0.7439 +pow090 pool rule all=0.6146 dom=0.8519 non=0.3765 h5=0.7228 macro=0.7404 +pow2 pool rule all=0.5836 dom=0.8188 non=0.3475 h5=0.7044 macro=0.7097 +tani pool rule all=0.5989 dom=0.8306 non=0.3663 h5=0.7231 macro=0.7209 diff --git a/shared/package-files/62/62d4a5a25ffb9a9e1ce12a0a2f89af0c87ee3eec1ec197ae795cfde128604d1b/netprop-search-0_1-2.log b/shared/package-files/62/62d4a5a25ffb9a9e1ce12a0a2f89af0c87ee3eec1ec197ae795cfde128604d1b/netprop-search-0_1-2.log new file mode 100644 index 0000000000000000000000000000000000000000..58ce853703c10cf28f4f7ac4a33dfbe95940c4af --- /dev/null +++ b/shared/package-files/62/62d4a5a25ffb9a9e1ce12a0a2f89af0c87ee3eec1ec197ae795cfde128604d1b/netprop-search-0_1-2.log @@ -0,0 +1 @@ +1859 queries, 339 pools, 0 s; best similarity median 0.239, 10th 0.075; share with best >= 0.5: 0.044, >= 0.7: 0.013 diff --git a/shared/package-files/63/63087e1e33cce7f5ef16e4c76db60ecb3586b85ad9d900fa82de57eb6d37c012/mass_weights.py b/shared/package-files/63/63087e1e33cce7f5ef16e4c76db60ecb3586b85ad9d900fa82de57eb6d37c012/mass_weights.py new file mode 100644 index 0000000000000000000000000000000000000000..cf5aa1f10292bc226c0b28aed08525655785fea2 --- /dev/null +++ b/shared/package-files/63/63087e1e33cce7f5ef16e4c76db60ecb3586b85ad9d900fa82de57eb6d37c012/mass_weights.py @@ -0,0 +1,42 @@ +"""Mass-dependent inverse weight inside the release rule (lab, E58; labels: evaluation only). + +Released: w = 0.75 for domain spectra, max(0.05, 0.5 / n) otherwise. Variants multiply the weight of +spectra with precursor m/z >= CUT by a factor (domain and non-domain separately). +""" +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import fused_eval as fe + + +def main(): + lab = fe.Fuser() + inv = lab.inverse(fe.RELEASED.split(',')) + ref = lab.ranks(inv) + lab.report('released', ref, ref) + mz, _ = lab.strata() + dom = lab.ev.domain + + def rule(cut, f_dom, f_non): + def w(i, n): + base = 0.75 if dom[i] else max(0.05, 0.5 / n) + if mz[i] >= cut: + base *= f_dom if dom[i] else f_non + return base + return w + + for cut in (500, 700): + for f_dom in (1.5, 2.0, 4.0, 8.0): + got = lab.ranks(inv, weight_fn=rule(cut, f_dom, 1.0)) + lab.report(f'domain weight x{f_dom} for m/z >= {cut}', got, ref) + for cut in (700, 850): + for f_non in (0.5, 2.0, 4.0): + got = lab.ranks(inv, weight_fn=rule(cut, 1.0, f_non)) + lab.report(f'other weight x{f_non} for m/z >= {cut}', got, ref) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/63/6316407cab6796429332ccceb98f227fb1c20d8990497ccaf4a4cfeecb50d4f9/eval-score-N5-recur-merged-10.log b/shared/package-files/63/6316407cab6796429332ccceb98f227fb1c20d8990497ccaf4a4cfeecb50d4f9/eval-score-N5-recur-merged-10.log new file mode 100644 index 0000000000000000000000000000000000000000..2280f12fa425680383a835f585985565239754c6 --- /dev/null +++ b/shared/package-files/63/6316407cab6796429332ccceb98f227fb1c20d8990497ccaf4a4cfeecb50d4f9/eval-score-N5-recur-merged-10.log @@ -0,0 +1,41 @@ +19429 queries, 5 members, 81.9 s +cos pool rule all=0.6316 dom=0.8434 non=0.4190 h5=0.7565 macro=0.7354 +cen pool rule all=0.6169 dom=0.8156 non=0.4174 h5=0.7528 macro=0.7109 +cos_pm pool rule all=0.6416 dom=0.8474 non=0.4349 h5=0.7575 macro=0.7372 +dot pool rule all=0.6523 dom=0.8253 non=0.4787 h5=0.7807 macro=0.7280 +geo pool rule all=0.6304 dom=0.8415 non=0.4185 h5=0.7432 macro=0.7262 +idf05 pool rule all=0.6454 dom=0.8454 non=0.4447 h5=0.7615 macro=0.7374 +idf1 pool rule all=0.6435 dom=0.8445 non=0.4418 h5=0.7627 macro=0.7366 +lin pool rule all=0.6085 dom=0.8034 non=0.4128 h5=0.7282 macro=0.7017 +log01 pool rule all=0.6554 dom=0.8541 non=0.4559 h5=0.7919 macro=0.7345 +log05 pool rule all=0.6438 dom=0.8554 non=0.4315 h5=0.7759 macro=0.7431 +log20 pool rule all=0.6528 dom=0.8546 non=0.4502 h5=0.7597 macro=0.7451 +nll02 pool rule all=0.5017 dom=0.7415 non=0.2610 h5=0.6493 macro=0.6149 +nll10 pool rule all=0.4759 dom=0.6978 non=0.2531 h5=0.6128 macro=0.5635 +poolcen pool rule all=0.6178 dom=0.8165 non=0.4183 h5=0.7688 macro=0.7138 +pow020 pool rule all=0.6171 dom=0.8325 non=0.4008 h5=0.7796 macro=0.7162 +pow030 pool rule all=0.6210 dom=0.8433 non=0.3977 h5=0.7847 macro=0.7224 +pow040 pool rule all=0.6391 dom=0.8502 non=0.4272 h5=0.7716 macro=0.7345 +pow05 pool rule all=0.6449 dom=0.8521 non=0.4368 h5=0.7756 macro=0.7395 +pow05idf025 pool rule all=0.6494 dom=0.8552 non=0.4427 h5=0.7773 macro=0.7434 +pow05idf05 pool rule all=0.6492 dom=0.8562 non=0.4414 h5=0.7781 macro=0.7439 +pow05m pool rule all=0.6411 dom=0.8516 non=0.4298 h5=0.7699 macro=0.7383 +pow05s pool rule all=0.6428 dom=0.8531 non=0.4317 h5=0.7733 macro=0.7392 +pow060 pool rule all=0.6501 dom=0.8563 non=0.4431 h5=0.7710 macro=0.7463 +pow060idf025 pool rule all=0.6512 dom=0.8568 non=0.4448 h5=0.7694 macro=0.7439 +pow060idf050 pool rule all=0.6506 dom=0.8561 non=0.4442 h5=0.7704 macro=0.7437 +pow060m pool rule all=0.6397 dom=0.8541 non=0.4244 h5=0.7726 macro=0.7410 +pow065 pool rule all=0.6522 dom=0.8557 non=0.4480 h5=0.7680 macro=0.7448 +pow070 pool rule all=0.6501 dom=0.8539 non=0.4454 h5=0.7614 macro=0.7439 +pow070idf025 pool rule all=0.6530 dom=0.8536 non=0.4517 h5=0.7676 macro=0.7451 +pow070idf050 pool rule all=0.6572 dom=0.8557 non=0.4579 h5=0.7667 macro=0.7448 +pow070m pool rule all=0.6411 dom=0.8528 non=0.4285 h5=0.7643 macro=0.7404 +pow075 pool rule all=0.6495 dom=0.8516 non=0.4467 h5=0.7577 macro=0.7439 +pow080 pool rule all=0.6465 dom=0.8485 non=0.4436 h5=0.7576 macro=0.7410 +pow080m pool rule all=0.6380 dom=0.8485 non=0.4267 h5=0.7586 macro=0.7383 +pow085 pool rule all=0.6424 dom=0.8479 non=0.4361 h5=0.7582 macro=0.7398 +pow085idf025 pool rule all=0.6466 dom=0.8491 non=0.4433 h5=0.7620 macro=0.7407 +pow085idf050 pool rule all=0.6456 dom=0.8501 non=0.4402 h5=0.7647 macro=0.7407 +pow090 pool rule all=0.6425 dom=0.8484 non=0.4358 h5=0.7582 macro=0.7395 +pow2 pool rule all=0.6107 dom=0.8075 non=0.4131 h5=0.7371 macro=0.7076 +tani pool rule all=0.6097 dom=0.8263 non=0.3922 h5=0.7571 macro=0.7227 diff --git a/shared/package-files/63/631f78e7918c0825813cbba8f93392babb70ca39593cb4778c2e25c107d8d6a7/consensus_equivalence.py b/shared/package-files/63/631f78e7918c0825813cbba8f93392babb70ca39593cb4778c2e25c107d8d6a7/consensus_equivalence.py new file mode 100644 index 0000000000000000000000000000000000000000..867b8f2c18cd4b55bcbc5ea218fc79ddea86cd8a --- /dev/null +++ b/shared/package-files/63/631f78e7918c0825813cbba8f93392babb70ca39593cb4778c2e25c107d8d6a7/consensus_equivalence.py @@ -0,0 +1,81 @@ +"""Package against lab for the cross-pool consensus term on the full validation fold. + +consensus_equivalence.py --package evals/fullfold/NAME --base evals/fullfold/BASE --lab evals/netprop/term-*.pkl --variant 10:3:half=0.5 + +Compares (i) the branch outputs of the package run with those of the base run (same saved +simulations), (ii) the term of the packaged consensus.py with the lab term of analysis/netprop.py +(an independent numpy implementation without the tie rule), (iii) the rank of the label in the +package's rankings with the lab's fused rank. +""" +import argparse +import json +import pickle +import sys +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'analysis')) +sys.path.insert(0, str(HERE.parent / 'pkg')) +import netprop +import scorelab + +ROOT = Path('/workspace/research') + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--package', required=True) + p.add_argument('--base', required=True) + p.add_argument('--lab', required=True) + p.add_argument('--variant', required=True) + p.add_argument('--weight', type=float, default=1.0) + p.add_argument('--own-branches', action='store_true', help='(iii) from the branch outputs of the package run itself (when they differ from the base run by design)') + p.add_argument('--config', default='builds/5Ms-I9b+I13-L-ion/model_config.json', help='fusion constants of the lab rule (the package under test)') + args = p.parse_args() + queries, pools = netprop.load() + ev = scorelab.Evaluator(queries, pools) + load = lambda root, name: pickle.load(open(ROOT / root / 'pred' / f'{name}.pkl', 'rb')) + for name in ('distances', 'inverse', 'library', 'ion'): + a, b = load(args.package, name), load(args.base, name) + worst, same_none = 0.0, 0 + for q in queries: + x, y = a[q['query_id']], b[q['query_id']] + if x is None or y is None: + same_none += (x is None) == (y is None) + continue + both = np.isfinite(x) & np.isfinite(y) + assert np.array_equal(np.isfinite(x), np.isfinite(y)) + if both.any(): + worst = max(worst, float(np.max(np.abs(x[both] - y[both])))) + print(f'{name}: largest absolute difference package run - base run {worst:.3g}') + lab = pickle.load(open(ROOT / args.lab, 'rb')) + term_lab = lab['term'][args.variant] + term_pkg = load(args.package, 'consensus') + worst, covered, differ = 0.0, 0, 0 + for q, t in zip(queries, term_lab): + u = term_pkg[q['query_id']] + if (t is None) != (u is None): + differ += 1 + continue + if t is None: + continue + covered += 1 + worst = max(worst, float(np.max(np.abs(t - u)))) + print(f'consensus term: {covered} queries covered by both, coverage differs for {differ}, largest absolute difference {worst:.3g}') + pred = {name: load(args.package if args.own_branches else args.base, name) for name in ('distances', 'inverse', 'library', 'ion')} + config = json.load(open(ROOT / args.config)) + base = netprop.released(queries, pools, pred, config) + fused = [b if (b is None or t is None) else b + args.weight * t for b, t in zip(base, term_lab)] + rank_lab = ev.ranks(fused, 1.0) + order = {json.loads(line)['query_id']: json.loads(line)['ranking'] for line in open(ROOT / args.package / 'rankings.jsonl')} + rank_pkg = np.array([order[q['query_id']].index(pools[q['candidate_pool_id']][ev.target[i]]['candidate_id']) for i, q in enumerate(queries)]) + print(f'label rank: package == lab for {int(np.sum(rank_pkg == rank_lab))} / {len(queries)} queries; Hit@1 package {np.mean(rank_pkg == 0):.4f} lab {np.mean(rank_lab == 0):.4f}; ' + f'Hit@5 {np.mean(rank_pkg < 5):.4f} / {np.mean(rank_lab < 5):.4f}; Hit@20 {np.mean(rank_pkg < 20):.4f} / {np.mean(rank_lab < 20):.4f}') + per_spectrum = ev.ranks(fused, 0.0) + print(f'per spectrum (no pool mean): base {np.mean(ev.ranks(base, 0.0) == 0):.4f} with the term {np.mean(per_spectrum == 0):.4f}') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/63/6342f2c833dfd0acf4a18924fd5c7d801e64fddac68314caaf624dea8af30a81/report-agg1.json b/shared/package-files/63/6342f2c833dfd0acf4a18924fd5c7d801e64fddac68314caaf624dea8af30a81/report-agg1.json new file mode 100644 index 0000000000000000000000000000000000000000..e74f19c58b69fd5290ccafc28cfcbeb6ecb98564 --- /dev/null +++ b/shared/package-files/63/6342f2c833dfd0acf4a18924fd5c7d801e64fddac68314caaf624dea8af30a81/report-agg1.json @@ -0,0 +1,107 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.5915230554261761, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.215082675836088, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.5915230554261761, + "hit_rate_at_20": 0.8104331625523987, + "hit_rate_at_5": 0.735444806707033 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.6616405307599518, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.3537832310838446, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.5915230554261761, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.8203125, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.7175141242937854, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.5960264900662252, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.7816091954022989, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.37643378519290926, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.604812834224599, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.48760330578512395, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.38244197780020184, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.7707612456747405, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.5915230554261761, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.4925197864445088, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.6940295750289562 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/63/634be1cf3b98a821b152a00848fa463bf9e1d11d7d045b8b2ce7cd3fde6811b7/knn-evaluate-plateau.log b/shared/package-files/63/634be1cf3b98a821b152a00848fa463bf9e1d11d7d045b8b2ce7cd3fde6811b7/knn-evaluate-plateau.log new file mode 100644 index 0000000000000000000000000000000000000000..76f98f9ba677e6ff38dcc5a391a7de653a1e034f --- /dev/null +++ b/shared/package-files/63/634be1cf3b98a821b152a00848fa463bf9e1d11d7d045b8b2ce7cd3fde6811b7/knn-evaluate-plateau.log @@ -0,0 +1,33 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.162, to the average candidate 0.102 + domain: label 0.153, candidate 0.105, best similarity median 0.442 + other: label 0.170, candidate 0.098, best similarity median 0.444 +--- neighbour branch alone (per spectrum / pool mean) +frag k=20 p=3 debias ind all=0.1420 dom=0.1454 non=0.1385 | pool all=0.2009 dom=0.1720 non=0.2300 +frag k=20 p=6 debias ind all=0.1357 dom=0.1442 non=0.1271 | pool all=0.1966 dom=0.1716 non=0.2218 +frag k=20 p=10 debias ind all=0.1249 dom=0.1346 non=0.1151 | pool all=0.1909 dom=0.1690 non=0.2129 +loss k=20 p=3 debias ind all=0.0776 dom=0.0665 non=0.0887 | pool all=0.1245 dom=0.0869 non=0.1622 +loss k=20 p=6 debias ind all=0.0694 dom=0.0590 non=0.0799 | pool all=0.1208 dom=0.0785 non=0.1633 +loss k=20 p=10 debias ind all=0.0600 dom=0.0514 non=0.0687 | pool all=0.1146 dom=0.0604 non=0.1691 +sum k=20 p=3 debias ind all=0.1759 dom=0.1837 non=0.1681 | pool all=0.2629 dom=0.2395 non=0.2864 +sum k=20 p=6 debias ind all=0.1689 dom=0.1795 non=0.1583 | pool all=0.2546 dom=0.2271 non=0.2822 +sum k=20 p=10 debias ind all=0.1560 dom=0.1642 non=0.1477 | pool all=0.2495 dom=0.2204 non=0.2787 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7327 dom=0.9072 non=0.5575 h5=0.8565 h20=0.9156 macro=0.8317 | +0.0000 [+0.0000,+0.0000] | ind 0.5908 +0.0000 [+0.0000,+0.0000] +sum k=20 p=6 debias u=0/0.35 all=0.7442 dom=0.9094 non=0.5783 h5=0.8708 h20=0.9251 macro=0.8355 | +0.0115 [+0.0015,+0.0229] | ind 0.5985 +0.0077 [+0.0036,+0.0121] + pools +17 -4 | macro +0.0038 [+0.0015,+0.0065] | without top 20 +0.0089 [-0.0008,+0.0191] | weight min(n,30) +0.0096 [+0.0005,+0.0185] +sum k=20 p=6 debias u=0/0.5 all=0.7483 dom=0.9094 non=0.5866 h5=0.8761 h20=0.9293 macro=0.8361 | +0.0156 [+0.0043,+0.0279] | ind 0.6000 +0.0092 [+0.0040,+0.0152] + pools +21 -6 | macro +0.0044 [+0.0015,+0.0074] | without top 20 +0.0136 [+0.0026,+0.0250] | weight min(n,30) +0.0136 [+0.0035,+0.0236] +sum k=20 p=6 debias u=0/0.65 all=0.7345 dom=0.9094 non=0.5589 h5=0.8791 h20=0.9314 macro=0.8349 | +0.0018 [-0.0228,+0.0230] | ind 0.6005 +0.0097 [+0.0037,+0.0166] + pools +23 -12 | macro +0.0032 [+0.0000,+0.0065] | without top 20 +0.0130 [+0.0017,+0.0243] | weight min(n,30) +0.0094 [-0.0018,+0.0205] +sum k=20 p=6 debias u=0/0.8 all=0.7302 dom=0.9090 non=0.5507 h5=0.8805 h20=0.9300 macro=0.8340 | -0.0025 [-0.0261,+0.0184] | ind 0.6010 +0.0101 [+0.0038,+0.0169] + pools +24 -16 | macro +0.0024 [-0.0012,+0.0059] | without top 20 +0.0081 [-0.0032,+0.0194] | weight min(n,30) +0.0051 [-0.0067,+0.0167] +Traceback (most recent call last): + File "/run-state/workspace/research/allcond/analysis/knn_branch.py", line 263, in + main() + File "/run-state/workspace/research/allcond/analysis/knn_branch.py", line 259, in main + neighbours(args) if args.command == 'neighbours' else evaluate(args) + ^^^^^^^^^^^^^^ + File "/run-state/workspace/research/allcond/analysis/knn_branch.py", line 229, in evaluate + mats = alone[config] + ~~~~~^^^^^^^^ +KeyError: ('sum', 32, 6.0, 'debias') diff --git a/shared/package-files/63/6394f7b80bc772b13ae40a906775c850771f840308e45591a770f646759bf43f/sub25.manifest.json b/shared/package-files/63/6394f7b80bc772b13ae40a906775c850771f840308e45591a770f646759bf43f/sub25.manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..042932fba3d576566e892e0843513bc5700c7d34 --- /dev/null +++ b/shared/package-files/63/6394f7b80bc772b13ae40a906775c850771f840308e45591a770f646759bf43f/sub25.manifest.json @@ -0,0 +1,22 @@ +{ + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 +} diff --git a/shared/package-files/63/63eb2ac41f919429861ebc5db2d071d86329dca9901435042a103338f64769c6/B-all-b32.log b/shared/package-files/63/63eb2ac41f919429861ebc5db2d071d86329dca9901435042a103338f64769c6/B-all-b32.log new file mode 100644 index 0000000000000000000000000000000000000000..e7df56bee9c126544139639899b5804e643b79a6 --- /dev/null +++ b/shared/package-files/63/63eb2ac41f919429861ebc5db2d071d86329dca9901435042a103338f64769c6/B-all-b32.log @@ -0,0 +1,8 @@ +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "random", "gpu": "NVIDIA H100 80GB HBM3"} +{"event": "resumed", "step": 2000, "epoch": 0, "batch_in_epoch": 2000, "elapsed": 720.0702658260707, "skipped": 0} +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "random", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 5000, "elapsed_seconds": 1444.6998637880897, "validation_loss": 0.6812945827841759, "validation_loss_ema": 0.6684011314064264} +{"step": 10000, "elapsed_seconds": 2708.506315391045, "validation_loss": 0.6276558749377728, "validation_loss_ema": 0.6128806732594967} +{"step": 15000, "elapsed_seconds": 3946.741432613111, "validation_loss": 0.606155501678586, "validation_loss_ema": 0.5934323165565729} diff --git a/shared/package-files/63/63f1156a3137c464591ade9c107d7da7e18cc221fad3e738c6a701d986514fe2/fullfold-5Ms-I9b+I13-L-ion-net-saved-simulations.log b/shared/package-files/63/63f1156a3137c464591ade9c107d7da7e18cc221fad3e738c6a701d986514fe2/fullfold-5Ms-I9b+I13-L-ion-net-saved-simulations.log new file mode 100644 index 0000000000000000000000000000000000000000..e834ed5710b02ed5d65eab22cad75c11a3686cc5 --- /dev/null +++ b/shared/package-files/63/63f1156a3137c464591ade9c107d7da7e18cc221fad3e738c6a701d986514fe2/fullfold-5Ms-I9b+I13-L-ion-net-saved-simulations.log @@ -0,0 +1,11 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 5, "inverse_members": 2, "library": true, "ion": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 39.415975816024} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 42.616809015045874} +{"event": "candidate_store", "pools": 3386, "pairs": 1066979, "seconds": 60.406304454023484} +{"event": "intact_ion", "scored": 19429, "seconds": 0.6552720479667187} +{"event": "library", "scored": 19429, "search_seconds": 83.53365373500856, "seconds": 88.22850253799697} +{"event": "inverse_annotated", "pools": 3386, "pairs": 1066979, "formulae": 161754, "unsupported_candidates": 7534, "seconds": 0.0013236950035206974} +{"event": "inverse", "scored": 19429, "seconds": 22.623481027025264} +{"event": "consensus", "scored": 19428, "pools": 3386, "answers": 33860, "search_seconds": 8.499776734039187, "seconds": 17.05997473502066} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 39.84226592001505, "total_seconds": 273.14402615098516} +{"event": "measured", "exit_code": 0, "wall_seconds": 275.1, "user_seconds": 1441.9, "system_seconds": 36.5, "max_rss_gib": 11.27} diff --git a/shared/package-files/63/63f6c29a176d703278e42369b0a3b75019f2d9fd5adf92fc729a859f7b1cceab/train-queue.log b/shared/package-files/63/63f6c29a176d703278e42369b0a3b75019f2d9fd5adf92fc729a859f7b1cceab/train-queue.log new file mode 100644 index 0000000000000000000000000000000000000000..75394bf5536b390e051439c05ea676a769f3f7af --- /dev/null +++ b/shared/package-files/63/63f6c29a176d703278e42369b0a3b75019f2d9fd5adf92fc729a859f7b1cceab/train-queue.log @@ -0,0 +1,18 @@ +20:15:38 start I20-ff512x6-real08-corpus2+train3-noise05-near067 +20:34:21 end I20-ff512x6-real08-corpus2+train3-noise05-near067 (0) +20:34:21 start I21-ff512x6-real08-corpus2+train3-noise05-real05 +20:53:09 end I21-ff512x6-real08-corpus2+train3-noise05-real05 (0) +20:53:09 start I22-ff512x6-real08-corpus2+train3-noise05-drop06 +21:12:40 end I22-ff512x6-real08-corpus2+train3-noise05-drop06 (0) +21:12:40 start I25-ff512x6-real08-corpus2+train3-noise05-rank2 +21:33:31 end I25-ff512x6-real08-corpus2+train3-noise05-rank2 (0) +23:02:33 start I23-ff512x6-real08-corpus2+train3-noise05-real025-s2 +23:20:37 end I23-ff512x6-real08-corpus2+train3-noise05-real025-s2 (0) +23:20:37 start I24-ff512x6-real15-corpus2+train3-noise05-real025 +23:39:27 end I24-ff512x6-real15-corpus2+train3-noise05-real025 (0) +23:39:27 start I26-ff512x6-real08-corpus2+train3-noise025 +00:08:00 end I26-ff512x6-real08-corpus2+train3-noise025 (0) +00:08:00 start I28-ff512x6-real08-corpus2+train3-noise05-s3 +00:32:16 end I28-ff512x6-real08-corpus2+train3-noise05-s3 (0) +00:32:16 start I29-ff512x6-real08-corpus2+train3+lm1-noise05 +00:50:18 end I29-ff512x6-real08-corpus2+train3+lm1-noise05 (0) diff --git a/shared/package-files/64/640245615be68408b9882c4e15682a1cbe856f377fe8892b1b3f3d2f434cf267/I11-ff512x6-real08-corpus2+train6.log b/shared/package-files/64/640245615be68408b9882c4e15682a1cbe856f377fe8892b1b3f3d2f434cf267/I11-ff512x6-real08-corpus2+train6.log new file mode 100644 index 0000000000000000000000000000000000000000..57c1fdadcf7cb0a664fb039472e2cb5268c390c0 --- /dev/null +++ b/shared/package-files/64/640245615be68408b9882c4e15682a1cbe856f377fe8892b1b3f3d2f434cf267/I11-ff512x6-real08-corpus2+train6.log @@ -0,0 +1,12 @@ +{"extra_rows": 3195331, "extra_structures": 434952} +{"args": {"store": "/workspace/research/inv", "out": "runs/I11-ff512x6-real08-corpus2+train6", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/selfsim/corpus2+train6.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 1, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"gen-x1.manifest.json": null, "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc"}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 13.803774012019858, "extra_store": {"path": "inv/selfsim/corpus2+train6.npz", "rows": 3195331, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/selfsim/train3.npz", "inv/selfsim/train3b.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 17.868643710809152, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 43.40271363919601}, {"name": "train3b", "source": "synth", "conditions": "from-train 3 window 2000 seed 1 hash-range 0,1 (302 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1164077, "failed": 0, "rows": 1164077, "seconds": 1326.220425104024, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1164030, "without_peak": 47, "mean_annotated_peaks": 17.88830957965001, "mean_candidates": 25.411179844632272, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 39.99492229503812}], "spectra": 3195331, "structures": 434952}}} +{"step": 5000, "elapsed": 126.85306380799739, "val_loss": 0.03763612561356212, "val_cos": 0.6303713199341191, "val_loss_ema": 0.03619124025598815, "val_cos_ema": 0.6436528639734739} +{"step": 10000, "elapsed": 250.3918154410203, "val_loss": 0.03354166529490187, "val_cos": 0.6761546736977424, "val_loss_ema": 0.03230548426497399, "val_cos_ema": 0.6887476944298793, "ind_cos": 0.41566730145658554, "agg_cos": 0.44587987029697873, "ind_nll": 0.28663338308713776, "agg_nll": 0.26285449585670906, "retrieval_seconds": 20.09272706398042} +{"step": 15000, "elapsed": 394.36553429299966, "val_loss": 0.033341449547294996, "val_cos": 0.6888329407112114, "val_loss_ema": 0.03089923005543622, "val_cos_ema": 0.7074830779094716} +{"step": 20000, "elapsed": 517.709559570998, "val_loss": 0.03187956700292371, "val_cos": 0.7038984365952635, "val_loss_ema": 0.03039774098799535, "val_cos_ema": 0.7174928937976093, "ind_cos": 0.473724844304905, "agg_cos": 0.5090843584332698, "ind_nll": 0.3680580575428483, "agg_nll": 0.3605949868752895, "retrieval_seconds": 20.16685012297239} +{"step": 25000, "elapsed": 662.491917242005, "val_loss": 0.030288555709349588, "val_cos": 0.7190155024584706, "val_loss_ema": 0.030321006847548286, "val_cos_ema": 0.7213685084152556} +{"step": 30000, "elapsed": 787.5263204910443, "val_loss": 0.03116809857340147, "val_cos": 0.7152885662017796, "val_loss_ema": 0.030342137784730622, "val_cos_ema": 0.7237991834853826, "ind_cos": 0.49153327500128674, "agg_cos": 0.5209738020484842, "ind_nll": 0.3935354367183077, "agg_nll": 0.37114622471563125, "retrieval_seconds": 21.069159885984845} +{"step": 35000, "elapsed": 932.3057468950283, "val_loss": 0.031233033049621377, "val_cos": 0.7202165149993245, "val_loss_ema": 0.030438602170080806, "val_cos_ema": 0.7263011945135172} +{"step": 40000, "elapsed": 1055.7038469950203, "val_loss": 0.03124198067347176, "val_cos": 0.7215104326670988, "val_loss_ema": 0.030845180297267252, "val_cos_ema": 0.7250571441611122, "ind_cos": 0.4963199341191003, "agg_cos": 0.522466416181996, "ind_nll": 0.4055278192392815, "agg_nll": 0.39317515054814967, "retrieval_seconds": 20.92250798200257} +{"step": 45000, "elapsed": 1200.8857829110348, "val_loss": 0.03051117036032035, "val_cos": 0.7279385162201155, "val_loss_ema": 0.030544793650594593, "val_cos_ema": 0.7276303403578414} +{"step": 50000, "elapsed": 1325.133588204044, "val_loss": 0.03050023223768573, "val_cos": 0.7283572332877079, "val_loss_ema": 0.030531245771613553, "val_cos_ema": 0.7284239199054893, "ind_cos": 0.49997426527356015, "agg_cos": 0.5367234546296773, "ind_nll": 0.4096968449225385, "agg_nll": 0.40604251376807865, "retrieval_seconds": 20.18663871299941} diff --git a/shared/package-files/64/643e27328afa3ba369b8ba57fc983fd011cd5387c8e09bc8ab6c9f2c51421011/big_pools.py b/shared/package-files/64/643e27328afa3ba369b8ba57fc983fd011cd5387c8e09bc8ab6c9f2c51421011/big_pools.py new file mode 100644 index 0000000000000000000000000000000000000000..7ee0bde13954ab8f3b124e9fa979bd3545b6b1b0 --- /dev/null +++ b/shared/package-files/64/643e27328afa3ba369b8ba57fc983fd011cd5387c8e09bc8ab6c9f2c51421011/big_pools.py @@ -0,0 +1,107 @@ +"""Largest validation pools: rank of the labelled candidate under forward member sets / distances. + +big_pools.py INVERSE.pkl:KEY[+...] NAME:MEMBER=ANCHOR.pkl[,...]:VARIANT:LAMBDA [...] [--top 25] + +Each configuration is evaluated in the released fused rule; prints, for the largest pools, the +pool size, share of validation queries, the composition and the fused rank of the labelled +candidate under every configuration (0 = hit). Validation labels: error analysis only. +""" +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +from fuselab import Lab +from fusion_rule import MEMBERS + + +def main(): + args = [a for a in sys.argv[1:] if not a.startswith('--')] + top = int(sys.argv[sys.argv.index('--top') + 1]) if '--top' in sys.argv else 25 + if '--top' in sys.argv: + args.remove(str(top)) + inverse, configs = args[0], args[1:] + ref = Lab('/workspace/research/validation-input', 'noprec_pp0.75', MEMBERS).setup() + pools = len(ref.members) + parts = [] + for item in inverse.split('+'): + path, key = item.rsplit(':', 1) + loaded = pickle.load(open(path, 'rb'))[key] + parts.append([ref.matrix(loaded, s) for s in range(pools)]) + inv = [np.mean([part[s] for part in parts], axis=0) for s in range(pools)] + dom = [ref.domain[m] for m in ref.members] + orbitrap = ref.instrument == 'Orbitrap' + + def weight(s): + return np.where(dom[s], 0.75, max(0.05, 0.5 / len(dom[s]))) + + def view(members, variant): + if '/' in variant: + a, b = variant.split('/') + la = Lab('/workspace/research/validation-input', a, members) + lb = Lab('/workspace/research/validation-input', b, members) + return [np.where(orbitrap[ref.members[s]][:, None], ref.matrix(la.sim, s), ref.matrix(lb.sim, s)) for s in range(pools)] + lab = Lab('/workspace/research/validation-input', variant, members) + return [ref.matrix(lab.sim, s) for s in range(pools)] + + first = np.array([m[0] for m in ref.members]) + size = np.array([len(m) for m in ref.members]) + ranks, names = [], [] + released = [ref.matrix(ref.sim, s) for s in range(pools)] + names.append('released') + ranks.append(ref.pool_rule(lambda s: released[s].mean(0) + (weight(s)[:, None] * inv[s]).mean(0))[first]) + names.append('rel-fwd') + ranks.append(ref.pool_rule(lambda s: released[s].mean(0))[first]) + names.append('inv') + ranks.append(ref.pool_rule(lambda s: inv[s].mean(0))[first]) + for config in configs: + name, members, variant, lam = config.split(':') + members, lam = members.split(','), float(lam) + base = view(members, 'noprec_pp0.75') + sim = base if lam == 0 else [(1 - lam) * base[s] + lam * a for s, a in enumerate(view(members, variant))] + names.append(name) + ranks.append(ref.pool_rule(lambda s: sim[s].mean(0) + (weight(s)[:, None] * inv[s]).mean(0))[first]) + names.append(name + '-fwd') + ranks.append(ref.pool_rule(lambda s: sim[s].mean(0))[first]) + ranks = np.array(ranks) + order = np.argsort(-size) + total = size.sum() + print('cumulative share of queries in the largest pools:', + ' '.join(f'top{k}={size[order[:k]].sum() / total:.3f}' for k in (1, 2, 5, 10, 20, 50, 100))) + print(f'{"size":>5} {"share":>6} {"dom":>5} {"orbi":>5} {"Na":>5} | ' + ' '.join(f'{n[:11]:>11}' for n in names)) + for s in order[:top]: + m = ref.members[s] + print(f'{size[s]:5d} {size[s] / total:6.3f} {dom[s].mean():5.2f} {orbitrap[m].mean():5.2f} ' + f'{np.mean(ref.adduct[m] == "[M+Na]+"):5.2f} | ' + ' '.join(f'{int(r):11d}' for r in ranks[:, s])) + for k in (5, 10, 20, 50): + big = np.zeros(pools, bool) + big[order[:k]] = True + print(f'query-weighted Hit@1 without the {k} largest pools:', + ' '.join(f'{n}={np.sum(size[~big] * (r[~big] == 0)) / size[~big].sum():.4f}' for n, r in zip(names, ranks))) + print('query-weighted Hit@1 (all pools):', ' '.join(f'{n}={np.sum(size * (r == 0)) / total:.4f}' for n, r in zip(names, ranks))) + print('pool-macro Hit@1:', ' '.join(f'{n}={np.mean(r == 0):.4f}' for n, r in zip(names, ranks))) + # paired pool bootstrap against the released configuration (molecule groups = pools) + rng = np.random.default_rng(0) + draws = rng.integers(0, pools, size=(2000, pools)) + small = np.ones(pools, bool) + small[order[:20]] = False + capped = np.minimum(size, 30) + hit0 = ranks[0] == 0 + for n, r in zip(names[1:], ranks[1:]): + hit = r == 0 + delta = hit.astype(float) - hit0 + macro = delta[draws].mean(1) + trimmed = (delta * size * small)[draws].sum(1) / (size * small)[draws].sum(1) + cap = (delta * capped)[draws].sum(1) / capped[draws].sum(1) + weighted = (delta * size)[draws].sum(1) / size[draws].sum(1) + print(f'{n:>10} vs released: pools +{int((hit & ~hit0).sum())} -{int((hit0 & ~hit).sum())}' + f' | macro {delta.mean():+.4f} [{np.percentile(macro, 2.5):+.4f},{np.percentile(macro, 97.5):+.4f}]' + f' | without top 20 {np.sum(delta * size * small) / np.sum(size * small):+.4f} [{np.percentile(trimmed, 2.5):+.4f},{np.percentile(trimmed, 97.5):+.4f}]' + f' | pool weight min(n,30) {np.sum(delta * capped) / capped.sum():+.4f} [{np.percentile(cap, 2.5):+.4f},{np.percentile(cap, 97.5):+.4f}]' + f' | query-weighted {np.sum(delta * size) / total:+.4f} [{np.percentile(weighted, 2.5):+.4f},{np.percentile(weighted, 97.5):+.4f}]') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/64/6457a62d464e81c6d82d4e9dbbbbf5f0b67c8655b378aed7c85361a138ced368/eval-I11-I12.sh b/shared/package-files/64/6457a62d464e81c6d82d4e9dbbbbf5f0b67c8655b378aed7c85361a138ced368/eval-I11-I12.sh new file mode 100644 index 0000000000000000000000000000000000000000..8861ce6bf7e43890f5535e63a2357040209adc5f --- /dev/null +++ b/shared/package-files/64/6457a62d464e81c6d82d4e9dbbbbf5f0b67c8655b378aed7c85361a138ced368/eval-I11-I12.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +cd /workspace/research +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps GLACIER_SOURCE=/workspace/research/ms-pred/src OMP_NUM_THREADS=4 +PY=/opt/glacier/bin/python +taskset -c 8-11 $PY allcond/inv/eval_score.py evals/score/I11.pkl runs/I11-ff512x6-real08-corpus2+train6/step-0050000-ema.pt > logs/eval-score-I11.log 2>&1 +taskset -c 8-11 $PY allcond/inv/eval_score.py evals/score/I12.pkl runs/I12-ff512x6-real08-corpus2+train3-x80/step-0050000-ema.pt > logs/eval-score-I12.log 2>&1 +taskset -c 8-11 $PY allcond/inv/eval_score.py evals/score/I9b+I11.pkl runs/I9b-ff512x6-real08-corpus2+train3/step-0050000-ema.pt runs/I11-ff512x6-real08-corpus2+train6/step-0050000-ema.pt > logs/eval-score-I9b+I11.log 2>&1 +taskset -c 8-11 $PY allcond/analysis/fused_eval.py --reference evals/score/I9b.pkl:pow070 I11=evals/score/I11.pkl:pow070 I12=evals/score/I12.pkl:pow070 I9b+I11=evals/score/I9b+I11.pkl:pow070 2>/dev/null | grep -v '^{' > logs/fused-I11-I12-vs-I9b.log +date -u +%H:%M:%S > logs/eval-I11-I12.done diff --git a/shared/package-files/64/6472f9cfea427314c51cc89af324875eb0935149f4cad625901e15a3f3f9b8f7/netprop-eval-3.log b/shared/package-files/64/6472f9cfea427314c51cc89af324875eb0935149f4cad625901e15a3f3f9b8f7/netprop-eval-3.log new file mode 100644 index 0000000000000000000000000000000000000000..6c7a4baf7994d89cc2b225fc8844f4d11785fe5a --- /dev/null +++ b/shared/package-files/64/6472f9cfea427314c51cc89af324875eb0935149f4cad625901e15a3f3f9b8f7/netprop-eval-3.log @@ -0,0 +1,31 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=6.0 norm | m=1 tau=1.0 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4258 (domain 0.4066 / other 0.4451) macro 0.3644 + lam 0.00/0.25: Hit@1 0.7771 (+0.0058 [-0.0169, +0.0247]) macro +0.0077 [+0.0030, +0.0124] pools +50 -24 | no top 20 +0.0169 cap30 +0.0128 [+0.0007, +0.0246] | Hit@5 -0.0324 macro@5 +0.0050 cap30@5 +0.0026 | twin +14 -5 other +36 -19 | dom -0.0002 oth +0.0118 + lam 0.00/0.50: Hit@1 0.7805 (+0.0092 [-0.0191, +0.0372]) macro +0.0083 [+0.0027, +0.0133] pools +59 -31 | no top 20 +0.0151 cap30 +0.0112 [-0.0018, +0.0252] | Hit@5 -0.0219 macro@5 +0.0062 cap30@5 +0.0069 | twin +19 -6 other +40 -25 | dom +0.0007 oth +0.0176 + lam 0.50/0.50: Hit@1 0.7805 (+0.0092 [-0.0198, +0.0368]) macro +0.0089 [+0.0027, +0.0148] pools +71 -41 | no top 20 +0.0152 cap30 +0.0113 [-0.0026, +0.0260] | Hit@5 -0.0220 macro@5 +0.0065 cap30@5 +0.0068 | twin +23 -9 other +48 -32 | dom -0.0001 oth +0.0186 + lam 0.00/1.00: Hit@1 0.7663 (-0.0050 [-0.0309, +0.0165]) macro +0.0071 [+0.0012, +0.0130] pools +68 -44 | no top 20 +0.0083 cap30 +0.0040 [-0.0119, +0.0191] | Hit@5 -0.0220 macro@5 +0.0050 cap30@5 +0.0068 | twin +22 -7 other +46 -37 | dom +0.0015 oth -0.0116 + +k=5 p=6.0 norm | m=1 tau=1.0 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4197 (domain 0.4037 / other 0.4357) macro 0.3597 + lam 0.00/0.25: Hit@1 0.7773 (+0.0060 [-0.0165, +0.0251]) macro +0.0080 [+0.0032, +0.0127] pools +50 -23 | no top 20 +0.0171 cap30 +0.0130 [+0.0009, +0.0249] | Hit@5 -0.0332 macro@5 +0.0047 cap30@5 +0.0017 | twin +14 -5 other +36 -18 | dom -0.0002 oth +0.0122 + lam 0.00/0.50: Hit@1 0.7710 (-0.0004 [-0.0253, +0.0201]) macro +0.0074 [+0.0018, +0.0124] pools +58 -33 | no top 20 +0.0135 cap30 +0.0078 [-0.0055, +0.0211] | Hit@5 -0.0222 macro@5 +0.0062 cap30@5 +0.0066 | twin +18 -6 other +40 -27 | dom +0.0005 oth -0.0012 + lam 0.50/0.50: Hit@1 0.7791 (+0.0078 [-0.0212, +0.0362]) macro +0.0083 [+0.0021, +0.0142] pools +71 -43 | no top 20 +0.0136 cap30 +0.0096 [-0.0048, +0.0244] | Hit@5 -0.0219 macro@5 +0.0068 cap30@5 +0.0070 | twin +23 -9 other +48 -34 | dom -0.0001 oth +0.0157 + lam 0.00/1.00: Hit@1 0.7684 (-0.0029 [-0.0281, +0.0187]) macro +0.0077 [+0.0018, +0.0139] pools +71 -45 | no top 20 +0.0107 cap30 +0.0063 [-0.0091, +0.0217] | Hit@5 -0.0306 macro@5 +0.0050 cap30@5 +0.0047 | twin +22 -8 other +49 -37 | dom +0.0018 oth -0.0076 + +k=20 p=6.0 norm | m=1 tau=1.0 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4306 (domain 0.4093 / other 0.4521) macro 0.3680 + lam 0.00/0.25: Hit@1 0.7773 (+0.0060 [-0.0169, +0.0249]) macro +0.0080 [+0.0032, +0.0124] pools +50 -23 | no top 20 +0.0171 cap30 +0.0130 [+0.0010, +0.0249] | Hit@5 -0.0325 macro@5 +0.0047 cap30@5 +0.0025 | twin +14 -5 other +36 -18 | dom -0.0002 oth +0.0122 + lam 0.00/0.50: Hit@1 0.7805 (+0.0092 [-0.0187, +0.0373]) macro +0.0080 [+0.0027, +0.0130] pools +57 -30 | no top 20 +0.0152 cap30 +0.0113 [-0.0020, +0.0253] | Hit@5 -0.0217 macro@5 +0.0065 cap30@5 +0.0072 | twin +19 -6 other +38 -24 | dom +0.0007 oth +0.0177 + lam 0.50/0.50: Hit@1 0.7806 (+0.0093 [-0.0199, +0.0368]) macro +0.0086 [+0.0027, +0.0145] pools +69 -40 | no top 20 +0.0152 cap30 +0.0114 [-0.0025, +0.0262] | Hit@5 -0.0217 macro@5 +0.0068 cap30@5 +0.0071 | twin +23 -9 other +46 -31 | dom -0.0001 oth +0.0187 + lam 0.00/1.00: Hit@1 0.7655 (-0.0059 [-0.0317, +0.0155]) macro +0.0074 [+0.0015, +0.0130] pools +68 -43 | no top 20 +0.0073 cap30 +0.0030 [-0.0127, +0.0178] | Hit@5 -0.0220 macro@5 +0.0050 cap30@5 +0.0068 | twin +22 -8 other +46 -35 | dom +0.0015 oth -0.0133 + +k=10 p=3.0 norm | m=1 tau=1.0 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4328 (domain 0.4134 / other 0.4523) macro 0.3736 + lam 0.00/0.25: Hit@1 0.7767 (+0.0054 [-0.0172, +0.0238]) macro +0.0065 [+0.0018, +0.0109] pools +44 -22 | no top 20 +0.0165 cap30 +0.0124 [+0.0010, +0.0243] | Hit@5 -0.0258 macro@5 +0.0062 cap30@5 +0.0073 | twin +12 -4 other +32 -18 | dom -0.0012 oth +0.0121 + lam 0.00/0.50: Hit@1 0.7809 (+0.0096 [-0.0187, +0.0367]) macro +0.0089 [+0.0035, +0.0139] pools +58 -28 | no top 20 +0.0156 cap30 +0.0118 [-0.0008, +0.0249] | Hit@5 -0.0195 macro@5 +0.0068 cap30@5 +0.0070 | twin +20 -5 other +38 -23 | dom +0.0011 oth +0.0182 + lam 0.50/0.50: Hit@1 0.7798 (+0.0084 [-0.0209, +0.0362]) macro +0.0092 [+0.0032, +0.0148] pools +67 -36 | no top 20 +0.0143 cap30 +0.0104 [-0.0035, +0.0243] | Hit@5 -0.0202 macro@5 +0.0065 cap30@5 +0.0062 | twin +24 -7 other +43 -29 | dom -0.0007 oth +0.0176 + lam 0.00/1.00: Hit@1 0.7693 (-0.0021 [-0.0266, +0.0188]) macro +0.0083 [+0.0027, +0.0142] pools +67 -39 | no top 20 +0.0116 cap30 +0.0071 [-0.0068, +0.0212] | Hit@5 -0.0188 macro@5 +0.0050 cap30@5 +0.0078 | twin +21 -6 other +46 -33 | dom +0.0006 oth -0.0047 + +k=10 p=10.0 norm | m=1 tau=1.0 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4161 (domain 0.3920 / other 0.4403) macro 0.3506 + lam 0.00/0.25: Hit@1 0.7769 (+0.0056 [-0.0170, +0.0243]) macro +0.0080 [+0.0032, +0.0127] pools +51 -24 | no top 20 +0.0167 cap30 +0.0126 [+0.0008, +0.0246] | Hit@5 -0.0317 macro@5 +0.0047 cap30@5 +0.0032 | twin +14 -5 other +37 -19 | dom +0.0007 oth +0.0105 + lam 0.00/0.50: Hit@1 0.7719 (+0.0006 [-0.0237, +0.0209]) macro +0.0074 [+0.0018, +0.0127] pools +59 -34 | no top 20 +0.0145 cap30 +0.0089 [-0.0045, +0.0221] | Hit@5 -0.0221 macro@5 +0.0062 cap30@5 +0.0067 | twin +18 -6 other +41 -28 | dom +0.0005 oth +0.0006 + lam 0.50/0.50: Hit@1 0.7795 (+0.0081 [-0.0203, +0.0370]) macro +0.0080 [+0.0018, +0.0139] pools +72 -45 | no top 20 +0.0140 cap30 +0.0100 [-0.0048, +0.0253] | Hit@5 -0.0217 macro@5 +0.0068 cap30@5 +0.0072 | twin +23 -9 other +49 -36 | dom -0.0006 oth +0.0169 + lam 0.00/1.00: Hit@1 0.7654 (-0.0059 [-0.0316, +0.0157]) macro +0.0056 [-0.0006, +0.0118] pools +69 -50 | no top 20 +0.0072 cap30 +0.0029 [-0.0128, +0.0186] | Hit@5 -0.0320 macro@5 +0.0030 cap30@5 +0.0028 | twin +22 -8 other +47 -42 | dom +0.0013 oth -0.0132 diff --git a/shared/package-files/64/649be077b72d3d1f9ec14b6c596a2fe594280535e37b691a7c5c88366def9739/fullfold-5Ms-I9b-L.done b/shared/package-files/64/649be077b72d3d1f9ec14b6c596a2fe594280535e37b691a7c5c88366def9739/fullfold-5Ms-I9b-L.done new file mode 100644 index 0000000000000000000000000000000000000000..b9b6b23b0d27f0adf9db040a72d09455ae476962 --- /dev/null +++ b/shared/package-files/64/649be077b72d3d1f9ec14b6c596a2fe594280535e37b691a7c5c88366def9739/fullfold-5Ms-I9b-L.done @@ -0,0 +1 @@ +10:34:21 diff --git a/shared/package-files/64/64b54a5bca1a3e9a60f39bb99912589125417a93bbddb4ccf3ffea42e6a936d2/replay-5Ms-N5-L-ion-net-val-sub.log b/shared/package-files/64/64b54a5bca1a3e9a60f39bb99912589125417a93bbddb4ccf3ffea42e6a936d2/replay-5Ms-N5-L-ion-net-val-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..293611b6e78eeee78f69a429fc7ec34300ccc5d6 --- /dev/null +++ b/shared/package-files/64/64b54a5bca1a3e9a60f39bb99912589125417a93bbddb4ccf3ffea42e6a936d2/replay-5Ms-N5-L-ion-net-val-sub.log @@ -0,0 +1,19 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 5, "inverse_members": 5, "library": true, "ion": true, "workers": 14} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 5.008825603988953} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 5.328635597019456} +{"event": "candidate_store", "pools": 413, "pairs": 119929, "seconds": 8.232084215967916} +{"event": "intact_ion", "scored": 2147, "seconds": 0.061678824946284294} +{"event": "library", "scored": 2147, "search_seconds": 39.149947670986876, "seconds": 40.035423167049885} +{"event": "inverse_annotated", "pools": 413, "pairs": 119929, "formulae": 19543, "unsupported_candidates": 938, "seconds": 0.00012431293725967407} +{"event": "inverse", "scored": 2147, "seconds": 6.64276105503086} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 103.77065944694914, "per_second": 616.7446592427104} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 212.39610730297863, "per_second": 602.6475796819132} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 328.38558692799415, "per_second": 584.6785231840893} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 465.9882140860427, "per_second": 549.370117658664} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 613.9020392439561} +{"event": "consensus", "scored": 2147, "pools": 413, "answers": 4130, "search_seconds": 0.3205594930332154, "seconds": 0.7048067490104586} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 3.574378732009791, "total_seconds": 690.7328261639923} +{"event": "measured", "exit_code": 0, "wall_seconds": 692.6, "user_seconds": 1674.1, "system_seconds": 79.9, "max_rss_gib": 3.49} +{"event": "replay_checked", "exit_code": 0, "package_files": 305, "package_unchanged": true, "processes_left": 0, "rankings": 2147} diff --git a/shared/package-files/64/64f79ac4551906fea7451593d9841bda3e80c63256d86f5d5ac6f4e210a8138b/rank-strata-kyd.log b/shared/package-files/64/64f79ac4551906fea7451593d9841bda3e80c63256d86f5d5ac6f4e210a8138b/rank-strata-kyd.log new file mode 100644 index 0000000000000000000000000000000000000000..aeb2381b2686a904b9ce23e8e9dc2611362d519f --- /dev/null +++ b/shared/package-files/64/64f79ac4551906fea7451593d9841bda3e80c63256d86f5d5ac6f4e210a8138b/rank-strata-kyd.log @@ -0,0 +1,45 @@ +stratum | m/z | queries | pools | Hit@1 | Hit@5 | lost share | missed with label in top 5 | rank 2 share | change vs baseline (queries) +[M+H]+ | | no energy | all | 299 | 270 | 0.8261 | 0.9264 | 0.0027 | 0.577 | 0.0569 | +0.0468 +[M+H]+ | Orbitrap | energy | all | 8211 | 2280 | 0.9509 | 0.9825 | 0.0207 | 0.643 | 0.0186 | +0.0044 +[M+H]+ | Orbitrap | energy | [0,300) | 189 | 47 | 0.8783 | 0.9206 | 0.0012 | 0.348 | 0.0423 | +0.0000 +[M+H]+ | Orbitrap | energy | [300,400) | 3248 | 907 | 0.9606 | 0.9874 | 0.0066 | 0.680 | 0.0132 | +0.0012 +[M+H]+ | Orbitrap | energy | [400,500) | 3037 | 880 | 0.9690 | 0.9937 | 0.0048 | 0.798 | 0.0188 | -0.0016 +[M+H]+ | Orbitrap | energy | [500,600) | 1141 | 281 | 0.9614 | 0.9974 | 0.0023 | 0.932 | 0.0193 | +0.0000 +[M+H]+ | Orbitrap | energy | [600,700) | 247 | 69 | 0.9271 | 1.0000 | 0.0009 | 1.000 | 0.0729 | +0.0000 +[M+H]+ | Orbitrap | energy | [700,850) | 195 | 50 | 0.8462 | 0.8923 | 0.0015 | 0.300 | 0.0000 | +0.1538 +[M+H]+ | Orbitrap | energy | [850,2000) | 154 | 46 | 0.5714 | 0.7078 | 0.0034 | 0.318 | 0.0325 | +0.0455 +[M+H]+ | Orbitrap | no energy | all | 3987 | 542 | 0.6875 | 0.7976 | 0.0641 | 0.352 | 0.0522 | +0.0672 +[M+H]+ | Orbitrap | no energy | [300,400) | 355 | 71 | 0.8479 | 0.8873 | 0.0028 | 0.259 | 0.0225 | +0.0056 +[M+H]+ | Orbitrap | no energy | [400,500) | 659 | 146 | 0.7208 | 0.8619 | 0.0095 | 0.505 | 0.1047 | +0.0334 +[M+H]+ | Orbitrap | no energy | [500,600) | 599 | 93 | 0.7896 | 0.9098 | 0.0065 | 0.571 | 0.0200 | +0.0618 +[M+H]+ | Orbitrap | no energy | [600,700) | 256 | 47 | 0.6758 | 0.9531 | 0.0043 | 0.855 | 0.1055 | -0.1016 +[M+H]+ | Orbitrap | no energy | [700,850) | 935 | 93 | 0.6888 | 0.8246 | 0.0150 | 0.436 | 0.0781 | +0.0096 +[M+H]+ | Orbitrap | no energy | [850,2000) | 1161 | 80 | 0.5668 | 0.6158 | 0.0259 | 0.113 | 0.0164 | +0.1929 +[M+H]+ | QTOF | energy | all | 1523 | 220 | 0.8582 | 0.8976 | 0.0111 | 0.278 | 0.0256 | +0.0085 +[M+H]+ | QTOF | energy | [300,400) | 420 | 42 | 1.0000 | 1.0000 | 0.0000 | 0.000 | 0.0000 | +0.0024 +[M+H]+ | QTOF | energy | [400,500) | 431 | 60 | 0.8770 | 0.9072 | 0.0027 | 0.245 | 0.0070 | +0.0093 +[M+H]+ | QTOF | energy | [500,600) | 253 | 44 | 0.9012 | 0.9447 | 0.0013 | 0.440 | 0.0316 | +0.0395 +[M+H]+ | QTOF | energy | [850,2000) | 238 | 40 | 0.5630 | 0.5966 | 0.0054 | 0.077 | 0.0084 | +0.0462 +[M+H]+ | QTOF | no energy | all | 672 | 534 | 0.8646 | 0.9345 | 0.0047 | 0.516 | 0.0283 | +0.0312 +[M+H]+ | QTOF | no energy | [300,400) | 132 | 91 | 0.9167 | 0.9545 | 0.0006 | 0.455 | 0.0227 | +0.0152 +[M+H]+ | QTOF | no energy | [400,500) | 197 | 151 | 0.8985 | 0.9645 | 0.0010 | 0.650 | 0.0203 | +0.0152 +[M+H]+ | QTOF | no energy | [500,600) | 174 | 142 | 0.9195 | 1.0000 | 0.0007 | 1.000 | 0.0460 | +0.0575 +[M+Na]+ | | no energy | all | 187 | 164 | 0.6898 | 0.8663 | 0.0030 | 0.569 | 0.1070 | +0.0107 +[M+Na]+ | Orbitrap | energy | all | 159 | 62 | 0.7736 | 0.9245 | 0.0019 | 0.667 | 0.0566 | +0.0000 +[M+Na]+ | Orbitrap | no energy | all | 4082 | 399 | 0.5941 | 0.6948 | 0.0853 | 0.248 | 0.0534 | +0.0605 +[M+Na]+ | Orbitrap | no energy | [300,400) | 130 | 21 | 0.5769 | 0.5769 | 0.0028 | 0.000 | 0.0000 | +0.0000 +[M+Na]+ | Orbitrap | no energy | [400,500) | 394 | 84 | 0.6726 | 0.8071 | 0.0066 | 0.411 | 0.0863 | +0.0102 +[M+Na]+ | Orbitrap | no energy | [500,600) | 590 | 79 | 0.7000 | 0.8356 | 0.0091 | 0.452 | 0.0237 | +0.0780 +[M+Na]+ | Orbitrap | no energy | [600,700) | 261 | 44 | 0.5824 | 0.7318 | 0.0056 | 0.358 | 0.1073 | +0.0000 +[M+Na]+ | Orbitrap | no energy | [700,850) | 854 | 73 | 0.6253 | 0.8126 | 0.0165 | 0.500 | 0.1218 | -0.0351 +[M+Na]+ | Orbitrap | no energy | [850,2000) | 1851 | 97 | 0.5316 | 0.5743 | 0.0446 | 0.091 | 0.0205 | +0.1226 +[M+Na]+ | QTOF | energy | all | 82 | 38 | 0.7195 | 0.9024 | 0.0012 | 0.652 | 0.0610 | -0.0488 +[M+Na]+ | QTOF | no energy | all | 227 | 203 | 0.7269 | 0.8899 | 0.0032 | 0.597 | 0.0793 | +0.0088 +all | all | 19429 | 3386 | 0.8022 | 0.8719 | 0.1978 | 0.352 | 0.0363 | +0.0308 +all | [0,300) | 274 | 64 | 0.8650 | 0.9270 | 0.0019 | 0.459 | 0.0328 | +0.0073 +all | [300,400) | 4352 | 1042 | 0.9407 | 0.9662 | 0.0133 | 0.430 | 0.0129 | +0.0025 +all | [400,500) | 4861 | 1170 | 0.8965 | 0.9494 | 0.0259 | 0.511 | 0.0348 | +0.0074 +all | [500,600) | 3036 | 543 | 0.8531 | 0.9433 | 0.0230 | 0.614 | 0.0319 | +0.0287 +all | [600,700) | 955 | 182 | 0.7581 | 0.9079 | 0.0119 | 0.619 | 0.0838 | -0.0293 +all | [700,850) | 2347 | 228 | 0.6898 | 0.8415 | 0.0375 | 0.489 | 0.0929 | +0.0094 +all | [850,2000) | 3604 | 243 | 0.5447 | 0.5993 | 0.0845 | 0.120 | 0.0214 | +0.1301 diff --git a/shared/package-files/65/654a19031846f3488368751a3ac6cf1d2918d5119bbfa298e2fbb5197f27ce11/selfsim.py b/shared/package-files/65/654a19031846f3488368751a3ac6cf1d2918d5119bbfa298e2fbb5197f27ce11/selfsim.py new file mode 100644 index 0000000000000000000000000000000000000000..3ac48811aeb6971898e6931d1c1b1d51ebffc366 --- /dev/null +++ b/shared/package-files/65/654a19031846f3488368751a3ac6cf1d2918d5119bbfa298e2fbb5197f27ce11/selfsim.py @@ -0,0 +1,374 @@ +#!/usr/bin/env python3 +"""Self-simulated spectra as extra training rows of the inverse model (lab, E60). + +The inverse model sees spectra without a recorded collision energy and sodium adducts almost only +through real train rows (12 k structures); the supplied synthetic corpus (435 k structures) has an +energy in every row. Our own forward simulators were trained on the real rows of every condition, so +they can render the synthetic STRUCTURES in the under-covered conditions. Only train-fold-trained +models and the supplied structures are involved; no validation structure is simulated for training. + +selfsim.py structures + -> inv/selfsim/structures.json : one SMILES per structure slot of inv/synth.npz +selfsim.py simulate NAME --source synth|real-train|real-validation --conditions "[M+H]+|Orbitrap|none,..." + [--bundle builds/5Ms-I1+I3x2-L] [--members 0,1,2,3,4] [--limit N] [--workers 10] + -> inv/selfsim/NAME/{masses.npy,intens.npy,done.npy,rows.npz} + real-* sources simulate, per condition, only the structures that have a real row in it + (calibration / realism analysis; real-validation is analysis only). +selfsim.py simulate NAME --source synth --from-rows K | --from-train K [--window 2000] [--seed 0] [--hash-range LOW,HIGH] + conditions per structure: those of K of its own corpus rows, or K real train-fold conditions + drawn from rows of similar molecular mass (missing energies included). +selfsim.py merge OUT.npz IN.npz [IN.npz ...] concatenate annotated stores (structure tables of different sources are appended) +selfsim.py annotate NAME OUT.npz [--floor 0.02] [--workers 12] + -> store with the layout of prepare_inv.py (mol = structure slot of the SOURCE store, fps copied) +""" +import argparse +import csv +import json +import multiprocessing +import os +import sys +import time +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +import inverse +import invrun + +ROOT = Path('/workspace/research') +STORE = ROOT / 'inv' +DATA = Path('/workspace/data') +LABELS = DATA / 'synthetic_augmentation' / 'labels.tsv' +STATE = {} + + +# -------------------------------------------------------------------------- +# structure slots -> SMILES +# -------------------------------------------------------------------------- + +def key_chunk(smiles): + from rdkit import Chem, RDLogger + RDLogger.DisableLog('rdApp.*') + out = [] + for text in smiles: + mol = Chem.MolFromSmiles(text) if text else None + formula = inverse.mol_formula(mol) if mol is not None else None + out.append(None if formula is None else (inverse.fingerprint(mol).tobytes(), formula.astype(np.int16).tobytes())) + return out + + +def slot_roots(store): + mol = store['mol'] + first = np.full(store['fps'].shape[0], -1, dtype=np.int64) + first[mol[::-1]] = np.arange(len(mol))[::-1] + assert (first >= 0).all() + return store['root'][first] + + +def structures(args): + started = time.monotonic() + store = {k: v for k, v in np.load(STORE / 'synth.npz').items() if k in ('fps', 'root', 'mol')} + roots = slot_roots(store) + smiles, seen = [], set() + with LABELS.open() as stream: + for row in csv.DictReader(stream, delimiter='\t'): + if row['smiles'] not in seen: + seen.add(row['smiles']) + smiles.append(row['smiles']) + chunks = [smiles[i:i + 2000] for i in range(0, len(smiles), 2000)] + with multiprocessing.Pool(args.workers) as pool: + keys = [k for part in pool.imap(key_chunk, chunks, chunksize=1) for k in part] + by_key = {} + for text, key in zip(smiles, keys): + if key is not None: + by_key.setdefault(key, []).append(text) + out, shared = [], 0 + for s in range(store['fps'].shape[0]): + options = by_key[(store['fps'][s].tobytes(), roots[s].astype(np.int16).tobytes())] + shared += len(options) > 1 + out.append(options[0] if len(options) == 1 else options.pop(0)) + target = STORE / 'selfsim' + target.mkdir(parents=True, exist_ok=True) + (target / 'structures.json').write_text(json.dumps(out)) + print(json.dumps({'slots': len(out), 'label_smiles': len(smiles), 'slots_sharing_a_key': shared, + 'seconds': time.monotonic() - started})) + + +def source_structures(name): + """(SMILES per slot, store) of a source store.""" + store = dict(np.load(STORE / f'{name}.npz')) + if name == 'synth': + return json.loads((STORE / 'selfsim' / 'structures.json').read_text()), store + if name.startswith('gen-'): # genstruct.py build + return json.loads((STORE / f'{name}.json').read_text()), store + fold = name.split('-', 1)[1] + rows = [json.loads(line)['target_smiles'] for line in (DATA / f'{fold}.jsonl').open()] + smiles = [None] * store['fps'].shape[0] + for row, slot in zip(store['row'], store['mol']): + if smiles[slot] is None: + smiles[slot] = rows[row] + return smiles, store + + +# -------------------------------------------------------------------------- +# simulation +# -------------------------------------------------------------------------- + +def parse_conditions(text): + out = [] + for item in text.split(','): + adduct, instrument, energy = item.split('|') + out.append((adduct, instrument, None if energy == 'none' else float(energy))) + return out + + +def simulate(args): + import infer + if os.environ.get('GLACIER_SOURCE'): + sys.path.insert(0, os.environ['GLACIER_SOURCE']) + import torch + from ms_pred import common + started = time.monotonic() + smiles, store = source_structures(args.source) + conditions = parse_conditions(args.conditions) if args.conditions else [] + queries, pools, slots_of = [], {}, {} + per_condition = None + if args.from_rows: + # the conditions of up to K of each structure's own rows (energy rounded), structures with slot hash in [low, high) + assert args.source == 'synth' + low, high = (float(x) for x in args.hash_range.split(',')) + mol = store['mol'].astype(np.int64) + share = ((mol * 2654435761) % 4294967296) / 4294967296.0 # the hash of train_inv.py --synth-structures + rows = np.flatnonzero((share >= low) & (share < high)) + rows = np.random.default_rng(0).permutation(rows) + rows = rows[np.argsort(mol[rows], kind='stable')] + first = np.r_[0, np.flatnonzero(np.diff(mol[rows])) + 1] + rank = np.arange(len(rows)) - np.repeat(first, np.diff(np.r_[first, len(rows)])) + rows = rows[rank < args.from_rows] + energy = np.round(store['energy'][rows]).astype(np.int64) + key = np.stack([store['adduct'][rows].astype(np.int64), store['instrument'][rows].astype(np.int64), energy, mol[rows]], 1) + key = np.unique(key, axis=0) # one simulation per (condition, structure) + per_condition = {} + for a, i, e, m in key: + per_condition.setdefault((int(a), int(i), int(e)), []).append(int(m)) + names = list(inverse.INSTRUMENTS) + [''] + conditions = [(inverse.ADDUCTS[a], names[i], float(e)) for a, i, e in per_condition] + per_condition = [np.array(v, dtype=np.int64) for v in per_condition.values()] + if args.from_train: + # K conditions per structure, each copied from a real train-fold row of similar molecular mass + # (rows within +-WINDOW positions in the mass order): the simulated rows follow the train fold's + # joint distribution of mass and acquisition condition, missing energies included. + assert not args.source.startswith('real-') and not args.from_rows + low, high = (float(x) for x in args.hash_range.split(',')) + real = {k: v for k, v in np.load(STORE / 'real-train.npz').items() if k in ('root', 'adduct', 'instrument', 'energy')} + real_mass = real['root'].astype(np.float64) @ inverse.MONO + order = np.argsort(real_mass, kind='stable') + slots = np.arange(store['fps'].shape[0], dtype=np.int64) + share = ((slots * 2654435761) % 4294967296) / 4294967296.0 + slots = slots[(share >= low) & (share < high)] + position = np.searchsorted(real_mass[order], slot_roots(store)[slots].astype(np.float64) @ inverse.MONO) + rng = np.random.default_rng(args.seed) + key = [] + for _ in range(args.from_train): + row = order[np.clip(position + rng.integers(-args.window, args.window + 1, len(slots)), 0, len(order) - 1)] + energy = real['energy'][row] + energy = np.where(np.isnan(energy), -1, np.round(energy)).astype(np.int64) + key.append(np.stack([real['adduct'][row].astype(np.int64), real['instrument'][row].astype(np.int64), energy, slots], 1)) + key = np.unique(np.concatenate(key), axis=0) # one simulation per (condition, structure) + per_condition = {} + for a, i, e, m in key: + per_condition.setdefault((int(a), int(i), int(e)), []).append(int(m)) + names = list(inverse.INSTRUMENTS) + [''] + conditions = [(inverse.ADDUCTS[a], names[i], None if e < 0 else float(e)) for a, i, e in per_condition] + per_condition = [np.array(v, dtype=np.int64) for v in per_condition.values()] + for number, (adduct, instrument, energy) in enumerate(conditions): + if per_condition is not None: + slots = per_condition[number] + elif not args.source.startswith('real-'): + slots = np.arange(len(smiles)) + else: + sel = (store['adduct'] == inverse.ADDUCTS.index(adduct)) & (store['instrument'] == invrun.instrument_index(instrument)) + sel &= np.isnan(store['energy']) if energy is None else np.isclose(store['energy'], energy) + slots = np.unique(store['mol'][sel]) + if args.limit and len(slots) > args.limit: + slots = np.sort(np.random.default_rng(0).choice(slots, args.limit, replace=False)) + for start in range(0, len(slots), 256): + pid = f'c{number}p{start // 256}' + pools[pid] = [{'smiles': smiles[s]} for s in slots[start:start + 256]] + slots_of[pid] = slots[start:start + 256] + queries.append({'query_id': pid, 'candidate_pool_id': pid, 'adduct': adduct, 'instrument_type': instrument, + 'collision_energy': energy, 'precursor_mz': 0.0}) + bundle = ROOT / args.bundle + config = json.loads((bundle / 'model_config.json').read_text()) + members = infer.load_members([bundle / 'model.pt'])[0] + members = [members[int(m)] for m in args.members.split(',')] + + def instrument_index(name): + return common.instrument2onehot_pos.get(name or 'Unknown', common.instrument2onehot_pos['Unknown']) + + plan = infer.Plan(queries, pools, args.workers, instrument_index, set(common.ion2onehot_pos)) + masses, intens, done = infer.simulate(plan, members, config, args.workers, torch.device('cuda')) + row_slot, row_task, row_adduct, row_instrument, row_energy = [], [], [], [], [] + for (pid, adduct, _, energy), group in plan.groups.items(): + query = queries[group['queries'][0]] + tasks = group['tasks'] + ok = tasks >= 0 + ok[ok] = done[tasks[ok]] + row_slot.append(slots_of[pid][ok]) + row_task.append(tasks[ok]) + row_adduct.append(np.full(int(ok.sum()), inverse.ADDUCTS.index(adduct), dtype=np.uint8)) + row_instrument.append(np.full(int(ok.sum()), invrun.instrument_index(query['instrument_type']), dtype=np.uint8)) + row_energy.append(np.full(int(ok.sum()), float('nan') if energy is None else energy, dtype=np.float32)) + out = STORE / 'selfsim' / args.name + out.mkdir(parents=True, exist_ok=True) + np.save(out / 'masses.npy', masses) + np.save(out / 'intens.npy', intens) + np.save(out / 'done.npy', done) + np.savez(out / 'rows.npz', slot=np.concatenate(row_slot), task=np.concatenate(row_task), adduct=np.concatenate(row_adduct), + instrument=np.concatenate(row_instrument), energy=np.concatenate(row_energy)) + mode = f'from-train {args.from_train} window {args.window} seed {args.seed}' if args.from_train else f'from-rows {args.from_rows}' + report = {'name': args.name, 'source': args.source, 'conditions': args.conditions or f'{mode} hash-range {args.hash_range} ({len(conditions)} conditions)', + 'bundle': args.bundle, 'members': args.members, + 'structures': len(smiles), 'tasks': int(len(done)), 'failed': int((~done).sum()), + 'rows': int(sum(len(r) for r in row_slot)), 'seconds': time.monotonic() - started} + (out / 'simulate.json').write_text(json.dumps(report, indent=1) + '\n') + print(json.dumps(report), flush=True) + + +# -------------------------------------------------------------------------- +# annotation +# -------------------------------------------------------------------------- + +def merged_spectrum(masses, intens, max_candidates=50): + """Mean of the members' max-normalized predictions (square-root intensity scale), strongest first.""" + members = masses.shape[0] + peak = intens.max(1, keepdims=True) + scaled = np.where(peak > 0, intens / np.maximum(peak, 1e-12), 0.0) + m, s = masses.reshape(-1).astype(np.float64), scaled.reshape(-1).astype(np.float64) + keep = (m > 0) & (s > 0) + if not keep.any(): + return np.zeros(0), np.zeros(0) + m, s = m[keep], s[keep] + _, index = np.unique(np.round(m * 1e4).astype(np.int64), return_inverse=True) + total = np.bincount(index, weights=s) / members + mass = np.bincount(index, weights=m) / np.bincount(index) + order = np.argsort(-total, kind='stable')[:max_candidates] + return mass[order], total[order] / total[order[0]] + + +def annotate_chunk(job): + low, high = job + if 'masses' not in STATE: + root = STATE['root'] + STATE['masses'] = np.load(root / 'masses.npy', mmap_mode='r') + STATE['intens'] = np.load(root / 'intens.npy', mmap_mode='r') + rows, roots, floor = STATE['rows'], STATE['roots'], STATE['floor'] + tables, out = {}, [] + for n in range(low, high): + task = int(rows['task'][n]) + formula = roots[rows['slot'][n]] + key = formula.tobytes() + if float(np.prod(formula[inverse.HEAVY].astype(np.float64) + 1)) > invrun.MAX_TABLE: + out.append((np.zeros((0, len(inverse.ELEMENTS)), np.uint8), np.zeros(0, np.float32), 0)) + continue + table = tables.get(key) + if table is None: + if len(tables) > 64: + tables.clear() + table = tables[key] = inverse.SubformulaTable(formula) + mz, inten = merged_spectrum(np.asarray(STATE['masses'][:, task]), np.asarray(STATE['intens'][:, task]).astype(np.float32)) + cut = inten >= floor + mz, inten = mz[cut], inten[cut] + peaks, kept = inverse.annotate(table, mz, inten, inverse.ADDUCTS[int(rows['adduct'][n])], invrun.PPM, invrun.FLOOR) + out.append((peaks, kept, len(mz))) + return out + + +def annotate(args): + started = time.monotonic() + root = STORE / 'selfsim' / args.name + report = json.loads((root / 'simulate.json').read_text()) + source = {k: v for k, v in np.load(STORE / f"{report['source']}.npz").items() if k in ('fps', 'root', 'mol')} + rows = dict(np.load(root / 'rows.npz')) + STATE.update(root=root, rows=rows, roots=slot_roots(source), floor=args.floor) + total = len(rows['slot']) + jobs = [(i, min(i + 4000, total)) for i in range(0, total, 4000)] + with multiprocessing.Pool(args.workers) as pool: + got = [g for part in pool.imap(annotate_chunk, jobs, chunksize=1) for g in part] + counts = np.array([len(g[1]) for g in got], dtype=np.int64) + keep = counts > 0 + np.savez(args.out, + root=STATE['roots'][rows['slot'][keep]].astype(np.int16), + offset=np.concatenate([[0], np.cumsum(counts[keep])]), + peaks=np.concatenate([g[0] for g, k in zip(got, keep) if k]).astype(np.uint8), + inten=np.concatenate([g[1] for g, k in zip(got, keep) if k]).astype(np.float32), + adduct=rows['adduct'][keep], instrument=rows['instrument'][keep], energy=rows['energy'][keep], + mol=rows['slot'][keep].astype(np.int32), fps=source['fps']) + manifest = dict(report, schema='allcond-inverse-selfsim/v1', floor=args.floor, spectra=int(keep.sum()), without_peak=int((~keep).sum()), + mean_annotated_peaks=float(counts[keep].mean()), mean_candidates=float(np.mean([g[2] for g in got])), + ppm=invrun.PPM, floor_da=invrun.FLOOR, max_peaks=inverse.MAX_PEAKS, annotate_seconds=time.monotonic() - started) + Path(str(args.out).replace('.npz', '.manifest.json')).write_text(json.dumps(manifest, indent=1) + '\n') + print(json.dumps(manifest), flush=True) + + +def merge(args): + """Concatenate annotated stores of one source (same structure slots and fingerprints).""" + parts = [dict(np.load(path)) for path in args.inputs] + tables, shift = [parts[0]['fps']], [0] # structure tables: shared when equal, else appended + for part in parts[1:]: + for table, start in zip(tables, shift): + if part['fps'].shape == table.shape and (part['fps'][::997] == table[::997]).all(): + shift.append(start) + break + else: + shift.append(sum(len(t) for t in tables)) + tables.append(part['fps']) + for part, start in zip(parts, shift): + part['mol'] = part['mol'].astype(np.int64) + start + counts = np.concatenate([np.diff(part['offset']) for part in parts]) + out = {k: np.concatenate([part[k] for part in parts]) for k in ('root', 'peaks', 'inten', 'adduct', 'instrument', 'energy', 'mol')} + out['mol'] = out['mol'].astype(np.int32) + np.savez(args.out, offset=np.concatenate([[0], np.cumsum(counts)]), fps=np.concatenate(tables), **out) + manifest = {'schema': 'allcond-inverse-selfsim/v1', 'merged': [str(path) for path in args.inputs], + 'parts': [json.loads(Path(str(path).replace('.npz', '.manifest.json')).read_text()) for path in args.inputs], + 'spectra': int(len(out['mol'])), 'structures': int(len(np.unique(out['mol'])))} + Path(str(args.out).replace('.npz', '.manifest.json')).write_text(json.dumps(manifest, indent=1) + '\n') + print(json.dumps({k: manifest[k] for k in ('merged', 'spectra', 'structures')}), flush=True) + + +def main(): + p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + sub = p.add_subparsers(dest='mode', required=True) + q = sub.add_parser('structures') + q.add_argument('--workers', type=int, default=12) + q = sub.add_parser('simulate') + q.add_argument('name') + q.add_argument('--source', required=True, help='synth | real-train | real-validation | gen-NAME (genstruct.py build)') + q.add_argument('--conditions', default='') + q.add_argument('--from-rows', type=int, default=0, + help='synth source: simulate the (adduct, instrument, rounded energy) of up to K of every structure\'s own corpus rows') + q.add_argument('--from-train', type=int, default=0, + help='synth source: K conditions per structure copied from real train-fold rows of similar molecular mass') + q.add_argument('--window', type=int, default=2000, help='with --from-train: half-width of the mass-rank window (rows)') + q.add_argument('--seed', type=int, default=0, help='with --from-train: sampling seed') + q.add_argument('--hash-range', default='0,1', help='with --from-rows / --from-train: structures whose slot hash share lies in [LOW, HIGH)') + q.add_argument('--bundle', default='builds/5Ms-I1+I3x2-L') + q.add_argument('--members', default='0,1,2,3,4') + q.add_argument('--limit', type=int, default=0) + q.add_argument('--workers', type=int, default=10) + q = sub.add_parser('annotate') + q.add_argument('name') + q.add_argument('out', type=Path) + q.add_argument('--floor', type=float, default=0.02) + q.add_argument('--workers', type=int, default=12) + q = sub.add_parser('merge') + q.add_argument('out', type=Path) + q.add_argument('inputs', type=Path, nargs='+') + args = p.parse_args() + {'structures': structures, 'simulate': simulate, 'annotate': annotate, 'merge': merge}[args.mode](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/65/65765bc14b508be5fb5396451e7a88f830ac71070c4cb70264651fa6cf1725ee/replay-5Ms-N5u48-L-ion-net2-val-tiny.report.json b/shared/package-files/65/65765bc14b508be5fb5396451e7a88f830ac71070c4cb70264651fa6cf1725ee/replay-5Ms-N5u48-L-ion-net2-val-tiny.report.json new file mode 100644 index 0000000000000000000000000000000000000000..6c8a5f8b7682c2956e75293cab4916472a6414e4 --- /dev/null +++ b/shared/package-files/65/65765bc14b508be5fb5396451e7a88f830ac71070c4cb70264651fa6cf1725ee/replay-5Ms-N5u48-L-ion-net2-val-tiny.report.json @@ -0,0 +1,119 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.9055555555555556, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.9069946452476574, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.9055555555555556, + "hit_rate_at_20": 0.9888888888888889, + "hit_rate_at_5": 0.9111111111111111 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": -0.005555555555555556, + "grouping": "supplied target_inchikey connectivity block", + "lower": -0.02027027027027027, + "molecule_groups": 40, + "queries": 180, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.0 + }, + "queries": 180, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.9568345323741008, + "queries": 139 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.7317073170731707, + "queries": 41 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.9055555555555556, + "queries": 180 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 1.0, + "queries": 49 + }, + "40-59.999": { + "hit_rate_at_1": 1.0, + "queries": 23 + }, + "<20": { + "hit_rate_at_1": 1.0, + "queries": 7 + }, + ">=60": { + "hit_rate_at_1": 0.9714285714285714, + "queries": 35 + }, + "missing": { + "hit_rate_at_1": 0.7575757575757576, + "queries": 66 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 1.0, + "queries": 1 + }, + "Orbitrap": { + "hit_rate_at_1": 0.8896103896103896, + "queries": 154 + }, + "QTOF": { + "hit_rate_at_1": 1.0, + "queries": 25 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.7647058823529411, + "queries": 68 + }, + "glacier_released": { + "hit_rate_at_1": 0.9910714285714286, + "queries": 112 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.9055555555555556, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7712214847028306, + "molecule_groups": 40, + "queries": 180, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.9942204836887913 + }, + "valid_rankings": 180 +} diff --git a/shared/package-files/65/65765bc14b508be5fb5396451e7a88f830ac71070c4cb70264651fa6cf1725ee/replay-5Ms-N5u48-L-ion-net2-val-tiny.score.log b/shared/package-files/65/65765bc14b508be5fb5396451e7a88f830ac71070c4cb70264651fa6cf1725ee/replay-5Ms-N5u48-L-ion-net2-val-tiny.score.log new file mode 100644 index 0000000000000000000000000000000000000000..6c8a5f8b7682c2956e75293cab4916472a6414e4 --- /dev/null +++ b/shared/package-files/65/65765bc14b508be5fb5396451e7a88f830ac71070c4cb70264651fa6cf1725ee/replay-5Ms-N5u48-L-ion-net2-val-tiny.score.log @@ -0,0 +1,119 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.9055555555555556, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.9069946452476574, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.9055555555555556, + "hit_rate_at_20": 0.9888888888888889, + "hit_rate_at_5": 0.9111111111111111 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": -0.005555555555555556, + "grouping": "supplied target_inchikey connectivity block", + "lower": -0.02027027027027027, + "molecule_groups": 40, + "queries": 180, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.0 + }, + "queries": 180, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.9568345323741008, + "queries": 139 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.7317073170731707, + "queries": 41 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.9055555555555556, + "queries": 180 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 1.0, + "queries": 49 + }, + "40-59.999": { + "hit_rate_at_1": 1.0, + "queries": 23 + }, + "<20": { + "hit_rate_at_1": 1.0, + "queries": 7 + }, + ">=60": { + "hit_rate_at_1": 0.9714285714285714, + "queries": 35 + }, + "missing": { + "hit_rate_at_1": 0.7575757575757576, + "queries": 66 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 1.0, + "queries": 1 + }, + "Orbitrap": { + "hit_rate_at_1": 0.8896103896103896, + "queries": 154 + }, + "QTOF": { + "hit_rate_at_1": 1.0, + "queries": 25 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.7647058823529411, + "queries": 68 + }, + "glacier_released": { + "hit_rate_at_1": 0.9910714285714286, + "queries": 112 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.9055555555555556, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7712214847028306, + "molecule_groups": 40, + "queries": 180, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.9942204836887913 + }, + "valid_rankings": 180 +} diff --git a/shared/package-files/65/6580db41a2e131ace674e6002161068298cb571d788bcdaac110225662bbb35e/summary.txt b/shared/package-files/65/6580db41a2e131ace674e6002161068298cb571d788bcdaac110225662bbb35e/summary.txt new file mode 100644 index 0000000000000000000000000000000000000000..0d6ec48285542877a020011797a5923f969350cc --- /dev/null +++ b/shared/package-files/65/6580db41a2e131ace674e6002161068298cb571d788bcdaac110225662bbb35e/summary.txt @@ -0,0 +1,47 @@ +evals/B10k-sub/report-ind.json + {'hit_rate_at_1': 0.4453, 'hit_rate_at_20': 0.6558, 'hit_rate_at_5': 0.5813} CI 0.3741 0.528 n 2147 valid 2147 err None + adduct {'[M+H]+': (0.548, 1658), '[M+Na]+': (0.098, 489)} + instrument_type {'': (0.486, 35), 'Orbitrap': (0.456, 1870), 'QTOF': (0.36, 242)} + collision_energy {'20-39.999': (0.686, 512), '40-59.999': (0.701, 177), '<20': (0.543, 151), '>=60': (0.693, 348), 'missing': (0.165, 959)} + routing_domain {'fallback': (0.163, 991), 'glacier_released': (0.687, 1156)} +evals/B10k-sub/report-agg1.json + {'hit_rate_at_1': 0.5915, 'hit_rate_at_20': 0.8104, 'hit_rate_at_5': 0.7354} CI 0.4925 0.694 n 2147 valid 2147 err None + adduct {'[M+H]+': (0.662, 1658), '[M+Na]+': (0.354, 489)} + instrument_type {'': (0.6, 35), 'Orbitrap': (0.605, 1870), 'QTOF': (0.488, 242)} + collision_energy {'20-39.999': (0.82, 512), '40-59.999': (0.718, 177), '<20': (0.596, 151), '>=60': (0.782, 348), 'missing': (0.376, 959)} + routing_domain {'fallback': (0.382, 991), 'glacier_released': (0.771, 1156)} +all n= 2147 hit1_ind=0.449 hit1_agg=0.592 h5_agg=0.735 h20_agg=0.810 npk=14 d_t=0.706 d_min=0.654 ties=0.22 cands=256 +('H', 'ce') n= 1156 hit1_ind=0.687 hit1_agg=0.771 h5_agg=0.917 h20_agg=0.963 npk=19 d_t=0.591 d_min=0.573 ties=0.01 cands=256 +('H', 'ceNA') n= 502 hit1_ind=0.227 hit1_agg=0.410 h5_agg=0.550 h20_agg=0.681 npk=12 d_t=0.953 d_min=0.797 ties=0.45 cands=256 +('Na', 'ce') n= 32 hit1_ind=0.125 hit1_agg=0.562 h5_agg=0.812 h20_agg=0.812 npk=8 d_t=0.654 d_min=0.536 ties=0.06 cands=256 +('Na', 'ceNA') n= 457 hit1_ind=0.112 hit1_agg=0.339 h5_agg=0.475 h20_agg=0.567 npk=7 d_t=1.000 d_min=0.914 ties=0.53 cands=256 +('H', 'ce', 'Orbitrap') n= 1007 hit1_ind=0.744 hit1_agg=0.819 h5_agg=0.958 h20_agg=0.985 npk=19 d_t=0.572 d_min=0.553 ties=0.01 cands=256 +('H', 'ce', 'QTOF') n= 149 hit1_ind=0.302 hit1_agg=0.443 h5_agg=0.638 h20_agg=0.812 npk=21 d_t=0.820 d_min=0.714 ties=0.02 cands=256 +('H', 'ceNA', 'Orbitrap') n= 411 hit1_ind=0.161 hit1_agg=0.367 h5_agg=0.499 h20_agg=0.637 npk=9 d_t=1.000 d_min=0.861 ties=0.54 cands=256 +('H', 'ceNA', 'QTOF') n= 68 hit1_ind=0.500 hit1_agg=0.588 h5_agg=0.779 h20_agg=0.868 npk=46 d_t=0.690 d_min=0.663 ties=0.01 cands=256 +('H', 'ceNA', 'none') n= 23 hit1_ind=0.609 hit1_agg=0.652 h5_agg=0.783 h20_agg=0.913 npk=106 d_t=0.667 d_min=0.598 ties=0.04 cands=256 +('Na', 'ce', 'Orbitrap') n= 23 hit1_ind=0.043 hit1_agg=0.652 h5_agg=1.000 h20_agg=1.000 npk=8 d_t=0.654 d_min=0.546 ties=0.04 cands=256 +('Na', 'ce', 'QTOF') n= 9 hit1_ind=0.333 hit1_agg=0.333 h5_agg=0.333 h20_agg=0.333 npk=12 d_t=0.511 d_min=0.511 ties=0.11 cands=256 +('Na', 'ceNA', 'Orbitrap') n= 429 hit1_ind=0.100 hit1_agg=0.326 h5_agg=0.466 h20_agg=0.555 npk=7 d_t=1.000 d_min=0.925 ties=0.57 cands=256 +('Na', 'ceNA', 'QTOF') n= 16 hit1_ind=0.312 hit1_agg=0.562 h5_agg=0.625 h20_agg=0.750 npk=84 d_t=0.713 d_min=0.660 ties=0.00 cands=256 +('Na', 'ceNA', 'none') n= 12 hit1_ind=0.250 hit1_agg=0.500 h5_agg=0.583 h20_agg=0.750 npk=84 d_t=0.715 d_min=0.645 ties=0.00 cands=256 +--- non-domain queries by pool composition +nondomain, pool has domain spectra n= 150 hit1_ind=0.200 hit1_agg=0.340 h5_agg=0.700 h20_agg=0.740 npk=16 d_t=0.666 d_min=0.593 ties=0.13 cands=256 +nondomain, pool has no domain spectra n= 841 hit1_ind=0.165 hit1_agg=0.390 h5_agg=0.492 h20_agg=0.614 npk=8 d_t=1.000 d_min=0.888 ties=0.53 cands=256 +--- by number of peaks +npk [1,3) n= 155 hit1_ind=0.084 hit1_agg=0.290 h5_agg=0.452 h20_agg=0.535 npk=2 d_t=1.000 d_min=0.965 ties=0.74 cands=256 +npk [3,6) n= 298 hit1_ind=0.252 hit1_agg=0.477 h5_agg=0.648 h20_agg=0.748 npk=4 d_t=0.918 d_min=0.727 ties=0.43 cands=256 +npk [6,11) n= 414 hit1_ind=0.304 hit1_agg=0.536 h5_agg=0.664 h20_agg=0.751 npk=8 d_t=0.781 d_min=0.694 ties=0.30 cands=256 +npk [11,21) n= 487 hit1_ind=0.474 hit1_agg=0.608 h5_agg=0.743 h20_agg=0.830 npk=15 d_t=0.681 d_min=0.625 ties=0.18 cands=256 +npk [21,51) n= 515 hit1_ind=0.639 hit1_agg=0.705 h5_agg=0.858 h20_agg=0.897 npk=31 d_t=0.630 d_min=0.609 ties=0.04 cands=256 +npk [51,1000000) n= 278 hit1_ind=0.680 hit1_agg=0.727 h5_agg=0.853 h20_agg=0.924 npk=74 d_t=0.657 d_min=0.626 ties=0.01 cands=256 +--- by pool size (queries per pool) +pool_n [1,2) n= 60 hit1_ind=0.583 hit1_agg=0.583 h5_agg=0.833 h20_agg=0.900 npk=44 d_t=0.688 d_min=0.658 ties=0.02 cands=256 +pool_n [2,4) n= 761 hit1_ind=0.744 hit1_agg=0.823 h5_agg=0.929 h20_agg=0.962 npk=21 d_t=0.572 d_min=0.555 ties=0.02 cands=256 +pool_n [4,8) n= 163 hit1_ind=0.515 hit1_agg=0.730 h5_agg=0.840 h20_agg=0.957 npk=20 d_t=0.604 d_min=0.582 ties=0.01 cands=256 +pool_n [8,16) n= 163 hit1_ind=0.485 hit1_agg=0.632 h5_agg=0.951 h20_agg=0.951 npk=16 d_t=0.613 d_min=0.573 ties=0.04 cands=256 +pool_n [16,1000000) n= 1000 hit1_ind=0.199 hit1_agg=0.387 h5_agg=0.530 h20_agg=0.643 npk=9 d_t=0.980 d_min=0.829 ties=0.46 cands=256 +--- by candidates +cands [128,256) n= 13 hit1_ind=0.462 hit1_agg=0.385 h5_agg=0.615 h20_agg=1.000 npk=27 d_t=0.661 d_min=0.582 ties=0.00 cands=189 +cands [256,257) n= 2134 hit1_ind=0.448 hit1_agg=0.593 h5_agg=0.736 h20_agg=0.809 npk=14 d_t=0.706 d_min=0.654 ties=0.22 cands=256 +pool-level hit1_agg (pools weighted equally): 0.7191283292978208 413 diff --git a/shared/package-files/65/658ac59518e2d3e878a9eb24fe7059e1618e18b979dc2ce3005e1b011eeafb18/B2-all-b32-seed2.log b/shared/package-files/65/658ac59518e2d3e878a9eb24fe7059e1618e18b979dc2ce3005e1b011eeafb18/B2-all-b32-seed2.log new file mode 100644 index 0000000000000000000000000000000000000000..948f80bf8f2c029bae65993fa0ef9c0c868aa305 --- /dev/null +++ b/shared/package-files/65/658ac59518e2d3e878a9eb24fe7059e1618e18b979dc2ce3005e1b011eeafb18/B2-all-b32-seed2.log @@ -0,0 +1,17 @@ +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "random", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 5000, "elapsed_seconds": 1394.3425170819974, "validation_loss": 0.7073428966104984, "validation_loss_ema": 0.6673278082162142} +{"step": 10000, "elapsed_seconds": 4412.34174187202, "validation_loss": 0.6268772426992655, "validation_loss_ema": 0.6139422971755266} +/opt/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 23 leaked semaphore objects to clean up at shutdown + warnings.warn('resource_tracker: There appear to be %d ' +DGL backend not selected or invalid. Assuming PyTorch for now. +Setting the default backend to "pytorch". You can change it in the ~/.dgl/config.json file or export the DGLBACKEND environment variable. Valid options are: pytorch, mxnet, tensorflow (all lowercase) +{"event": "resumed", "source": "/run-state/workspace/research/runs/B2-all-b32-seed2/last.ckpt", "step": 12000, "epoch": 2, "batch_in_epoch": 184, "elapsed": 4964.159852223005, "skipped": 0} +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "random", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 15000, "elapsed_seconds": 5748.505283480001, "validation_loss": 0.6074428390711546, "validation_loss_ema": 0.59406559728086} +{"step": 20000, "elapsed_seconds": 6945.18486677701, "validation_loss": 0.594346446916461, "validation_loss_ema": 0.5829043434932828} +{"step": 25000, "elapsed_seconds": 8133.248736456997, "validation_loss": 0.5886475183069706, "validation_loss_ema": 0.5755023881793022} +{"step": 30000, "elapsed_seconds": 9298.063542745003, "validation_loss": 0.5774099119007587, "validation_loss_ema": 0.5690539684146643} diff --git a/shared/package-files/65/65a59ff9c6f4c1e8ee2cedad723315cccea02590f9afd850e92a2f7d732bfb38/library-reverse-eval-znw_.log b/shared/package-files/65/65a59ff9c6f4c1e8ee2cedad723315cccea02590f9afd850e92a2f7d732bfb38/library-reverse-eval-znw_.log new file mode 100644 index 0000000000000000000000000000000000000000..3620acf5b972f40965075c37db761f626ffe8ab3 --- /dev/null +++ b/shared/package-files/65/65a59ff9c6f4c1e8ee2cedad723315cccea02590f9afd850e92a2f7d732bfb38/library-reverse-eval-znw_.log @@ -0,0 +1,37 @@ +base (released rule without consensus): Hit@1 0.7685 domain 0.9301 other 0.6062 macro 0.8650 +znw_16 alone per spectrum 0.1868 (0.2029 / 0.1707) pool mean 0.2517 (0.2400 / 0.2635) macro 0.2126 + other w 0.50 (x0.05/sd): Hit@1 0.7312 (-0.0373 [-0.0676, -0.0091]) macro 0.8571 (-0.0080 [-0.0136, -0.0021]) pools +35 -62 | domain 0.9279 other 0.5338 Hit@5 0.8745 + other w 1.00 (x0.05/sd): Hit@1 0.7014 (-0.0671 [-0.0985, -0.0375]) macro 0.8376 (-0.0275 [-0.0354, -0.0204]) pools +39 -132 | domain 0.9249 other 0.4769 Hit@5 0.8555 + other w 2.00 (x0.05/sd): Hit@1 0.6670 (-0.1014 [-0.1354, -0.0717]) macro 0.8015 (-0.0635 [-0.0735, -0.0540]) pools +40 -255 | domain 0.9177 other 0.4154 Hit@5 0.8330 + other w 4.00 (x0.05/sd): Hit@1 0.6383 (-0.1302 [-0.1659, -0.1001]) macro 0.7685 (-0.0966 [-0.1090, -0.0854]) pools +42 -369 | domain 0.9145 other 0.3610 Hit@5 0.8037 + all w 0.50 (x0.05/sd): Hit@1 0.7285 (-0.0400 [-0.0708, -0.0113]) macro 0.8517 (-0.0133 [-0.0207, -0.0059]) pools +61 -106 | domain 0.9235 other 0.5327 Hit@5 0.8760 + all w 1.00 (x0.05/sd): Hit@1 0.6866 (-0.0819 [-0.1149, -0.0509]) macro 0.8086 (-0.0564 [-0.0670, -0.0455]) pools +65 -256 | domain 0.8985 other 0.4739 Hit@5 0.8552 + all w 2.00 (x0.05/sd): Hit@1 0.5856 (-0.1829 [-0.2185, -0.1530]) macro 0.6831 (-0.1819 [-0.1967, -0.1672]) pools +61 -677 | domain 0.7606 other 0.4099 Hit@5 0.8267 + all w 4.00 (x0.05/sd): Hit@1 0.4383 (-0.3302 [-0.3707, -0.2927]) macro 0.4832 (-0.3819 [-0.3999, -0.3647]) pools +62 -1355 | domain 0.5313 other 0.3449 Hit@5 0.7624 +znw_2 alone per spectrum 0.1164 (0.0968 / 0.1360) pool mean 0.1613 (0.1168 / 0.2060) macro 0.1364 + other w 0.50 (x0.05/sd): Hit@1 0.7552 (-0.0133 [-0.0272, -0.0010]) macro 0.8568 (-0.0083 [-0.0127, -0.0038]) pools +18 -46 | domain 0.9288 other 0.5808 Hit@5 0.8858 + other w 1.00 (x0.05/sd): Hit@1 0.7427 (-0.0258 [-0.0435, -0.0095]) macro 0.8447 (-0.0204 [-0.0269, -0.0145]) pools +22 -91 | domain 0.9286 other 0.5560 Hit@5 0.8498 + other w 2.00 (x0.05/sd): Hit@1 0.7007 (-0.0678 [-0.1000, -0.0318]) macro 0.8166 (-0.0484 [-0.0570, -0.0399]) pools +28 -192 | domain 0.9251 other 0.4754 Hit@5 0.8406 + other w 4.00 (x0.05/sd): Hit@1 0.6642 (-0.1043 [-0.1386, -0.0648]) macro 0.7868 (-0.0783 [-0.0883, -0.0682]) pools +33 -298 | domain 0.9202 other 0.4072 Hit@5 0.8132 + all w 0.50 (x0.05/sd): Hit@1 0.7567 (-0.0118 [-0.0262, +0.0017]) macro 0.8576 (-0.0074 [-0.0121, -0.0021]) pools +29 -54 | domain 0.9318 other 0.5809 Hit@5 0.8867 + all w 1.00 (x0.05/sd): Hit@1 0.7417 (-0.0268 [-0.0452, -0.0104]) macro 0.8414 (-0.0236 [-0.0310, -0.0159]) pools +41 -121 | domain 0.9288 other 0.5538 Hit@5 0.8521 + all w 2.00 (x0.05/sd): Hit@1 0.6912 (-0.0773 [-0.1099, -0.0406]) macro 0.8036 (-0.0614 [-0.0715, -0.0511]) pools +53 -261 | domain 0.9055 other 0.4761 Hit@5 0.8373 + all w 4.00 (x0.05/sd): Hit@1 0.6100 (-0.1585 [-0.1953, -0.1207]) macro 0.7221 (-0.1429 [-0.1565, -0.1299]) pools +57 -541 | domain 0.8200 other 0.3992 Hit@5 0.7963 +znw_4 alone per spectrum 0.1915 (0.1653 / 0.2178) pool mean 0.2717 (0.1901 / 0.3536) macro 0.1999 + other w 0.50 (x0.05/sd): Hit@1 0.7444 (-0.0241 [-0.0491, -0.0020]) macro 0.8544 (-0.0106 [-0.0157, -0.0056]) pools +24 -60 | domain 0.9278 other 0.5602 Hit@5 0.9011 + other w 1.00 (x0.05/sd): Hit@1 0.7609 (-0.0076 [-0.0604, +0.0568]) macro 0.8429 (-0.0222 [-0.0281, -0.0159]) pools +30 -105 | domain 0.9273 other 0.5938 Hit@5 0.8930 + other w 2.00 (x0.05/sd): Hit@1 0.7356 (-0.0329 [-0.0901, +0.0343]) macro 0.8145 (-0.0505 [-0.0594, -0.0411]) pools +34 -205 | domain 0.9257 other 0.5447 Hit@5 0.8840 + other w 4.00 (x0.05/sd): Hit@1 0.6915 (-0.0769 [-0.1337, -0.0081]) macro 0.7841 (-0.0809 [-0.0913, -0.0703]) pools +35 -309 | domain 0.9184 other 0.4637 Hit@5 0.8688 + all w 0.50 (x0.05/sd): Hit@1 0.7438 (-0.0247 [-0.0497, -0.0029]) macro 0.8544 (-0.0106 [-0.0165, -0.0047]) pools +39 -75 | domain 0.9271 other 0.5598 Hit@5 0.8978 + all w 1.00 (x0.05/sd): Hit@1 0.7561 (-0.0124 [-0.0663, +0.0527]) macro 0.8367 (-0.0284 [-0.0357, -0.0207]) pools +47 -143 | domain 0.9198 other 0.5917 Hit@5 0.8877 + all w 2.00 (x0.05/sd): Hit@1 0.7103 (-0.0582 [-0.1145, +0.0100]) macro 0.7832 (-0.0818 [-0.0924, -0.0703]) pools +54 -331 | domain 0.8805 other 0.5395 Hit@5 0.8777 + all w 4.00 (x0.05/sd): Hit@1 0.6119 (-0.1566 [-0.2183, -0.0822]) macro 0.6858 (-0.1793 [-0.1940, -0.1648]) pools +51 -658 | domain 0.7707 other 0.4524 Hit@5 0.8448 +znw_8 alone per spectrum 0.2180 (0.2150 / 0.2209) pool mean 0.3129 (0.2614 / 0.3647) macro 0.2227 + other w 0.50 (x0.05/sd): Hit@1 0.7416 (-0.0269 [-0.0548, -0.0017]) macro 0.8568 (-0.0083 [-0.0142, -0.0021]) pools +41 -69 | domain 0.9289 other 0.5535 Hit@5 0.8856 + other w 1.00 (x0.05/sd): Hit@1 0.7189 (-0.0496 [-0.0824, -0.0212]) macro 0.8402 (-0.0248 [-0.0319, -0.0174]) pools +39 -123 | domain 0.9270 other 0.5101 Hit@5 0.8822 + other w 2.00 (x0.05/sd): Hit@1 0.6818 (-0.0867 [-0.1204, -0.0568]) macro 0.8036 (-0.0614 [-0.0712, -0.0520]) pools +38 -246 | domain 0.9231 other 0.4395 Hit@5 0.8583 + other w 4.00 (x0.05/sd): Hit@1 0.6537 (-0.1148 [-0.1505, -0.0843]) macro 0.7688 (-0.0963 [-0.1084, -0.0851]) pools +36 -362 | domain 0.9158 other 0.3905 Hit@5 0.8372 + all w 0.50 (x0.05/sd): Hit@1 0.7400 (-0.0285 [-0.0570, -0.0019]) macro 0.8538 (-0.0112 [-0.0186, -0.0038]) pools +60 -98 | domain 0.9252 other 0.5541 Hit@5 0.8850 + all w 1.00 (x0.05/sd): Hit@1 0.7029 (-0.0656 [-0.0999, -0.0358]) macro 0.8175 (-0.0475 [-0.0567, -0.0381]) pools +57 -218 | domain 0.9009 other 0.5042 Hit@5 0.8808 + all w 2.00 (x0.05/sd): Hit@1 0.6227 (-0.1458 [-0.1812, -0.1125]) macro 0.7165 (-0.1486 [-0.1627, -0.1338]) pools +57 -560 | domain 0.8111 other 0.4336 Hit@5 0.8532 + all w 4.00 (x0.05/sd): Hit@1 0.5110 (-0.2575 [-0.2973, -0.2227]) macro 0.5567 (-0.3083 [-0.3249, -0.2906]) pools +50 -1094 | domain 0.6392 other 0.3824 Hit@5 0.8160 diff --git a/shared/package-files/65/65c05c6910ca42ace15c775747a81a8501e5961fe1d333e50b2567e5b1483f6c/eval-tta-B30k-x0.8.log b/shared/package-files/65/65c05c6910ca42ace15c775747a81a8501e5961fe1d333e50b2567e5b1483f6c/eval-tta-B30k-x0.8.log new file mode 100644 index 0000000000000000000000000000000000000000..515e95c1c4801b0b17606397af8d34cab0eaded8 --- /dev/null +++ b/shared/package-files/65/65c05c6910ca42ace15c775747a81a8501e5961fe1d333e50b2567e5b1483f6c/eval-tta-B30k-x0.8.log @@ -0,0 +1,15 @@ +{"event": "loaded", "queries": 2436, "pools": 718, "members": 1, "inverse_members": 0, "workers": 7} +{"event": "canonicalized", "unique_candidates": 183118, "unsupported": 1153, "seconds": 16.156255247071385} +{"event": "planned", "queries": 2436, "groups": 2136, "molecules": 181965, "simulations": 542779, "seconds": 16.831340057076886} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 542779, "seconds": 43.63469172897749, "per_second": 1466.7228634847454} +{"event": "simulating", "finished": 128000, "total": 542779, "seconds": 78.4346901770914, "per_second": 1631.9309697150466} +{"event": "simulating", "finished": 192000, "total": 542779, "seconds": 103.85774192097597, "per_second": 1848.68259648944} +{"event": "simulating", "finished": 256000, "total": 542779, "seconds": 130.77621554606594, "per_second": 1957.5425006072603} +{"event": "simulating", "finished": 320000, "total": 542779, "seconds": 180.67652696708683, "per_second": 1771.1210491570564} +{"event": "simulating", "finished": 384000, "total": 542779, "seconds": 230.71923611301463, "per_second": 1664.3605729168717} +{"event": "simulating", "finished": 448000, "total": 542779, "seconds": 284.2202631930122, "per_second": 1576.2422952080865} +{"event": "simulating", "finished": 512000, "total": 542779, "seconds": 341.5589283980662, "per_second": 1499.0092702343154} +{"event": "simulated", "finished": 542779, "total": 542779, "failed": 0, "seconds": 378.8419136630837} +{"event": "finished", "queries": 2436, "unscored": 0, "directly_scored": 2436, "scoring_seconds": 5.7859275380615145, "total_seconds": 414.34331117896363} diff --git a/shared/package-files/65/65fe6c405fb3309b474a5f55af25af966670b792dfa0693cd82218cfff7fb25f/synthlib-evaluate-bin001-top128.log b/shared/package-files/65/65fe6c405fb3309b474a5f55af25af966670b792dfa0693cd82218cfff7fb25f/synthlib-evaluate-bin001-top128.log new file mode 100644 index 0000000000000000000000000000000000000000..3e68cb1d327bdc02c15bf25a179f5eb4a22993ba --- /dev/null +++ b/shared/package-files/65/65fe6c405fb3309b474a5f55af25af966670b792dfa0693cd82218cfff7fb25f/synthlib-evaluate-bin001-top128.log @@ -0,0 +1,49 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.281, to the average candidate 0.111 + domain: label 0.361, candidate 0.119, best similarity median 0.551 + other: label 0.200, candidate 0.103, best similarity median 0.453 +--- neighbour branch alone (per spectrum / pool mean) +frag k=20 p=2 debias ind all=0.2401 dom=0.3406 non=0.1392 | pool all=0.3893 dom=0.4838 non=0.2944 +frag k=20 p=3 debias ind all=0.2402 dom=0.3415 non=0.1385 | pool all=0.3952 dom=0.4849 non=0.3052 +frag k=20 p=4 debias ind all=0.2399 dom=0.3421 non=0.1373 | pool all=0.3933 dom=0.4836 non=0.3026 +frag k=50 p=2 debias ind all=0.2473 dom=0.3487 non=0.1455 | pool all=0.3801 dom=0.4799 non=0.2799 +frag k=50 p=3 debias ind all=0.2472 dom=0.3499 non=0.1440 | pool all=0.3848 dom=0.4878 non=0.2815 +frag k=50 p=4 debias ind all=0.2466 dom=0.3501 non=0.1427 | pool all=0.3910 dom=0.4905 non=0.2910 +frag k=100 p=2 debias ind all=0.2527 dom=0.3595 non=0.1455 | pool all=0.3712 dom=0.4719 non=0.2702 +frag k=100 p=3 debias ind all=0.2524 dom=0.3609 non=0.1434 | pool all=0.3770 dom=0.4788 non=0.2748 +frag k=100 p=4 debias ind all=0.2518 dom=0.3609 non=0.1422 | pool all=0.3803 dom=0.4819 non=0.2782 +loss k=20 p=2 debias ind all=0.2252 dom=0.3175 non=0.1324 | pool all=0.3454 dom=0.4290 non=0.2614 +loss k=20 p=3 debias ind all=0.2257 dom=0.3191 non=0.1320 | pool all=0.3465 dom=0.4290 non=0.2636 +loss k=20 p=4 debias ind all=0.2241 dom=0.3185 non=0.1293 | pool all=0.3496 dom=0.4306 non=0.2683 +loss k=50 p=2 debias ind all=0.2395 dom=0.3382 non=0.1405 | pool all=0.3618 dom=0.4422 non=0.2811 +loss k=50 p=3 debias ind all=0.2385 dom=0.3378 non=0.1387 | pool all=0.3570 dom=0.4454 non=0.2682 +loss k=50 p=4 debias ind all=0.2392 dom=0.3390 non=0.1389 | pool all=0.3571 dom=0.4446 non=0.2692 +loss k=100 p=2 debias ind all=0.2487 dom=0.3520 non=0.1450 | pool all=0.3612 dom=0.4531 non=0.2689 +loss k=100 p=3 debias ind all=0.2468 dom=0.3525 non=0.1407 | pool all=0.3604 dom=0.4486 non=0.2719 +loss k=100 p=4 debias ind all=0.2443 dom=0.3493 non=0.1389 | pool all=0.3609 dom=0.4537 non=0.2678 +sum k=20 p=2 debias ind all=0.3626 dom=0.5309 non=0.1936 | pool all=0.5426 dom=0.6612 non=0.4235 +sum k=20 p=3 debias ind all=0.3561 dom=0.5248 non=0.1867 | pool all=0.5151 dom=0.6536 non=0.3760 +sum k=20 p=4 debias ind all=0.3508 dom=0.5177 non=0.1832 | pool all=0.5091 dom=0.6461 non=0.3716 +sum k=50 p=2 debias ind all=0.3665 dom=0.5408 non=0.1914 | pool all=0.5138 dom=0.6753 non=0.3517 +sum k=50 p=3 debias ind all=0.3662 dom=0.5411 non=0.1905 | pool all=0.5124 dom=0.6698 non=0.3544 +sum k=50 p=4 debias ind all=0.3628 dom=0.5346 non=0.1902 | pool all=0.5083 dom=0.6586 non=0.3573 +sum k=100 p=2 debias ind all=0.3582 dom=0.5290 non=0.1867 | pool all=0.5068 dom=0.6613 non=0.3516 +sum k=100 p=3 debias ind all=0.3613 dom=0.5330 non=0.1889 | pool all=0.5097 dom=0.6663 non=0.3524 +sum k=100 p=4 debias ind all=0.3620 dom=0.5347 non=0.1887 | pool all=0.5077 dom=0.6646 non=0.3502 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8379 | +0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] +sum k=50 p=3 debias u=0.25/0 all=0.7507 dom=0.9137 non=0.5870 h5=0.8748 h20=0.9319 macro=0.8387 | +0.0026 [+0.0004,+0.0054] | ind 0.6020 +0.0008 [-0.0003,+0.0021] + pools +9 -6 | macro +0.0009 [-0.0012,+0.0030] | without top 20 +0.0029 [+0.0002,+0.0063] | weight min(n,30) +0.0030 [+0.0002,+0.0064] +sum k=50 p=3 debias u=0.5/0 all=0.7509 dom=0.9141 non=0.5871 h5=0.8760 h20=0.9316 macro=0.8393 | +0.0028 [+0.0003,+0.0058] | ind 0.6011 -0.0001 [-0.0016,+0.0014] + pools +16 -11 | macro +0.0015 [-0.0015,+0.0044] | without top 20 +0.0032 [+0.0004,+0.0067] | weight min(n,30) +0.0033 [+0.0004,+0.0069] +sum k=50 p=3 debias u=0/0.25 all=0.7471 dom=0.9099 non=0.5836 h5=0.8735 h20=0.9298 macro=0.8387 | -0.0010 [-0.0062,+0.0034] | ind 0.6044 +0.0032 [+0.0009,+0.0056] + pools +11 -8 | macro +0.0009 [-0.0015,+0.0032] | without top 20 -0.0012 [-0.0070,+0.0038] | weight min(n,30) -0.0010 [-0.0067,+0.0040] +sum k=50 p=3 debias u=0.25/0.25 all=0.7490 dom=0.9137 non=0.5837 h5=0.8741 h20=0.9304 macro=0.8393 | +0.0009 [-0.0047,+0.0059] | ind 0.6052 +0.0040 [+0.0015,+0.0069] + pools +19 -14 | macro +0.0015 [-0.0018,+0.0047] | without top 20 +0.0010 [-0.0053,+0.0070] | weight min(n,30) +0.0012 [-0.0050,+0.0072] +sum k=100 p=2 debias u=0.25/0 all=0.7500 dom=0.9124 non=0.5869 h5=0.8745 h20=0.9315 macro=0.8390 | +0.0019 [+0.0000,+0.0042] | ind 0.6023 +0.0011 [+0.0002,+0.0020] + pools +7 -3 | macro +0.0012 [-0.0006,+0.0030] | without top 20 +0.0021 [+0.0001,+0.0046] | weight min(n,30) +0.0021 [+0.0001,+0.0048] +sum k=100 p=2 debias u=0.5/0 all=0.7510 dom=0.9142 non=0.5871 h5=0.8749 h20=0.9315 macro=0.8396 | +0.0029 [+0.0005,+0.0059] | ind 0.6021 +0.0009 [-0.0004,+0.0022] + pools +14 -8 | macro +0.0018 [-0.0009,+0.0044] | without top 20 +0.0032 [+0.0005,+0.0068] | weight min(n,30) +0.0033 [+0.0005,+0.0069] +sum k=100 p=2 debias u=0/0.25 all=0.7473 dom=0.9089 non=0.5850 h5=0.8733 h20=0.9292 macro=0.8387 | -0.0008 [-0.0042,+0.0012] | ind 0.6035 +0.0023 [+0.0003,+0.0044] + pools +8 -5 | macro +0.0009 [-0.0012,+0.0030] | without top 20 -0.0009 [-0.0047,+0.0014] | weight min(n,30) -0.0010 [-0.0048,+0.0015] +sum k=100 p=2 debias u=0.25/0.25 all=0.7494 dom=0.9127 non=0.5855 h5=0.8734 h20=0.9294 macro=0.8402 | +0.0013 [-0.0026,+0.0044] | ind 0.6046 +0.0034 [+0.0012,+0.0057] + pools +16 -8 | macro +0.0024 [-0.0003,+0.0053] | without top 20 +0.0014 [-0.0029,+0.0051] | weight min(n,30) +0.0015 [-0.0030,+0.0052] diff --git a/shared/package-files/6a/6a5420fc83cec7733ea7db9b375e69ecc69b33e101374af834dbb1172973ec93/README.md b/shared/package-files/6a/6a5420fc83cec7733ea7db9b375e69ecc69b33e101374af834dbb1172973ec93/README.md new file mode 100644 index 0000000000000000000000000000000000000000..35387cf8e869acb09525b16d4bcd4659c9772743 --- /dev/null +++ b/shared/package-files/6a/6a5420fc83cec7733ea7db9b375e69ecc69b33e101374af834dbb1172973ec93/README.md @@ -0,0 +1,295 @@ +# MassSpecGym v1.5 retrieval package: four scratch-trained GLACIER simulators (tolerance-matched distance of their mean prediction) + formula-transformer inverse branch + pool aggregation + +Interim release (the research loop continues; see `EXPERIMENTS.md` at the package root). + +## What it does + +`bash infer.sh INPUT_ROOT OUTPUT_ROOT` reads `queries.jsonl` and `candidate_pools.jsonl` and +writes `OUTPUT_ROOT/rankings.jsonl` with one complete ranking per query. Two independent +models score every candidate and their distances are added. + +1. **Forward branch (spectrum simulation).** Every supported candidate SMILES is simulated + with a GLACIER forward model (ms-pred commit `ed8311f2`, vendored under `vendor/ms_pred`) + under the query's adduct, instrument and rounded collision energy (missing energy -> the + model's "no energy" embedding; missing instrument -> `Unknown`). Simulations are + deduplicated across queries. Each observed spectrum (top-50 peaks, square-root + intensities) is compared with each simulated candidate spectrum (top-100 predicted + fragments) by a Jensen-Shannon distance, with three global, label-free choices selected + on validation (`views` in `model_config.json`): + - **fragment-only view**: observed and predicted peaks at or above `precursor_mz - 0.5` + are left out before normalization; a spectrum with no fragment peak falls back to the + binned full-spectrum distance; + - predicted intensities are raised to the power 0.75 before normalization; + - **tolerance-matched comparison** instead of fixed 0.01 Da bins: + every predicted peak is assigned to the nearest observed peak if it lies within + `max(ppm x m/z, floor)` of it; the divergence is taken over the observed peaks and the + predicted intensity that matches no observed peak counts as its own outcome. The + tolerance depends only on the query's `instrument_type`: max(10 ppm, 1 mDa) for + `Orbitrap`, max(20 ppm, 4 mDa) for every other or missing instrument + (`match_ppm`, `match_floor_mda`, `match_by_instrument`). + Unsupported candidates get distance 1. The package holds four simulators from two + independently initialized training runs (see Model). **New in this release - one + distance of the ensemble's mean prediction** (`"ensemble": "prediction"`): for every + candidate the four members' matched predictions (the predicted probability assigned to + each observed peak and, with it, the unmatched remainder) are averaged and compared once + with the observed spectrum; the previous release averaged the four members' distances. + The weights are unchanged (`model.pt` is bit-identical to release `ue3i0ea7`). +2. **Inverse branch (fingerprint prediction;** `inverse.py`, `invrun.py`**).** For every pool and every *distinct molecular formula among its + candidates* (computed from the candidate SMILES), each spectrum of the pool is annotated + under that formula: the 50 strongest peaks are matched to heavy-atom sub-compositions of + the candidate formula (adduct-shifted, tolerance `max(20 ppm, 0.004 Da)`, RDBE >= 0) and + the 24 strongest explained peaks are kept. A 25.0 M-parameter transformer + (`FormulaFormer`: root-formula token with adduct / instrument / collision-energy context, + peak tokens with sub-formula, neutral loss and intensity, pairwise formula-difference + attention biases) predicts a 4096-bit Morgan fingerprint (radius 2). The predicted bit + probabilities are averaged over all spectra of the pool (`"pooled": true`), and the + inverse distance of a candidate is the cosine distance between that averaged prediction + **under the candidate's own formula** and the candidate's fingerprint. The package holds + three such networks (see Model) and the inverse distance is the plain mean of their + three distances (unchanged from the previous release). The hypothesized + formula is always the formula of the candidate being scored; no label, no true formula + and no precursor-m/z error enters the branch (the precursor m/z is not an input of the + network or of the annotation). Candidates with elements outside the supported list or + with more than 4 M heavy-atom sub-compositions get inverse distance 1. +3. **Fusion.** `distance = forward + w * inverse` with a fixed rule on acquisition metadata + and pool structure (`inverse` in `model_config.json`): `w = 0.75` for `[M+H]+` spectra + with a recorded collision energy; otherwise `w = max(0.05, 0.5 / n)`, where `n` is the + number of query spectra that name the same `candidate_pool_id`. Three global constants, + selected on validation; nothing is fitted per query. +4. **Pool aggregation (multi-spectrum evidence).** Queries that name the same + `candidate_pool_id` are spectra of the same unknown, so the final distance of a candidate + is the mean of its fused distances over all scored spectra of that pool + (`pool_aggregation: 1.0`). This uses only the supplied inputs: no labels, no formulae, no + candidate positions. With weight 1 all spectra of a pool receive the same ranking. +5. Candidates are sorted by distance, ties by candidate id. + +## Model + +- **Forward members**: four GLACIER networks (15.1 M parameters each) from TWO training + runs with the same recipe and different seeds, both **randomly initialized** and trained + only on the MassSpecGym v1.5 train fold under all acquisition conditions (194,119 train + spectra), batch 32, stock cosine intensity loss; EMA weights at 20,000 and 30,000 steps of + each run. Source checkpoint sha256: + - run B, seed 1 (`research/runs/B-all-b32`): step 20,000 + `80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c`, step 30,000 + `0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798` (the pair of the + previous release); + - run B2, seed 2 (`research/runs/B2-all-b32-seed2`): step 20,000 + `ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c`, step 30,000 + `f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1`. +- **Inverse members**: three `FormulaFormer` networks (dim 512, 6 layers, 8 heads, + 24,997,832 parameters each) from TWO training runs, both **randomly initialized**, seed 1, + binary cross-entropy on Morgan bits, batch 512, EMA weights: + - run I1 (`research/runs/I1-ff512x6`), 20 % of every batch from the train fold, step 50,000 + (sha256 `c131cac451c9d360d13a7576304a4f3ce59c4e542d10ec5e8e4b943838ba385b`); + - run I3 (`research/runs/I3-ff512x6-real08`), 8 % of every batch from the train fold, steps + 30,000 (sha256 `27125fd05eb958236b7f815eb97d8ae9b148aedd5c552067361a7bc116dffbae`) and + 100,000 (sha256 `d3a914a9bf011751408a2739cb18b0312df430fd31447b9115b0010861ab08e3`). + Training data of both runs: + - the MassSpecGym v1.5 train fold (194,119 spectra annotated under their label formula, + sampled with weight `spectra_of_molecule ** -0.5`), and + - the task-supplied `synthetic_augmentation` corpus (2,333,477 ICEBERG-simulated spectra of + 435,076 structures; the rest of every batch). The task documents describe this corpus as + held-out-clean optional training data available to every method; our check found 0 + structures (2D InChIKey block) shared with validation labels. + **Provenance note:** `model_manifest.json` keeps the contract's literal + `training_provenance.data` value ("MassSpecGym v1.5 train fold") because the contract fixes + the manifest fields; the additional supplied synthetic training corpus is declared here and + in `model_config.json` (`inverse_members[].training_data`). It is training *data* supplied + with the task, not a pretrained asset: no pretrained weights, no published GLACIER / MIST / + ICEBERG weights and no external model are used at any point. +- Validation never contributed a gradient. Validation labels selected: the checkpoint steps + and the member combinations, the matching tolerance per instrument class (two of eleven + tolerance settings tried), the ensemble rule (mean prediction; one of three rules tried), + pooled scoring, and the three fusion constants (unchanged since release `1yfse16j`; + re-screened for this member set in E42 and left as they were). +- `model.pt` (517 MB, sha256 + `dcd6427a4b330af2accd3697855cc3ea5c8d8630f69304665f2b5c2077d303b7`) is a single PyTorch + file holding the forward member list and the inverse member list. + +## Validation (selection evidence; not comparable to the test reference) + +Full validation fold, 19,429 queries / 3,386 pools, query-set sha256 +`7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6`. Official scorer +(`/workspace/evaluation/score.py`), report `research/logs/fullfold-4Mp-I1+I3x2.report.json`. + +| ranking | Hit@1 | Hit@5 | Hit@20 | 95 % CI Hit@1 (molecule-group bootstrap) | +|---|---|---|---|---| +| **released** (four forward members, matched distance of the mean prediction; inverse and fusion as before) | **0.7327** | 0.8565 | 0.9156 | 0.6762 - 0.7808 | +| previous release `ue3i0ea7` (same weights; mean of the four member distances) | 0.7316 | 0.8563 | 0.9152 | 0.6760 - 0.7796 | +| release `meqq___h` (forward pair of run B, 0.01 Da bins) | 0.7384 | 0.8418 | 0.9104 | 0.7015 - 0.7736 | +| release `1yfse16j` (same forward pair, inverse I1 50k only) | 0.7265 | 0.8372 | 0.9033 | 0.6895 - 0.7628 | +| release `xjj2vs5c` (forward pair only) | 0.6539 | 0.8177 | 0.8925 | 0.6164 - 0.6942 | + +Strata of the official report: `[M+H]+` 0.807, `[M+Na]+` 0.501; recorded collision energy +0.80-0.93, missing energy 0.554; Orbitrap 0.727, QTOF 0.779, no instrument 0.702; stock +GLACIER domain (`[M+H]+` with energy) 0.907, other 0.558. + +### This release against `ue3i0ea7`: the ensemble rule (E42 e) + +The only change is how the four simulators are combined. The Jensen-Shannon divergence is +convex in the predicted spectrum, so one distance of the averaged prediction scores the +ensemble as a single predictive distribution instead of averaging four separate verdicts. +Same simulations, same weights, same constants; paired bootstrap over pools +(`research/logs/ensemble-mean-4M.log`, `research/logs/anchor-mix-4M-ensmean.log`, +`research/logs/big-pools-ensmean.log`): + +| measure | `ue3i0ea7` | this release | paired difference [95 %] | +|---|---|---|---| +| forward branch alone, Hit@1 per spectrum | 0.4946 | 0.4997 | **+0.0050 [+0.0027, +0.0072]** | +| forward branch alone, after the pool mean | 0.6459 | 0.6500 | +0.0041 [-0.0029, +0.0121] | +| official Hit@1 (fused, query-weighted) | 0.7316 | 0.7327 | +0.0011 [-0.0031, +0.0055] | +| pool-macro Hit@1 (every pool counts once) | 0.8290 | 0.8317 | +0.0027 [-0.0009, +0.0062] | +| pools gained / lost | - | 25 / 16 | - | +| query-weighted Hit@1 without the 20 largest pools | 0.7669 | 0.7681 | +0.0013 [-0.0036, +0.0062] | +| Hit@1 with pool weight min(n, 30) | - | - | +0.0013 [-0.0036, +0.0063] | +| fused Hit@1 per spectrum (no pool mean) | 0.5882 | 0.5908 | +0.0026 (no interval computed) | + +**A small step, stated as such:** significant only for the forward branch per spectrum; +every pool-level measure is non-negative and none is significant by itself. It costs no +inference time and no new weights. None of the twelve largest pools changes sides (the +542-spectrum pool discussed below stays a miss, labelled candidate at rank 3). Averaging +the members in the square-root domain instead was worse (-0.0015 per spectrum, -0.0074 +after the pool mean) and is not used. + +### The member set against `meqq___h` (the decision of release `ue3i0ea7`, still in force) + +**The official validation Hit@1 of this release is 0.0057 LOWER than that of release +`meqq___h`** (paired pool bootstrap -0.0057 [-0.0673, +0.0424]; `ue3i0ea7`: -0.0068). The +four-member matched configuration was released anyway, for the following reason, which a +reader may weigh differently. + +The official Hit@1 gives every query the same weight, all spectra of a molecule share one +candidate pool, and the pool-mean rule gives all spectra of a pool the same ranking, so one +decision counts as many times as the pool has spectra. The largest validation pool has 542 +spectra (2.8 % of all queries; no domain spectrum, all Orbitrap, 79 % `[M+Na]+`); the five +largest pools hold 5.8 %, the twenty largest 11.2 %. That 542-spectrum pool is a hit for +`meqq___h` (labelled candidate at rank 0) and a miss for every member set that contains a +seed-2 simulator (rank 1 to 20; rank 3 in this release); it was also a miss for a later +snapshot of run B itself (E28). It alone is worth -0.0279. Measures that are not decided by +single pools (E40 / E42 in `EXPERIMENTS.md`, `research/logs/big-pools-ensmean-vs-meqq.log`; +paired bootstrap over pools, this release against `meqq___h`): + +| measure | `meqq___h` | this release | paired difference [95 %] | +|---|---|---|---| +| official Hit@1 (query-weighted) | 0.7384 | 0.7327 | -0.0057 [-0.0673, +0.0424] | +| pool-macro Hit@1 (every pool counts once) | 0.8210 | 0.8317 | **+0.0106 [+0.0038, +0.0177]** | +| pools gained / lost | - | 86 / 50 | - | +| query-weighted Hit@1 without the 5 largest pools | 0.7408 | 0.7546 | +0.0138 | +| query-weighted Hit@1 without the 20 largest pools | 0.7535 | 0.7681 | +0.0147 [-0.0009, +0.0306] | +| query-weighted Hit@1 without the 50 largest pools | 0.7659 | 0.7820 | +0.0161 | +| Hit@1 with pool weight min(n, 30) | - | - | **+0.0147 [+0.0003, +0.0300]** | +| fused Hit@1 per spectrum (no pool mean) | 0.5743 | 0.5908 | **+0.0165 [+0.0093, +0.0240]** | +| Hit@5 (official) | 0.8418 | 0.8565 | +0.0147 [-0.0043, +0.0365] | +| Hit@20 (official) | 0.9104 | 0.9156 | +0.0052 | + +Pools gained / lost against `meqq___h` by pool size: 1 spectrum 20 / 8, 2-3 spectra 32 / 18, +4-9 15 / 14, 10-29 14 / 6, >= 30 spectra 5 / 4. Among the twelve largest pools exactly two +change sides: the 542-spectrum pool is lost and the second largest (179 spectra) is gained. + +Our reading: the improvement is real per spectrum and per pool, and the official validation +number sits below `meqq___h` by the luck of one molecule whose pool flips with the simulator +seed (the 0.7384 of `meqq___h` contains the same luck with the opposite sign). Because the +test score is also query-weighted, it carries the same kind of single-pool variance; we +chose the configuration with the better expected value. **This is a judgment under noise, +not a demonstrated gain on the official metric.** The alternative that is non-negative on +every measure including the official one - the forward pair of run B with the matched +distance - scores 0.7420 (+0.0036 [-0.0110, +0.0182]), pool-macro 0.8234 (+0.0024 [-0.0024, ++0.0074]), per spectrum 0.5820, at half the inference time; its robust gains are between a quarter +and a half of this release's. + +What each change contributes (same inverse branch and fusion constants): + +| forward members | distance | ensemble rule | official Hit@1 | without the 20 largest pools | pool-macro | fused per spectrum | +|---|---|---|---|---|---|---| +| B 20k + 30k | 0.01 Da bins (`meqq___h`) | mean distance | 0.7384 | 0.7535 | 0.8210 | 0.5743 | +| B 20k + 30k | matched | mean distance | 0.7420 | 0.7575 | 0.8234 | 0.5820 | +| four members | 0.01 Da bins | mean distance | 0.7123 | 0.7452 | 0.8204 | 0.5807 | +| four members | matched (`ue3i0ea7`) | mean distance | 0.7316 | 0.7669 | 0.8290 | 0.5882 | +| **four members** | **matched** | **mean prediction** | **0.7327** | **0.7681** | **0.8317** | **0.5908** | +| B2 20k + 30k | matched | mean distance | 0.7037 | 0.7549 | 0.8201 | 0.5823 | + +More members help only together with the matched distance. The matched distance alone +improves the forward branch of each of the four members (per spectrum +0.008 to +0.012, +pool mean +0.011 to +0.022, E39 / E40); the instrument split follows the per-class table in +E40 (the tight tolerance gains on Orbitrap and loses on QTOF). + +Tried for this member set and not adopted (E42): a fifth member from a learning-rate-annealed +continuation of run B (validation loss -0.010, retrieval unchanged); other fusion constants +(pool-macro flat within 0.001 for a non-domain floor from 0.05 to 0.2; larger floors raise +the per-spectrum score to 0.63 but lose large pools); sixteen alternative comparison +functions for the matched spectra (best +0.004 per spectrum on one member). + +How these numbers were produced: the packaged `infer.py` of this exact build ran the complete +inverse branch (annotation + three networks), the matched scoring of all four members and +the fusion on the full fold, taking the forward simulations of the four members from their +saved full-fold prediction files (`--load-predictions`; 345 s; +`research/logs/fullfold-4Mp-I1+I3x2-saved-simulations.log`), and the official scorer produced +the released row; it equals the analysis-script value (0.7327) that the tables above are +built on, and the packaged scoring function agrees with the analysis code to 3.4e-8 on every +distance of the fold (`research/logs/check-ensemble-prediction-4M.log`). This build was +replayed end to end (forward simulation included) from a read-only copy outside the +workspace with an `env -i` environment on the 180-query subset `val-tiny` (40 complete +pools): exit status 0, 0 unscored queries, top-1 identical to the full-fold run for all 180 +queries and top-5 for 179 (one swap of ranks 4 and 5, a near-tie that depends on batching), +file hashes of the copy unchanged afterwards, no process left behind +(`research/logs/replay-4Mp-I1+I3x2-val-tiny.log`); and on an edge-case input (24 hand-built +queries: single candidate, 256 candidates, duplicate, unparsable, charged and unsupported +candidates, missing metadata, one-peak spectra, added to 180 validation queries): 204 / 204 +complete rankings (`research/logs/replay-4Mp-I1+I3x2-edge.log`). **Not run:** an end-to-end +replay of this build on the full fold with the simulations recomputed (the simulation code +and weights are those of `ue3i0ea7`). + +## Limits + +- Non-domain conditions (`[M+Na]+`, missing collision energy; half of the validation queries) + remain much weaker than the stock GLACIER domain (0.558 vs 0.907). 22 of the 27 lost points + sit there; the largest single class (about 11 points when it was measured for release + `meqq___h`, E33) is Orbitrap pools of 16-63 `[M+H]+` / `[M+Na]+` spectra without a recorded + energy and with 6-9 peaks per spectrum, where both branches fail together. On unseen molecules the simulator's intensity model is the weak part: its + loss doubles from train to validation even when it is given the true fragment set (E42 d). +- The validation estimate depends on a few very large pools (47 % of validation queries sit + in pools with >= 16 spectra and are hit or missed as a whole; one pool is 2.8 % of the + fold); the molecule-group interval is wide (0.676 - 0.781), the official validation Hit@1 + of this release is below that of release `meqq___h`, and the member set, the ensemble rule + and the non-domain fusion constant were chosen inside that noise (see Validation). +- The inverse networks are trained mostly on simulated spectra. Run I1 (20 % real spectra per + batch) overfits the 25k real training structures after about 50k steps; run I3 (8 %) is + flat from 30k to 100k steps. The three members are not independent (two are snapshots of + one run), so the ensemble gain is small. +- Candidates that RDKit cannot parse, contain unsupported elements or have more than 100 + heavy atoms get forward distance 1; elements outside + `C N P O S Si I H Cl F Br B Se Fe Co As Na K` get inverse distance 1. +- The precursor m/z is used only by the forward scoring view to separate fragment peaks from + the precursor region (the matching tolerance applies to fragment peaks only). An explicit precursor-mass-error term was evaluated (E21) and + deliberately **not** enabled, and the inverse branch does not read the precursor m/z. +- The same fixed weights handle every query; acquisition metadata (adduct, presence of a + collision energy) and the number of spectra per pool select the fusion weight; candidate + order, labels and popularity are never read. + +## Runtime + +`/opt/glacier/bin/python` (override with `MASSSPECGYM_GLACIER_PYTHON`), one GPU, <= 14 CPU +workers, no network, no writes inside the package. Forward branch: every candidate is +featurized once and simulated by all four members; the simulation is GPU-bound and linear +in the number of members. Measured per member on the full validation fold with a free H100 +and 12 workers: 2.54 M simulations in 1,363 s (`research/logs/eval-B2-30k-full.log`; the +other three members 1,340-1,530 s, the slower ones on a shared GPU). Everything else on the full fold with the four members' +simulations loaded from disk (canonicalization, planning, inverse annotation and networks, +matched scoring, ranking) on 7 workers while the GPU was shared with a training job: 345 s, +of which scoring 28 s. End to end on `val-tiny` (180 queries, 29,258 simulations x 4 +members) with 7 workers and the GPU shared with a training job: 117 s. **Expected total for +a fold of the size of validation or test on a free H100: about 5,800-6,300 s (four +simulators), inside the 18,000 s limit; not measured end to end on a full fold.** +Host memory, measured on the full validation fold (four members' simulations and the +inverse store in memory): 9.2 GiB peak resident in the largest process; the annotation +workers are forks of about 1.7 GiB each (mostly shared pages). + +## Files + +`infer.sh`, `infer.py`, `fastfeat.py` (compact featurization, tensor-equal to the stock one), +`inverse.py` (formula annotation, `FormulaFormer`), `invrun.py` (inference-side store and +pooled scoring), `model.pt`, `model_config.json`, `model_manifest.json`, `vendor/ms_pred` +(+ `LICENSE.ms-pred`), `training/` (training, preparation, publication and analysis source +used for this release; `training/inv/` holds the inverse-branch preparation and training +code). Experiment records: `EXPERIMENTS.md` and `research/` at the package root. diff --git a/shared/package-files/6a/6a8b02cdadd768a5b2b506bb4d6292ba9fdf84ecdb05369d74839433c027191d/consensus_determinism.py b/shared/package-files/6a/6a8b02cdadd768a5b2b506bb4d6292ba9fdf84ecdb05369d74839433c027191d/consensus_determinism.py new file mode 100644 index 0000000000000000000000000000000000000000..be1ec723d77e46f8e54dc61e793a693139115b17 --- /dev/null +++ b/shared/package-files/6a/6a8b02cdadd768a5b2b506bb4d6292ba9fdf84ecdb05369d74839433c027191d/consensus_determinism.py @@ -0,0 +1,94 @@ +"""Is the packaged cross-pool consensus term bit-reproducible, and does it keep exact ties? + +consensus_determinism.py --pred evals/fullfold/NAME/pred --build builds/NAME [--module allcond/pkg] [--runs 3] + +Runs ``consensus.run`` of ``--module`` (default: the build's own copy) ``--runs`` times on the full validation +input with the saved branch outputs of a packaged run and reports +(i) whether the runs are bit-identical, +(ii) the largest absolute difference to the term saved by the packaged run (``pred/consensus.pkl``), +(iii) for candidates of one pool with identical fingerprints (their votes are mathematically equal): + how many such groups exist and in how many the computed votes differ in some bit. +No label is read. +""" +import argparse +import importlib.util +import json +import pickle +import sys +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'analysis')) +sys.path.insert(0, str(HERE.parent / 'pkg')) +import netprop + +ROOT = Path('/workspace/research') + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--pred', required=True) + p.add_argument('--build', required=True) + p.add_argument('--module', default=None) + p.add_argument('--runs', type=int, default=3) + args = p.parse_args() + import torch + source = ROOT / (args.module or args.build) / 'consensus.py' + spec = importlib.util.spec_from_file_location('consensus_under_test', source) + consensus = importlib.util.module_from_spec(spec) + spec.loader.exec_module(consensus) + config = json.load(open(ROOT / args.build / 'model_config.json')) + queries, pools = netprop.load() + pred = {name: pickle.load(open(ROOT / args.pred / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion')} + base = netprop.released(queries, pools, pred, config) + store = np.load(ROOT / 'inv/pools-validation-input.npz') + slot = {pid: n for n, pid in enumerate(store['pool_id'])} + data = {'pool_id': store['pool_id'], 'pool_cand_start': store['pool_cand_start'], 'cand_fps': store['cand_fps'], + 'query_pool': np.array([slot.get(q['candidate_pool_id'], -1) for q in queries], dtype=np.int32)} + device = torch.device('cuda') + print(f'module {source.relative_to(ROOT)}') + runs = [consensus.run(queries, pools, data, base, config['consensus'], device, + lambda event, **values: print(event, json.dumps(values))) for _ in range(args.runs)] + for n in range(1, args.runs): + differing = sum(not ((a is None and b is None) or (a is not None and b is not None and np.array_equal(a, b))) + for a, b in zip(runs[0], runs[n])) + print(f'run 1 against run {n + 1}: {differing} of {len(queries)} queries differ in some bit') + saved = pickle.load(open(ROOT / args.pred / 'consensus.pkl', 'rb')) + worst, covered = 0.0, 0 + for q, t in zip(queries, runs[0]): + u = saved[q['query_id']] + assert (t is None) == (u is None) + if t is not None: + covered += 1 + worst = max(worst, float(np.max(np.abs(t - u)))) + print(f'against the term saved by the packaged run: {covered} queries, largest absolute difference {worst:.3g}') + groups = broken = spectra_broken = 0 + start, packed = data['pool_cand_start'], data['cand_fps'] # arrays in memory (an NpzFile re-reads on every access) + twins = {} + for index, q in enumerate(queries): + t = runs[0][index] + s = int(data['query_pool'][index]) + if t is None or s < 0: + continue + if s not in twins: + keys = [row.tobytes() for row in packed[start[s]:start[s + 1]]] + members = {} + for n, key in enumerate(keys): + members.setdefault(key, []).append(n) + twins[s] = [np.asarray(rows) for rows in members.values() if len(rows) > 1] + bad = False + for rows in twins[s]: + values = t[rows] + groups += 1 + if not np.all(values == values[0]): + broken += 1 + bad = True + spectra_broken += bad + print(f'candidates with identical fingerprints in one pool: {groups} (spectrum, group) pairs; votes differ in some bit in {broken} ' + f'({spectra_broken} spectra)') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/6a/6ac2b7dd35b92488e0c7da47754743bd27761d4e3b94c851e3f5f8906cea5152/recur-merged-10-max.log b/shared/package-files/6a/6ac2b7dd35b92488e0c7da47754743bd27761d4e3b94c851e3f5f8906cea5152/recur-merged-10-max.log new file mode 100644 index 0000000000000000000000000000000000000000..f75261409d1fb8dfcdac8a9747d1426e5834b967 --- /dev/null +++ b/shared/package-files/6a/6ac2b7dd35b92488e0c7da47754743bd27761d4e3b94c851e3f5f8906cea5152/recur-merged-10-max.log @@ -0,0 +1,2 @@ +merged tol 10 mDa: 17307 of 19429 spectra in groups of >= 3; peaks 432025 -> 1838331; 0 s +wrote /workspace/research/inv/recur/merged-10-max.npz 210 s diff --git a/shared/package-files/6a/6acba83ccf7e1a33e5b703bb6ffc7d63742d1e4650f19697ccc2673152a36f33/ensemble-mean-5M-seeds.log b/shared/package-files/6a/6acba83ccf7e1a33e5b703bb6ffc7d63742d1e4650f19697ccc2673152a36f33/ensemble-mean-5M-seeds.log new file mode 100644 index 0000000000000000000000000000000000000000..c79d377a5c21f1c612fc560d5183bb7f33e15dc2 --- /dev/null +++ b/shared/package-files/6a/6acba83ccf7e1a33e5b703bb6ffc7d63742d1e4650f19697ccc2673152a36f33/ensemble-mean-5M-seeds.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 54.43945868406445} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 58.44686445174739} +ind meanD all=0.4992 dom=0.7403 non=0.2570 h5=0.6517 h20=0.7254 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6435 dom=0.8127 non=0.4735 h5=0.8494 h20=0.8983 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.5067 dom=0.7506 non=0.2619 h5=0.6546 h20=0.7266 | diff=+0.0076 [+0.0050,+0.0103] +agg Dmean all=0.6514 dom=0.8200 non=0.4822 h5=0.8490 h20=0.8995 | diff=+0.0080 [+0.0011,+0.0163] +ind gmean all=0.4972 dom=0.7384 non=0.2551 h5=0.6509 h20=0.7238 | diff=-0.0019 [-0.0035,-0.0004] +agg gmean all=0.6362 dom=0.8107 non=0.4611 h5=0.8423 h20=0.8987 | diff=-0.0073 [-0.0145,-0.0017] diff --git a/shared/package-files/6a/6aeda45dbd6f398b90b526f032d6653239ebf4044667b6b747492ced5a61722c/recipe.json b/shared/package-files/6a/6aeda45dbd6f398b90b526f032d6653239ebf4044667b6b747492ced5a61722c/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..5fa45343b7a50b79470727b0c255a26e04399988 --- /dev/null +++ b/shared/package-files/6a/6aeda45dbd6f398b90b526f032d6653239ebf4044667b6b747492ced5a61722c/recipe.json @@ -0,0 +1,165 @@ +{ + "args": { + "store": "/workspace/research/inv", + "out": "runs/I21-ff512x6-real08-corpus2+train3-noise05-real05", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 0.5, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "noise_real_rate": 0.5, + "synth_peak_drop": -1.0, + "synth_jitter": -1.0, + "noise_near": 0.0, + "noise_deltas": "inv/noise_deltas.json", + "init": null, + "max_steps_this_run": 0 + }, + "parameters": 24997832, + "model": { + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "pair_dim": 64, + "fp_bits": 4096, + "max_energy": 200.0 + }, + "real_rows": 194119, + "synth_rows": 2333477, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "gpu": "NVIDIA H100 80GB HBM3", + "load_seconds": 13.709087857976556, + "extra_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + } +} diff --git a/shared/package-files/6d/6d21f5dd5a92565d8c3c9065f054679426c903486c250ecb2424a3e241586518/branch_strata.py b/shared/package-files/6d/6d21f5dd5a92565d8c3c9065f054679426c903486c250ecb2424a3e241586518/branch_strata.py new file mode 100644 index 0000000000000000000000000000000000000000..99c8acd9bc369f82cef224d5bc4db34e14508d79 --- /dev/null +++ b/shared/package-files/6d/6d21f5dd5a92565d8c3c9065f054679426c903486c250ecb2424a3e241586518/branch_strata.py @@ -0,0 +1,66 @@ +"""Branches alone by pool kind and size (lab, E72; labels evaluate only; nothing here is fitted) + +branch_strata.py [NAME ...] extra inverse predictions evals/fullfold/swap-NAME/pred/inverse.pkl +Pool-macro Hit@1 (first spectrum of every pool) and per-query Hit@1 of: forward distance, library term, ion term, +released inverse term, further inverse terms, the released rule without consensus; plus the share of pools where +any single branch ranks the label first. +""" +import json +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import netprop +import scorelab + +ROOT = netprop.ROOT + + +def main(): + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + config = json.load(open(ROOT / 'builds/5Ms-N5-L-ion-net2/model_config.json')) + load = lambda d: {n: pickle.load(open(ROOT / d / f'{n}.pkl', 'rb')) for n in ('distances', 'inverse', 'library', 'ion')} + ref = load('evals/fullfold/swap-N5/pred') + members = list(ev.by_pool.values()) + dom = ev.domain + share = np.array([dom[m].mean() for m in members]) + size = np.array([len(m) for m in members]) + kind = np.where(share == 1, 0, np.where(share == 0, 1, 2)) + + def column(table): + if isinstance(table, dict): + return [table.get(q['query_id']) for q in queries] + return table + + def hits(table): + col = column(table) + col = [np.zeros(len(pools[q['candidate_pool_id']])) if v is None else np.where(np.isfinite(v), v, np.nanmax(np.where(np.isfinite(v), v, -np.inf)) + 1.0 if np.isfinite(v).any() else 0.0) + for q, v in zip(queries, col)] + return ev.ranks(col, 1.0) == 0 + + branch = {'forward': hits(ref['distances']), 'library': hits(ref['library']), 'ion': hits(ref['ion']), 'inverse': hits(ref['inverse'])} + for name in sys.argv[1:]: + branch[name[-14:]] = hits(pickle.load(open(ROOT / f'evals/fullfold/swap-{name}/pred/inverse.pkl', 'rb'))) + branch['released'] = ev.ranks(netprop.released(queries, pools, ref, config), 1.0) == 0 + names = list(branch) + print('stratum pools queries | ' + ' '.join(f'{n:>14s}' for n in names) + ' | any branch (macro)') + strata = [(f'{kn} {sn}', (kind == k) & (size >= lo) & (size <= hi)) + for k, kn in enumerate(('domain', 'other ', 'mixed ')) for sn, lo, hi in (('1-2', 1, 2), ('3-5', 3, 5), ('6-20', 6, 20), ('>20', 21, 10 ** 9))] + strata.append(('all', np.ones(len(members), bool))) + for label, mask in strata: + if not mask.sum(): + continue + idx = [members[i] for i in np.flatnonzero(mask)] + allq = np.concatenate(idx) + macro = {n: np.mean([branch[n][m].mean() for m in idx]) for n in names} + perq = {n: branch[n][allq].mean() for n in names} + anyb = np.mean([max(branch[n][m].mean() for n in names[:-1]) for m in idx]) + print(f'{label:12s} {mask.sum():5d} {len(allq):6d} | ' + ' '.join(f'{macro[n]:.3f}/{perq[n]:.3f} ' for n in names) + f' | {anyb:.3f}') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/6d/6d6d46e929f2c00e6df2926b7ae62db34ee52d875f182f53bf5b33366d661427/replay-published-kyd8miv4-full.report.json b/shared/package-files/6d/6d6d46e929f2c00e6df2926b7ae62db34ee52d875f182f53bf5b33366d661427/replay-published-kyd8miv4-full.report.json new file mode 100644 index 0000000000000000000000000000000000000000..28fb14c4f0d661639a85e8488a1620f595fc8eb2 --- /dev/null +++ b/shared/package-files/6d/6d6d46e929f2c00e6df2926b7ae62db34ee52d875f182f53bf5b33366d661427/replay-published-kyd8miv4-full.report.json @@ -0,0 +1,111 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.8021514231303721, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.679162949859038, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.8021514231303721, + "hit_rate_at_20": 0.9163621390704617, + "hit_rate_at_5": 0.8718925317823871 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8633269806697522, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.6124129195693477, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.8017637048115105, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 1.0, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.9434931506849316, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.9329929802169751, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.84, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.9519230769230769, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.6651152951131796, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7736625514403292, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7967029624673033, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.8434504792332268, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.667354306343476, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.9364084651736182, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.8021514231303721, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7445318166611886, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8469376196029735 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/6d/6de96d4825ed027d0e8316ddcbbb29219c324c2c4c7604f4fcd7eb8d9f3329f3/pools-validation-input.manifest.json b/shared/package-files/6d/6de96d4825ed027d0e8316ddcbbb29219c324c2c4c7604f4fcd7eb8d9f3329f3/pools-validation-input.manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..e7ed6c12a0c602d87bdecc91d3ec407c5078f68a --- /dev/null +++ b/shared/package-files/6d/6de96d4825ed027d0e8316ddcbbb29219c324c2c4c7604f4fcd7eb8d9f3329f3/pools-validation-input.manifest.json @@ -0,0 +1,16 @@ +{ + "schema": "allcond-inverse-pools/v1", + "input": "validation-input", + "queries": 19429, + "pools": 3386, + "pairs": 1066979, + "distinct_formulae": 161754, + "candidates": 863339, + "unsupported_candidates": 7534, + "mean_annotated_peaks": 11.862249397598266, + "ppm": 20.0, + "floor": 0.004, + "query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6", + "sha256": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "elapsed_seconds": 59.481274316087365 +} diff --git a/shared/package-files/6d/6de96d4825ed027d0e8316ddcbbb29219c324c2c4c7604f4fcd7eb8d9f3329f3/prepare_inv_pools_validation.log b/shared/package-files/6d/6de96d4825ed027d0e8316ddcbbb29219c324c2c4c7604f4fcd7eb8d9f3329f3/prepare_inv_pools_validation.log new file mode 100644 index 0000000000000000000000000000000000000000..e7ed6c12a0c602d87bdecc91d3ec407c5078f68a --- /dev/null +++ b/shared/package-files/6d/6de96d4825ed027d0e8316ddcbbb29219c324c2c4c7604f4fcd7eb8d9f3329f3/prepare_inv_pools_validation.log @@ -0,0 +1,16 @@ +{ + "schema": "allcond-inverse-pools/v1", + "input": "validation-input", + "queries": 19429, + "pools": 3386, + "pairs": 1066979, + "distinct_formulae": 161754, + "candidates": 863339, + "unsupported_candidates": 7534, + "mean_annotated_peaks": 11.862249397598266, + "ppm": 20.0, + "floor": 0.004, + "query_sha256": "7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6", + "sha256": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "elapsed_seconds": 59.481274316087365 +} diff --git a/shared/package-files/74/7431d38ffa524ba44aaebbd73d627f3bf5de6b4f27d04f029af66631048d78bf/eval-score-N5-recur-msupport-10.log b/shared/package-files/74/7431d38ffa524ba44aaebbd73d627f3bf5de6b4f27d04f029af66631048d78bf/eval-score-N5-recur-msupport-10.log new file mode 100644 index 0000000000000000000000000000000000000000..838ba992b597027e78a478ea31d5846de9ec5494 --- /dev/null +++ b/shared/package-files/74/7431d38ffa524ba44aaebbd73d627f3bf5de6b4f27d04f029af66631048d78bf/eval-score-N5-recur-msupport-10.log @@ -0,0 +1,41 @@ +19429 queries, 5 members, 81.8 s +cos pool rule all=0.6266 dom=0.8302 non=0.4222 h5=0.7494 macro=0.7227 +cen pool rule all=0.6114 dom=0.8020 non=0.4199 h5=0.7465 macro=0.6991 +cos_pm pool rule all=0.6304 dom=0.8336 non=0.4265 h5=0.7529 macro=0.7227 +dot pool rule all=0.6442 dom=0.8156 non=0.4722 h5=0.7792 macro=0.7180 +geo pool rule all=0.6215 dom=0.8269 non=0.4154 h5=0.7339 macro=0.7129 +idf05 pool rule all=0.6346 dom=0.8344 non=0.4339 h5=0.7588 macro=0.7245 +idf1 pool rule all=0.6322 dom=0.8317 non=0.4319 h5=0.7625 macro=0.7242 +lin pool rule all=0.6053 dom=0.7923 non=0.4175 h5=0.7272 macro=0.6926 +log01 pool rule all=0.6606 dom=0.8443 non=0.4762 h5=0.7849 macro=0.7268 +log05 pool rule all=0.6427 dom=0.8436 non=0.4409 h5=0.7660 macro=0.7327 +log20 pool rule all=0.6439 dom=0.8441 non=0.4430 h5=0.7624 macro=0.7333 +nll02 pool rule all=0.4988 dom=0.7304 non=0.2663 h5=0.6390 macro=0.6048 +nll10 pool rule all=0.4767 dom=0.6927 non=0.2598 h5=0.6066 macro=0.5585 +poolcen pool rule all=0.6121 dom=0.8025 non=0.4209 h5=0.7625 macro=0.7020 +pow020 pool rule all=0.6150 dom=0.8179 non=0.4113 h5=0.7800 macro=0.7017 +pow030 pool rule all=0.6214 dom=0.8316 non=0.4103 h5=0.7859 macro=0.7115 +pow040 pool rule all=0.6357 dom=0.8396 non=0.4309 h5=0.7689 macro=0.7245 +pow05 pool rule all=0.6443 dom=0.8407 non=0.4472 h5=0.7705 macro=0.7295 +pow05idf025 pool rule all=0.6422 dom=0.8426 non=0.4411 h5=0.7743 macro=0.7312 +pow05idf05 pool rule all=0.6426 dom=0.8436 non=0.4408 h5=0.7738 macro=0.7330 +pow05m pool rule all=0.6391 dom=0.8376 non=0.4398 h5=0.7681 macro=0.7256 +pow05s pool rule all=0.6348 dom=0.8374 non=0.4314 h5=0.7604 macro=0.7259 +pow060 pool rule all=0.6414 dom=0.8419 non=0.4401 h5=0.7652 macro=0.7324 +pow060idf025 pool rule all=0.6404 dom=0.8427 non=0.4372 h5=0.7647 macro=0.7301 +pow060idf050 pool rule all=0.6448 dom=0.8438 non=0.4449 h5=0.7677 macro=0.7324 +pow060m pool rule all=0.6399 dom=0.8418 non=0.4372 h5=0.7629 macro=0.7304 +pow065 pool rule all=0.6393 dom=0.8428 non=0.4350 h5=0.7643 macro=0.7315 +pow070 pool rule all=0.6366 dom=0.8405 non=0.4319 h5=0.7635 macro=0.7318 +pow070idf025 pool rule all=0.6407 dom=0.8392 non=0.4414 h5=0.7668 macro=0.7315 +pow070idf050 pool rule all=0.6405 dom=0.8416 non=0.4387 h5=0.7676 macro=0.7318 +pow070m pool rule all=0.6355 dom=0.8389 non=0.4314 h5=0.7589 macro=0.7295 +pow075 pool rule all=0.6369 dom=0.8396 non=0.4334 h5=0.7606 macro=0.7310 +pow080 pool rule all=0.6337 dom=0.8377 non=0.4289 h5=0.7581 macro=0.7286 +pow080m pool rule all=0.6302 dom=0.8362 non=0.4233 h5=0.7555 macro=0.7256 +pow085 pool rule all=0.6331 dom=0.8368 non=0.4286 h5=0.7563 macro=0.7271 +pow085idf025 pool rule all=0.6360 dom=0.8363 non=0.4349 h5=0.7596 macro=0.7274 +pow085idf050 pool rule all=0.6354 dom=0.8381 non=0.4319 h5=0.7631 macro=0.7274 +pow090 pool rule all=0.6333 dom=0.8363 non=0.4295 h5=0.7558 macro=0.7265 +pow2 pool rule all=0.6064 dom=0.7967 non=0.4153 h5=0.7295 macro=0.6982 +tani pool rule all=0.6009 dom=0.8126 non=0.3882 h5=0.7536 macro=0.7094 diff --git a/shared/package-files/74/747bc63d1e902dbd8b7076407adc109cb1fd7e4f4fce9bf78d666e4ba2780049/near_ties.py b/shared/package-files/74/747bc63d1e902dbd8b7076407adc109cb1fd7e4f4fce9bf78d666e4ba2780049/near_ties.py new file mode 100644 index 0000000000000000000000000000000000000000..3a64795fe997385ee204ef716b4451bbfa32ace9 --- /dev/null +++ b/shared/package-files/74/747bc63d1e902dbd8b7076407adc109cb1fd7e4f4fce9bf78d666e4ba2780049/near_ties.py @@ -0,0 +1,80 @@ +"""How close the misses of the release are: exact ties, fingerprint twins and margins (analysis only, E68) + +near_ties.py [--pred evals/fullfold/5Ms-I9b+I13-L-ion/pred] [--released-term evals/netprop/term-m10-half05-ties.pkl] + +For every pool (first query; the pool rule gives all its spectra one ranking): rank of the label, +distance gap between the label and the first candidate in units of the pool's distance spread, +Morgan Tanimoto between the first candidate and the label, and the number of candidates whose +fingerprint is identical to the label's. Validation labels evaluate only. +""" +import argparse +import json +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import netprop +import scorelab + +ROOT = netprop.ROOT + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--pred', default='evals/fullfold/5Ms-I9b+I13-L-ion/pred') + parser.add_argument('--config', default='builds/5Ms-I9b+I13-L-ion/model_config.json') + parser.add_argument('--released-term', default='evals/netprop/term-m10-half05-ties.pkl') + args = parser.parse_args() + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + pred = {name: pickle.load(open(ROOT / args.pred / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion')} + base = netprop.released(queries, pools, pred, json.load(open(ROOT / args.config))) + term = pickle.load(open(ROOT / args.released_term, 'rb'))['term'] + term = term[next(iter(term))] + net = [b if (b is None or t is None) else b + t for b, t in zip(base, term)] + store = np.load(ROOT / 'inv/pools-validation-input.npz') + cstart, packed = store['pool_cand_start'], store['cand_fps'] + sslot = {str(pid): n for n, pid in enumerate(store['pool_id'])} + members = {} + for i, q in enumerate(queries): + members.setdefault(q['candidate_pool_id'], []).append(i) + rows = [] + for pid, idx in members.items(): + i = idx[0] + vals = [net[j] for j in idx if net[j] is not None] + if not vals: + continue + d = np.mean(vals, axis=0) # the pool rule: one ranking from the pool-mean distance + target = int(ev.target[i]) + order = np.lexsort((ev.ids[pid], d)) + rank = int(np.flatnonzero(order == target)[0]) + bits = np.unpackbits(packed[cstart[sslot[pid]]:cstart[sslot[pid] + 1]], axis=1).astype(np.float32) + inter = bits @ bits[target] + tani = inter / np.maximum(bits.sum(1) + bits[target].sum() - inter, 1.0) + twins = int((tani >= 0.9999).sum()) - 1 + spread = float(np.std(d)) or 1.0 + ahead = order[:rank] + rows.append(dict(size=len(idx), rank=rank, cands=len(d), gap=float(d[target] - d[order[0]]) / spread, exact=bool(rank > 0 and d[target] - d[order[0]] < 1e-9), + tani=float(tani[order[0]]), twins=twins, twin_ahead=int((tani[ahead] >= 0.9999).sum()), all_twins_ahead=bool(rank > 0 and (tani[ahead] >= 0.9999).all()), + near_ahead=int((tani[ahead] >= 0.8).sum()), margin=float(d[order[1]] - d[order[0]]) / spread if len(d) > 1 else 9.0, + twin_first=bool(rank == 0 and len(d) > 1 and tani[order[1]] >= 0.9999))) + total = sum(r['size'] for r in rows) + print(f'pools {len(rows)} queries {total}; pools whose label has a fingerprint twin in the pool: {sum(r["twins"] > 0 for r in rows)} ' + f'({sum(r["size"] for r in rows if r["twins"] > 0) / total:.4f} of the queries)') + for name, pick in (('rank 1', lambda r: r['rank'] == 0), ('rank 2', lambda r: r['rank'] == 1), ('rank 3 - 5', lambda r: 2 <= r['rank'] < 5), ('rank 6 - 20', lambda r: 5 <= r['rank'] < 20), ('beyond', lambda r: r['rank'] >= 20)): + part = [r for r in rows if pick(r)] + if not part: + continue + share = lambda f: sum(r['size'] for r in part if f(r)) / total + print(f'{name}: pools {len(part)} queries {sum(r["size"] for r in part)} ({share(lambda r: True):.4f}) | label has a twin {share(lambda r: r["twins"] > 0):.4f} | only twins ahead {share(lambda r: r["all_twins_ahead"]):.4f} ' + f'| exact tie with the first {share(lambda r: r["exact"]):.4f} | first has Tanimoto >= 0.8 {share(lambda r: r["rank"] > 0 and r["tani"] >= 0.8):.4f} | everything ahead >= 0.8 {share(lambda r: r["rank"] > 0 and r["near_ahead"] == r["rank"]):.4f} ' + f'| gap (pool-std units) quartiles {np.percentile([r["gap"] for r in part], [25, 50, 75]).round(3).tolist()} | first-second margin median {np.median([r["margin"] for r in part]):.3f}' + + (f' | hit with a twin right behind {share(lambda r: r["twin_first"]):.4f}' if name == 'rank 1' else '')) + pickle.dump(rows, open(ROOT / 'evals/near-ties-kyd.pkl', 'wb')) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/74/7480d74b9f1ecdcc0204551e099106de8380e940c6299c8dd8f6c776a0d17497/predict_smis_joint.py b/shared/package-files/74/7480d74b9f1ecdcc0204551e099106de8380e940c6299c8dd8f6c776a0d17497/predict_smis_joint.py new file mode 100644 index 0000000000000000000000000000000000000000..0ab01dd16bfe8c7482c22644856f1d4eddab9458 --- /dev/null +++ b/shared/package-files/74/7480d74b9f1ecdcc0204551e099106de8380e940c6299c8dd8f6c776a0d17497/predict_smis_joint.py @@ -0,0 +1,611 @@ +"""predict_smis_joint.py + +Make joint fragment + intensity predictions for a table of SMILES and write a +sparse PredSpecDB. + +Performance design +------------------ +The expensive part of inference is **featurization** -- turning each molecule +into a Graphormer input (BFS distance matrix + O(N^2 * multi_hop_max_dist) +edge-path features + random-walk positional encodings) plus the MAGMA fragment +engine / formula vectors. ``forward()`` on the GPU is comparatively cheap and, +at a reasonable batch size, saturates the GPU on its own. + +Previously featurization ran inline in the GPU process (``predict_mol``), so the +GPU sat idle waiting for the CPU. Here featurization is pushed into a +``torch.utils.data.DataLoader`` with many CPU worker processes that prefetch +batches while the GPU runs ``forward`` on the previous batch. Within a batch, +identical molecules (the same SMILES across several collision energies) are +featurized only once via a per-worker LRU cache, and entries are sorted by +(heavy-atom count, SMILES) so identical molecules land in the same batch and +similarly sized molecules share a batch (less padding waste). + +Optionally shards the work across multiple GPUs (one process per GPU). +""" +import logging +import os +import math +import ast +import queue +import shutil +import threading +import tempfile +from collections import OrderedDict +from datetime import datetime +import yaml +import argparse +from pathlib import Path +import pandas as pd + +from tqdm import tqdm +import torch +import torch.multiprocessing as mp +from torch.utils.data import Dataset, DataLoader + +import ms_pred.common as common + +from rdkit import Chem +from rdkit import rdBase +from rdkit import RDLogger +from ms_pred.common import chem_utils + +# ms_pred.GLACIER.joint_model / dataset pull in the heavy stack (pytorch_lightning, +# dgl, LinSATNet, pygmtools). They are imported lazily (see _lazy_imports) so the +# spawn-based prepare_entry worker pool -- which re-imports this module just to run +# prepare_entry and never touches the model/dataset -- does not pay that ~30s/worker +# import cost (which otherwise balloons pool startup to minutes). +joint_model = None +glacier_dataset = None + + +def _lazy_imports(): + global joint_model, glacier_dataset + if joint_model is None: + from ms_pred.glacier import joint_model as _jm, dataset as _gd + joint_model = _jm + glacier_dataset = _gd + + +rdBase.DisableLog("rdApp.error") +RDLogger.DisableLog("rdApp.*") + + +def get_args(): + parser = argparse.ArgumentParser() + parser.add_argument("--debug", default=False, action="store_true") + parser.add_argument("--gpu", default=False, action="store_true") + parser.add_argument("--seed", default=42, action="store", type=int) + parser.add_argument("--sparse-out", default=False, action="store_true") + parser.add_argument("--sparse-k", default=100, action="store", type=int) + parser.add_argument( + "--num-gpu-workers", + default=0, + action="store", + type=int, + help="Number of GPU shards (processes). 0/1 => single GPU. >1 => shard " + "molecules across that many GPUs, each writing its own shard file.", + ) + parser.add_argument( + "--num-cpu-workers", + default=32, + action="store", + type=int, + help="DataLoader worker processes used for featurization (per GPU shard).", + ) + parser.add_argument("--batch-size", default=64, action="store", type=int) + parser.add_argument("--prefetch-factor", default=4, action="store", type=int) + parser.add_argument( + "--feat-cache-size", + default=8192, + action="store", + type=int, + help=( + "Approximate per-shard featurization cache budget. When multiple " + "DataLoader workers are used, this budget is divided across workers " + "to avoid runaway host-memory use." + ), + ) + parser.add_argument( + "--no-dedup", + default=False, + action="store_true", + help="Disable within-batch unique-molecule featurization caching/sorting. " + "Forces every (mol, collision-energy) row to be re-featurized -- useful to " + "stress-test featurization throughput as if every row were a distinct molecule.", + ) + date = datetime.now().strftime("%Y_%m_%d") + parser.add_argument("--save-dir", default=f"results/{date}_ffn_pred/") + parser.add_argument("--out-name", default="preds.hdf5") + parser.add_argument("--num-h5-chunks", default=1, type=int) + parser.add_argument( + "--local-write-dir", + default=None, + help=( + "Optional node-local scratch directory for staging HDF5 prediction outputs. " + "If set, shard files are written locally first and moved to --save-dir " + "after they close cleanly." + ), + ) + parser.add_argument( + "--checkpoint", + help="name of checkpoint file", + default="results/glacier_nist20/split_1_rnd1/version_7/best.ckpt", + ) + parser.add_argument("--dataset-name", default=None) + parser.add_argument("--dataset-labels", default="labels.tsv") + parser.add_argument("--split-name", default="split_22.tsv") + parser.add_argument( + "--subset-datasets", + default="none", + action="store", + choices=["none", "train_only", "test_only", "debug_special"], + ) + parser.add_argument("--binned-out", default=False, action="store_true") + parser.add_argument( + "--no-write", + default=False, + action="store_true", + help="Run the full GPU pipeline but skip HDF5 writing (benchmark/profiling only).", + ) + return parser.parse_args() + + +def prepare_entry(entry): + """Turn one labels row into a list of (smi, name, ce, adduct, instrument, ikey) tuples. + + Canonicalizes the SMILES and drops molecules rdkit can't parse, that contain + wildcard atoms, or that have more than 100 heavy atoms. + """ + smi = entry["smiles"] + adduct = entry["ionization"] + name = entry["spec"] + instrument = entry["instrument"] if "instrument" in entry else "Orbitrap" + inchikey = common.inchikey_from_smiles(smi) + try: + mol = Chem.MolFromSmiles(smi) + if mol is None: + return [] + for atom in mol.GetAtoms(): + if atom.GetAtomicNum() not in chem_utils.VALID_ATOM_NUM: + return [] + mol = Chem.RemoveHs(mol) + if mol.GetNumAtoms() > 100: + return [] + smi = Chem.MolToSmiles(mol) # canonicalize + except Exception: + return [] + collision_energies = [i for i in ast.literal_eval(entry["collision_energies"])] + tup_to_process = [] + for colli_eng in collision_energies: + colli_eng_val = common.collision_energy_to_float(colli_eng) + if math.isnan(colli_eng_val): + continue + tup_to_process.append((smi, f"pred_{name}", colli_eng_val, adduct, instrument, f"ikey {inchikey}")) + return tup_to_process + + +def _prepare_entries_parallel(all_rows, num_workers): + """Canonicalize/filter/expand label rows into (mol, collision-energy) entries. + + Uses a *fork* pool: workers inherit the parent's already-imported modules, so + they pay no per-worker re-import. (The project-wide pool forces 'spawn' -- + ctx._force_start_method('spawn') in common.parallel_utils -- which re-imports the + whole torch/lightning/dgl stack in every worker, turning this trivial step into a + minutes-long warmup.) Safe because this runs before any CUDA initialization and + the work is CPU-only. + """ + if num_workers and num_workers > 1 and len(all_rows) > 1: + import multiprocessing as _mp + + n = min(num_workers, len(all_rows)) + chunksize = max(1, len(all_rows) // (n * 8)) + with _mp.get_context("fork").Pool(n) as pool: + nested = pool.map(prepare_entry, all_rows, chunksize=chunksize) + else: + nested = [prepare_entry(r) for r in all_rows] + return [t for sub in nested for t in sub] + + +def _resolve_loader_settings(num_entries, requested_workers, dedup, requested_cache_size): + """Bound DataLoader memory use while preserving throughput. + + The expensive featurization cache lives inside each worker process, so the + total resident cache roughly scales with `num_workers * feat_cache_size`. + Treat `requested_cache_size` as a per-shard budget and divide it across + workers so high-worker-count runs do not OOM the host. + """ + if requested_workers <= 0 or num_entries <= 1: + num_workers = 0 if requested_workers <= 0 else min(requested_workers, 1) + else: + num_workers = min(requested_workers, num_entries) + + if not dedup or requested_cache_size <= 0: + feat_cache_size = 0 + elif num_workers <= 1: + feat_cache_size = requested_cache_size + else: + feat_cache_size = max(64, math.ceil(requested_cache_size / num_workers)) + + return num_workers, feat_cache_size + + +def _stage_output_paths(out_path: Path, local_write_dir: str | None, device: str): + final_out_path = Path(out_path) + if not local_write_dir: + return final_out_path, None + + scratch_root = Path(local_write_dir).expanduser().resolve() + scratch_root.mkdir(parents=True, exist_ok=True) + stage_dir = Path( + tempfile.mkdtemp( + prefix=f"{final_out_path.stem}_{device.replace(':', '_')}_", + dir=scratch_root, + ) + ) + return stage_dir / final_out_path.name, stage_dir + + +def _move_staged_outputs(staged_out_path: Path, final_out_path: Path, num_h5_chunks: int): + staged_paths = common.PredSpecDB._resolve_h5_paths( + Path(staged_out_path), mode="w", num_h5s=num_h5_chunks + ) + final_paths = common.PredSpecDB._resolve_h5_paths( + Path(final_out_path), mode="w", num_h5s=num_h5_chunks + ) + + final_out_path.parent.mkdir(parents=True, exist_ok=True) + for staged_path, final_path in zip(staged_paths, final_paths): + if final_path.exists(): + final_path.unlink() + shutil.move(str(staged_path), str(final_path)) + + +class GraphormerFeatDataset(Dataset): + """Featurizes one prediction entry per item; intended to run in DataLoader workers. + + Each entry is ``(smi, pred_name, collision_energy, adduct, instrument, ikey)``. + Heavy featurization (``featurize_tree`` -> ``create_graphormer_input``) is cached + per (smiles, adduct) so repeated collision energies of the same molecule are + featurized once. Reuses ``IntenDataset.collate_fn`` for tensor batching. + """ + + def __init__(self, entries, tree_processor, sort_for_batching=True, feat_cache_size=8192): + _lazy_imports() + self.tree_processor = tree_processor + self.feat_cache_size = feat_cache_size + self._feat_cache = OrderedDict() + if sort_for_batching: + n_atoms_cache = {} + + def _num_atoms(smi): + if smi not in n_atoms_cache: + m = Chem.MolFromSmiles(smi) + n_atoms_cache[smi] = m.GetNumAtoms() if m is not None else 0 + return n_atoms_cache[smi] + + entries = sorted(entries, key=lambda e: (_num_atoms(e[0]), e[0])) + self.entries = entries + + def __len__(self): + return len(self.entries) + + def _featurize_cached(self, smi, adduct, ce): + if self.feat_cache_size <= 0: # dedup disabled (stress-test / all-unique input) + tree = {"root_canonical_smiles": smi, "adduct": adduct, "collision_energy": ce} + return self.tree_processor.featurize_tree( + tree, include_inten_targs=False, include_frag_targs=False + ) + key = (smi, adduct) + feat = self._feat_cache.get(key) + if feat is None: + tree = {"root_canonical_smiles": smi, "adduct": adduct, "collision_energy": ce} + feat = self.tree_processor.featurize_tree( + tree, include_inten_targs=False, include_frag_targs=False + ) + self._feat_cache[key] = feat + if self.feat_cache_size and len(self._feat_cache) > self.feat_cache_size: + self._feat_cache.popitem(last=False) + else: + self._feat_cache.move_to_end(key) + return feat + + def __getitem__(self, idx): + smi, pred_name, ce, adduct, instrument, ikey = self.entries[idx] + feat = dict(self._featurize_cached(smi, adduct, ce)) + feat["collision_energy"] = ce + instrument_pos = common.instrument2onehot_pos.get( + instrument, common.instrument2onehot_pos.get("Orbitrap", 0) + ) + item = { + "name": pred_name, + "adduct": common.ion2onehot_pos[adduct], + "precursor": 0.0, + "instrument": instrument_pos, + # metadata carried through collate for writing the spectrum: + "_pred_name": pred_name, + "_adduct_str": adduct, + "_ikey": ikey, + "_ce": ce, + "_smi": smi, + } + item.update(feat) + return item + + +def collate_predict(batch): + _lazy_imports() + out = glacier_dataset.IntenDataset.collate_fn(batch) + out["pred_names"] = [b["_pred_name"] for b in batch] + out["adduct_strs"] = [b["_adduct_str"] for b in batch] + out["ikeys"] = [b["_ikey"] for b in batch] + out["ces"] = [b["_ce"] for b in batch] + out["smis_canon"] = [b["_smi"] for b in batch] + return out + + +def _batch_to_device(batch, device): + for k in batch: + v = batch[k] + if isinstance(v, torch.Tensor): + batch[k] = v.to(device, non_blocking=True) + elif k == "graphormer_input" and v is not None: + for gk in v: + v[gk] = v[gk].to(device, non_blocking=True) + return batch + + +def run_shard(entries, checkpoint, device, out_path, kwargs): + """Featurize (parallel CPU) + forward (GPU) for one shard, writing a PredSpecDB.""" + assert kwargs["sparse_out"], "sparse_out must be True" + _lazy_imports() + sparse_k = kwargs["sparse_k"] + dedup = not kwargs.get("no_dedup", False) + requested_workers = kwargs["num_cpu_workers"] + num_workers, feat_cache_size = _resolve_loader_settings( + num_entries=len(entries), + requested_workers=requested_workers, + dedup=dedup, + requested_cache_size=kwargs.get("feat_cache_size", 8192), + ) + + # Keep the model on CPU for now -- see the iter()/`.to(device)` ordering below. + model = joint_model.JointModel.load_from_checkpoint(checkpoint) + model.eval() + model.freeze() + + tree_processor = glacier_dataset.TreeProcessor( + pe_embed_k=model.pe_embed_k, + root_encode="graphormer", + embed_elem_group=model.embed_elem_group, + multi_hop_max_dist=model.multi_hop_max_dist, + ) + logging.info( + "Shard %s DataLoader config: entries=%s requested_workers=%s effective_workers=%s " + "feat_cache_per_worker=%s dedup=%s", + device, + len(entries), + requested_workers, + num_workers, + feat_cache_size, + dedup, + ) + pred_dataset = GraphormerFeatDataset( + entries, + tree_processor=tree_processor, + # Always size-sort: grouping similar-sized molecules into a batch cuts + # graphormer padding ~2x (measured 1457 vs 658 rows/s). Independent of dedup. + sort_for_batching=True, + # Cache reuses one featurization across a molecule's collision energies. + feat_cache_size=feat_cache_size, + ) + loader_kwargs = dict( + num_workers=num_workers, + collate_fn=collate_predict, + shuffle=False, + batch_size=kwargs["batch_size"], + ) + if num_workers > 0: + # Fork (not spawn) so workers inherit the already-imported torch/dgl/rdkit/ + # ms_pred stack instead of re-importing it (which costs minutes per pool for + # this model). Safe only because we fork BEFORE the parent touches CUDA and + # the workers are CPU-only. pin_memory is left off so its CUDA-allocating + # thread doesn't initialize CUDA in the parent before the workers fork. + loader_kwargs["multiprocessing_context"] = "fork" + loader_kwargs["prefetch_factor"] = kwargs["prefetch_factor"] + loader_kwargs["persistent_workers"] = False + loader_kwargs["pin_memory"] = False + loader = DataLoader(pred_dataset, **loader_kwargs) + + # Create the iterator (forks the CPU-only workers) BEFORE moving the model to the + # GPU, so CUDA is initialized only in the parent and never inside a forked child. + data_iter = iter(loader) + model = model.to(device) + + no_write = kwargs.get("no_write", False) + staged_out_path, stage_dir = _stage_output_paths( + Path(out_path), kwargs.get("local_write_dir"), device + ) + if stage_dir is not None: + logging.info( + "Shard %s staging HDF5 outputs locally at %s before moving to %s", + device, + stage_dir, + out_path, + ) + + # MassSpec construction + HDF5 writing are pure CPU/IO and, done inline, serialize + # with the GPU forward and starve it. Offload them to a single background thread fed + # by a bounded queue, so writing batch N overlaps the forward of batch N+1. + write_q = queue.Queue(maxsize=8) + writer_error = [] + + def writer_loop(): + specdb = None + try: + if not no_write: + specdb = common.PredSpecDB( + h5_path=staged_out_path, mode="w", num_h5s=kwargs["num_h5_chunks"], + has_probs=False, has_brokens=False, has_masses=True, has_masses_no_adduct=False, + has_frag_form_vecs=False, has_frags=True, has_intens=True, has_pulled_atoms=False, + ) + while True: + recs = write_q.get() + if recs is None: + break + if specdb is not None: + for name, smi, adduct_str, ce, ikey, masses, intens, frag in recs: + specdb.write(name, common.MassSpec( + root_canonical_smiles=smi, adduct=adduct_str, collision_energy=ce, + masses=masses, intens=intens, frags=frag, remark=ikey, + )) + except Exception as e: # surface writer failures instead of dying silently + writer_error.append(e) + # drain remaining items so the producer never blocks on a full queue + while True: + if write_q.get() is None: + break + finally: + if specdb is not None: + specdb.close() + + writer_thread = threading.Thread(target=writer_loop, daemon=True) + writer_thread.start() + + with torch.inference_mode(): + for batch in tqdm(data_iter, total=len(loader), desc=f"{device}"): + batch = _batch_to_device(batch, device) + # Vectorized forward + sparse top-k selection: all GPU work + a few host + # transfers, no per-molecule Python/sync loop on the hot path. + res = model.predict_inten_frag_batch_sparse(batch, sparse_k) + masses, intens, frags, counts = res["masses"], res["intens"], res["frags"], res["counts"] + pred_names = batch["pred_names"] + adduct_strs = batch["adduct_strs"] + ikeys = batch["ikeys"] + ces = batch["ces"] + smis = batch["smis_canon"] + recs = [] + for i in range(len(pred_names)): + c = int(counts[i]) + recs.append(( + pred_names[i], smis[i], adduct_strs[i], ces[i], ikeys[i], + masses[i, :c], intens[i, :c], frags[i, :c], + )) + write_q.put(recs) + if writer_error: + break + write_q.put(None) + writer_thread.join() + if stage_dir is not None and not no_write and not writer_error: + _move_staged_outputs(staged_out_path, Path(out_path), kwargs["num_h5_chunks"]) + shutil.rmtree(stage_dir, ignore_errors=True) + elif stage_dir is not None: + shutil.rmtree(stage_dir, ignore_errors=True) + if writer_error: + raise writer_error[0] + + +def predict(): + args = get_args() + kwargs = args.__dict__ + + save_dir = Path(kwargs["save_dir"]) + save_dir.mkdir(parents=True, exist_ok=True) + debug = kwargs["debug"] + common.setup_logger(save_dir, log_name="joint_pred.log", debug=debug) + + yaml_args = yaml.dump(kwargs) + logging.info(f"\n{yaml_args}") + with open(save_dir / "args.yaml", "w") as fp: + fp.write(yaml_args) + + data_dir = Path("") + if kwargs.get("dataset_name") is not None: + data_dir = Path("data/spec_datasets") / kwargs["dataset_name"] + + labels = Path(kwargs["dataset_labels"]) + df = pd.read_csv(labels, sep="\t") + + if debug: + df = df[:1000] + kwargs["num_cpu_workers"] = 0 + + if kwargs["subset_datasets"] != "none": + splits = pd.read_csv(data_dir / "splits" / kwargs["split_name"], sep="\t") + folds = set(splits.keys()) + folds.remove("spec") + fold_name = list(folds)[0] + if kwargs["subset_datasets"] == "train_only": + names = splits[splits[fold_name] == "train"]["spec"].tolist() + elif kwargs["subset_datasets"] == "test_only": + names = splits[splits[fold_name] == "test"]["spec"].tolist() + elif kwargs["subset_datasets"] == "debug_special": + names = ["CCMSLIB00000001590"] + kwargs["debug"] = True + else: + raise NotImplementedError() + df = df[df["spec"].isin(names)] + + checkpoint = kwargs["checkpoint"] + logging.info(f"Loaded joint models from {checkpoint}") + + gpu = kwargs["gpu"] + avail_gpu_num = torch.cuda.device_count() + use_gpu = gpu and avail_gpu_num > 0 + + # Build flat list of prediction entries (parallel CPU preprocessing). + all_rows = [j for _, j in df.iterrows()] + logging.info("Preparing entries") + predict_entries = _prepare_entries_parallel(all_rows, kwargs["num_cpu_workers"]) + logging.info(f"There are {len(predict_entries)} entries to process") + if len(predict_entries) == 0: + logging.warning("No entries to process; exiting.") + return + + out_name = kwargs["out_name"] + num_shards = kwargs["num_gpu_workers"] if use_gpu else 0 + + if num_shards <= 1: + device = "cuda:0" if use_gpu else "cpu" + run_shard(predict_entries, checkpoint, device, save_dir / out_name, kwargs) + else: + num_shards = min(num_shards, avail_gpu_num) + # Shard by molecule so the per-worker featurization cache stays effective + # (all collision energies of a molecule go to the same shard). + by_mol = OrderedDict() + for e in predict_entries: + by_mol.setdefault(e[0], []).append(e) + mol_lists = list(by_mol.values()) + shards = [[] for _ in range(num_shards)] + # Greedy balance by molecule count. + for i, ml in enumerate(sorted(mol_lists, key=len, reverse=True)): + shards[i % num_shards].extend(ml) + out_stem, out_suffix = os.path.splitext(out_name) + shard_out_paths = [save_dir / f"{out_stem}_shard{r}{out_suffix}" for r in range(num_shards)] + logging.info( + f"Sharding {len(predict_entries)} entries across {num_shards} GPUs: " + f"sizes={[len(s) for s in shards]}" + ) + mp.spawn( + _shard_entrypoint, + args=(shards, checkpoint, shard_out_paths, kwargs), + nprocs=num_shards, + join=True, + ) + + +def _shard_entrypoint(rank, shards, checkpoint, shard_out_paths, kwargs): + """torch.multiprocessing entrypoint for one GPU shard.""" + device = f"cuda:{rank}" + common.setup_logger( + Path(kwargs["save_dir"]), log_name=f"joint_pred_shard{rank}.log", debug=kwargs["debug"] + ) + run_shard(shards[rank], checkpoint, device, shard_out_paths[rank], kwargs) + + +if __name__ == "__main__": + import time + + start_time = time.time() + predict() + end_time = time.time() + logging.info(f"Program finished in: {end_time - start_time} seconds") diff --git a/shared/package-files/74/74cf81949504e90e9f122c0ee94b22b985162ba354f2362aeaa60e4637d26bf1/consensus.py b/shared/package-files/74/74cf81949504e90e9f122c0ee94b22b985162ba354f2362aeaa60e4637d26bf1/consensus.py new file mode 100644 index 0000000000000000000000000000000000000000..d8f74849b70797647143812430267c10dfcdf7bb --- /dev/null +++ b/shared/package-files/74/74cf81949504e90e9f122c0ee94b22b985162ba354f2362aeaa60e4637d26bf1/consensus.py @@ -0,0 +1,166 @@ +"""Cross-pool consensus term: structure evidence transferred between the spectra of one input set. + +The library-neighbour branch (``library.py``) with the input's own spectra as the library and the +package's own current first candidates in place of labels (the idea of "network annotation +propagation" in molecular networking): spectra of different candidate pools that resemble each +other belong to related molecules, so the candidates the fixed model currently ranks first for the +most similar OTHER pools are evidence for the candidates that resemble them. + + similarity(q, B) = max over spectra t of pool B (B != pool of q) of + 0.5 * (fragment cosine(q, t) + neutral-loss cosine(q, t)) + answers(B) = the first ``answers`` candidates b of pool B under the pool mean D_B of the + fused distance, weighted P_B(b) = softmax(-(D_B(b) - min D_B) / temperature) + evidence_B(c) = sum_b P_B(b) * Tanimoto(c, b) - prior(c) + vote_q(c) = sum_B s_B^p * evidence_B(c) / (sum_B s_B^p + absorb^p) + term_q(c) = -vote_q(c) + +The sum runs over the ``k`` most similar pools of the query (plus pools tied with the k-th one among +the ``top`` retrieved). ``prior(c)`` is the mean of ``sum_b P_B(b) Tanimoto(c, b)`` over ALL pools +of the input: what a candidate gets from resembling the input's current answers in general. It is +subtracted so that the term only carries evidence that depends on the query spectrum. ``absorb`` is +the similarity of a virtual neighbour without evidence: a query that has no similar spectrum in the +input gets a vanishing term, so a small or unrelated input leaves the base ranking as it is. + +Spectrum vectors are those of ``library.py`` (peaks at or above precursor - 0.5 Da dropped, square +root intensities, ``bin`` Da bins, L2-normalised rows, query peaks spread to the adjacent bins). + +Nothing is fitted and nothing is stored: the term is a function of the input spectra, the +candidate pools and the fixed model's own distances. It reads no label, no candidate position +(ties between candidates are broken by candidate id, ties between pools are all kept) and no +table of molecules. By construction it depends on the whole input set, like the pool mean. +""" +import time + +import numpy as np + +import library + + +def neighbours(records, pool, top, width, chunk=400): + """Most similar other pools of every spectrum: (pool rows [Q, top], similarities [Q, top]). + + ``pool[i]`` is the pool row (0..P-1, every row used) of spectrum i. The spectrum's own pool has + similarity -1; ties are broken by the lower pool row (stable sort). + """ + pool = np.asarray(pool) + order = np.argsort(pool, kind='stable') + starts = np.flatnonzero(np.diff(pool[order], prepend=-1) != 0) + frag, loss = library.spectrum_vectors([records[i] for i in order], width, spread=False) + frag, loss = frag.T.tocsr(), loss.T.tocsr() + top = min(top, len(starts)) + rows = np.zeros((len(records), top), np.int64) + values = np.zeros((len(records), top), np.float32) + for low in range(0, len(records), chunk): + high = min(len(records), low + chunk) + qf, ql = library.spectrum_vectors(records[low:high], width, spread=True) + sim = 0.5 * (np.asarray((qf @ frag).todense(), dtype=np.float32) + + np.asarray((ql @ loss).todense(), dtype=np.float32)) + per_pool = np.maximum.reduceat(sim, starts, axis=1) + per_pool[np.arange(high - low), pool[low:high]] = -1.0 + best = np.argsort(-per_pool, axis=1, kind='stable')[:, :top] + rows[low:high] = best + values[low:high] = np.take_along_axis(per_pool, best, axis=1) + return rows, values + + +def run(queries, pools, data, distances, options, device, log=None): + """Consensus term per query (candidate order of the pool file); None when a query has no evidence. + + ``data``: candidate store of ``invrun.build_store`` (``pool_id``, ``pool_cand_start``, + ``cand_fps``, ``query_pool``). ``distances``: the fused distance of every query before the pool + mean (None: not scored). + """ + import torch + started = time.monotonic() + k, power = int(options.get('k', 10)), float(options.get('power', 3.0)) + top = max(k, int(options.get('top', 32))) + count, temperature = int(options.get('answers', 5)), float(options.get('temperature', 0.02)) + absorb = float(options.get('absorb', 0.5)) + out = [None] * len(queries) + start = np.asarray(data['pool_cand_start']) + packed = data['cand_fps'] + shifts = torch.arange(7, -1, -1, device=device, dtype=torch.uint8) + + def bits(block): + """Unpack fingerprint bytes [n, bytes] (numpy or tensor) to float32 bits on the device.""" + block = torch.as_tensor(block).to(device) + return ((block[:, :, None] >> shifts) & 1).reshape(len(block), -1).to(torch.float32) + + def tanimoto(a, b): + inter = a @ b.T + return inter / (a.sum(1)[:, None] + b.sum(1)[None, :] - inter).clamp_min(1.0) + + # pools with a current ranking, and their spectra + members = {} + for index, slot in enumerate(data['query_pool']): + if slot >= 0 and distances[index] is not None: + members.setdefault(int(slot), []).append(index) + slots = sorted(members) + if len(slots) < 2: + if log: + log('consensus', scored=0, pools=len(slots), search_seconds=0.0, seconds=time.monotonic() - started) + return out + row_of = {slot: row for row, slot in enumerate(slots)} + + # current answers of every pool: its first candidates under the pool mean of the fused distance + answer_rows, answer_weight, first = [], [], [0] + for slot in slots: + mean = np.mean([distances[i] for i in members[slot]], axis=0) + mean = np.where(np.isfinite(mean), mean, 1.0) + ids = np.asarray([c['candidate_id'] for c in pools[str(data['pool_id'][slot])]]) + order = np.lexsort((ids, mean))[:count] + weight = np.exp(-(mean[order] - mean[order[0]]) / temperature) + answer_rows.append(start[slot] + order) + answer_weight.append(weight / weight.sum()) + first.append(first[-1] + len(order)) + first = np.asarray(first) + answers = torch.from_numpy(np.ascontiguousarray(packed[np.concatenate(answer_rows)])).to(device) + weights = torch.from_numpy(np.concatenate(answer_weight)).to(device) # float64 [answers] + + # spectral neighbours among the other pools of the input + spectra = [i for slot in slots for i in members[slot]] + position = {i: n for n, i in enumerate(spectra)} + records = [(queries[i]['mzs'], queries[i]['intensities'], float(queries[i]['precursor_mz'])) for i in spectra] + spectrum_pool = np.asarray([row_of[slot] for slot in slots for _ in members[slot]]) + tick = time.monotonic() + near, values = neighbours(records, spectrum_pool, top, float(options.get('bin', 0.01)), int(options.get('chunk', 400))) + searched = time.monotonic() - tick + # the k most similar pools vote, together with every pool tied with the k-th one + values = np.maximum(values.astype(np.float64), 0.0) + values = np.where(values >= values[:, min(k, values.shape[1]) - 1][:, None], values, 0.0) ** power + values = np.where(values > 0, values, 0.0) + + step = 16384 + chunks = [(low, min(len(weights), low + step)) for low in range(0, len(weights), step)] + unpacked = [bits(answers[low:high]) for low, high in chunks] if len(weights) <= 8 * step else None + for slot in slots: + rows = [position[i] for i in members[slot]] + cand = bits(packed[start[slot]:start[slot + 1]]) # [candidates, bits] + # what every candidate gets from the current answers of all pools of the input + prior = torch.zeros(len(cand), dtype=torch.float64, device=device) + for n, (low, high) in enumerate(chunks): + block = unpacked[n] if unpacked is not None else bits(answers[low:high]) + prior += tanimoto(cand, block).double() @ weights[low:high] + prior /= len(slots) + weight = values[rows] # [spectra, top] + used = np.unique(near[rows][weight > 0]) + if not len(used): + continue + cols = np.concatenate([np.arange(first[n], first[n + 1]) for n in used]) + owner = np.concatenate([np.full(first[n + 1] - first[n], j) for j, n in enumerate(used)]) + cols_t = torch.from_numpy(cols).to(device) + local = tanimoto(cand, bits(answers[cols_t])).double() * weights[cols_t][None, :] # [candidates, answers] + evidence = torch.zeros(len(used), len(cand), dtype=torch.float64, device=device) + evidence.index_add_(0, torch.from_numpy(owner).to(device), local.T) + evidence -= prior[None, :] + where = np.minimum(np.searchsorted(used, near[rows]), len(used) - 1) # [spectra, top] + scale = torch.from_numpy(weight / (weight.sum(1, keepdims=True) + absorb ** power)).to(device) + vote = torch.einsum('qk,qkc->qc', scale, evidence[torch.from_numpy(where).to(device)]).cpu().numpy() + usable = weight.sum(1) > 0 + for n, index in enumerate(members[slot]): + if usable[n]: + out[index] = -vote[n] + if log: + log('consensus', scored=sum(t is not None for t in out), pools=len(slots), answers=int(len(weights)), + search_seconds=searched, seconds=time.monotonic() - started) + return out diff --git a/shared/package-files/74/74d2f21a7aab1bd3f99e57513444758a98423bb225dd5cc28145fa2fa7a1873c/genstruct-cuts.log b/shared/package-files/74/74d2f21a7aab1bd3f99e57513444758a98423bb225dd5cc28145fa2fa7a1873c/genstruct-cuts.log new file mode 100644 index 0000000000000000000000000000000000000000..472fb32eab1172eb1c59b748f3e1c1be89691a08 --- /dev/null +++ b/shared/package-files/74/74d2f21a7aab1bd3f99e57513444758a98423bb225dd5cc28145fa2fa7a1873c/genstruct-cuts.log @@ -0,0 +1 @@ +{"molecules": 460122, "cuts": 1583002, "molecules_with_cut": 449315, "types": {"1-5": 202821, "4-5": 173035, "8-16": 140123, "3-16": 123348, "5-16": 97075, "3-4": 91865, "6-16": 77588, "5-14": 68572, "1-3": 56431, "8-14": 56157, "14-16": 52094, "8-9": 39640, "8-13": 36397, "8-15": 33005, "6-14": 32368, "5-15": 27321, "3-15": 27065, "5-12": 25833, "6-15": 22429, "16-16": 22332, "4-11": 19201, "9-16": 17743, "11-14": 15189, "3-13": 14889, "3-14": 12136, "13-16": 11994, "8-10": 11198, "14-15": 10877, "14-14": 10538, "15-16": 10265, "6-13": 9284, "10-16": 7487, "9-15": 6163, "11-16": 5217, "9-14": 4101, "13-14": 3683, "10-15": 1800, "9-13": 1770, "10-14": 911, "13-15": 886, "11-15": 824, "5-13": 568, "1-10": 514, "11-13": 241, "10-13": 24}, "seconds": 490.978478315752} diff --git a/shared/package-files/74/74e44bea3034ecfc71ede2d8c673b8261dda9fc403ab110a00688cd5774f7d8a/energy-grid-score-5M-orbi5.log b/shared/package-files/74/74e44bea3034ecfc71ede2d8c673b8261dda9fc403ab110a00688cd5774f7d8a/energy-grid-score-5M-orbi5.log new file mode 100644 index 0000000000000000000000000000000000000000..635fb6112b815b3c94c3e7009a2f3eb5d7cd1b24 --- /dev/null +++ b/shared/package-files/74/74e44bea3034ecfc71ede2d8c673b8261dda9fc403ab110a00688cd5774f7d8a/energy-grid-score-5M-orbi5.log @@ -0,0 +1,12 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 79.25227021798491} +{"event": "planned", "queries": 40345, "groups": 4705, "molecules": 227970, "simulations": 1139850, "seconds": 80.62353446613997} +grid queries 8069, scored at every energy 8069, energies [15.0, 30.0, 45.0, 60.0, 90.0] +stratum sizes: all 19429, Orbitrap no CE [M+H]+ 3987, Orbitrap no CE [M+Na]+ 4082, rest 11360 +pick-mean energy histogram: 15: 0.393, 30: 0.126, 45: 0.115, 60: 0.128, 90: 0.237 +missing per spectrum / pool rule all: 0.5051 / 0.6485 | Orbitrap no CE [M+H]+: 0.2310 / 0.5001 | Orbitrap no CE [M+Na]+: 0.1470 / 0.3704 | rest: 0.7300 / 0.8005 | official diff +0.0000 [+0.0000,+0.0000] macro diff +0.0000 +min per spectrum / pool rule all: 0.5088 / 0.6651 | Orbitrap no CE [M+H]+: 0.2395 / 0.5322 | Orbitrap no CE [M+Na]+: 0.1563 / 0.4194 | rest: 0.7300 / 0.8000 | official diff +0.0166 [-0.0006,+0.0373] macro diff +0.0009 +minwith per spectrum / pool rule all: 0.5085 / 0.6670 | Orbitrap no CE [M+H]+: 0.2388 / 0.5377 | Orbitrap no CE [M+Na]+: 0.1553 / 0.4221 | rest: 0.7300 / 0.8004 | official diff +0.0185 [+0.0005,+0.0393] macro diff +0.0015 +softmin:0.02 per spectrum / pool rule all: 0.5080 / 0.6578 | Orbitrap no CE [M+H]+: 0.2388 / 0.5375 | Orbitrap no CE [M+Na]+: 0.1531 / 0.3809 | rest: 0.7300 / 0.7995 | official diff +0.0093 [-0.0011,+0.0206] macro diff +0.0003 +softminwith:0.02 per spectrum / pool rule all: 0.5075 / 0.6584 | Orbitrap no CE [M+H]+: 0.2365 / 0.5382 | Orbitrap no CE [M+Na]+: 0.1529 / 0.3814 | rest: 0.7300 / 0.8002 | official diff +0.0099 [-0.0002,+0.0212] macro diff +0.0009 +pick-min per spectrum / pool rule all: 0.5088 / 0.6753 | Orbitrap no CE [M+H]+: 0.2395 / 0.5478 | Orbitrap no CE [M+Na]+: 0.1563 / 0.4508 | rest: 0.7300 / 0.8008 | official diff +0.0268 [+0.0092,+0.0509] macro diff +0.0030 +mix:0.5:min per spectrum / pool rule all: 0.5068 / 0.6621 | Orbitrap no CE [M+H]+: 0.2325 / 0.5410 | Orbitrap no CE [M+Na]+: 0.1534 / 0.3951 | rest: 0.7300 / 0.8004 | official diff +0.0135 [+0.0031,+0.0249] macro diff +0.0015 diff --git a/shared/package-files/74/74e62d698406c349f3e2b0105dfb1cd01fe087160ed854fe73c0453585709d43/fullfold-B20k+B30k-I1-50k.report.json b/shared/package-files/74/74e62d698406c349f3e2b0105dfb1cd01fe087160ed854fe73c0453585709d43/fullfold-B20k+B30k-I1-50k.report.json new file mode 100644 index 0000000000000000000000000000000000000000..d8edc2729be0776eec643cd589e18d4c6fb54fc6 --- /dev/null +++ b/shared/package-files/74/74e62d698406c349f3e2b0105dfb1cd01fe087160ed854fe73c0453585709d43/fullfold-B20k+B30k-I1-50k.report.json @@ -0,0 +1,111 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.7264913273971898, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.5124600582059569, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.7264913273971898, + "hit_rate_at_20": 0.9033403674918936, + "hit_rate_at_5": 0.8372021205414586 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.7980533623740811, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.5045387375976357, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.727554019906142, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.18421052631578946, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.9050880626223092, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.8768347160178686, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.7758333333333334, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.9166666666666666, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.5553204992595727, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6790123456790124, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7246791167345945, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.7476038338658147, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.5586384734399175, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.8936716663242243, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.7264913273971898, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.6895280037976432, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.7627717842154468 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/79/794ec3f3fd52b7fdb2ccb0ad4e2befc16e71b8a8d1b5dc9acf671fcdca7c4670/consensus_lab.py b/shared/package-files/79/794ec3f3fd52b7fdb2ccb0ad4e2befc16e71b8a8d1b5dc9acf671fcdca7c4670/consensus_lab.py new file mode 100644 index 0000000000000000000000000000000000000000..6c52ebbeb754603403e686ea5eda7108727ec1c9 --- /dev/null +++ b/shared/package-files/79/794ec3f3fd52b7fdb2ccb0ad4e2befc16e71b8a8d1b5dc9acf671fcdca7c4670/consensus_lab.py @@ -0,0 +1,67 @@ +"""Packaged consensus term (pkg/consensus.py) on saved full-fold branch outputs, against the lab numbers. + +consensus_lab.py --pred evals/fullfold/NAME/pred [--options '{"k": 10, ...}'] [--weights 1/1] [--save FILE] +""" +import argparse +import json +import pickle +import sys +import time +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'analysis')) +sys.path.insert(0, str(HERE.parent / 'pkg')) +import consensus +import netprop +import scorelab + +ROOT = Path('/workspace/research') + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--pred', required=True) + p.add_argument('--config', default='builds/5Ms-I9b+I13-L-ion/model_config.json') + p.add_argument('--options', default='{}') + p.add_argument('--weights', default='1/1') + p.add_argument('--save') + args = p.parse_args() + import torch + queries, pools = netprop.load() + ev = scorelab.Evaluator(queries, pools) + pred = {name: pickle.load(open(ROOT / args.pred / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion')} + base = netprop.released(queries, pools, pred, json.load(open(ROOT / args.config))) + store = np.load(ROOT / 'inv/pools-validation-input.npz') + slot = {pid: n for n, pid in enumerate(store['pool_id'])} + data = {'pool_id': store['pool_id'], 'pool_cand_start': store['pool_cand_start'], 'cand_fps': store['cand_fps'], + 'query_pool': np.array([slot.get(q['candidate_pool_id'], -1) for q in queries], dtype=np.int32)} + started = time.monotonic() + terms = consensus.run(queries, pools, data, base, json.loads(args.options), torch.device('cuda' if torch.cuda.is_available() else 'cpu'), + lambda event, **values: print(event, json.dumps(values))) + print(f'term: {time.monotonic() - started:.1f} s') + first = np.array([rows[0] for rows in ev.by_pool.values()]) if isinstance(ev.by_pool, dict) else None + rank0 = ev.ranks(base, 1.0) + for item in args.weights.split(','): + wd, wo = (float(x) for x in item.split('/')) + fused = [b if (b is None or t is None) else b + (wd if dom else wo) * t for b, t, dom in zip(base, terms, ev.domain)] + rank = ev.ranks(fused, 1.0) + line = f'weights {wd}/{wo}: Hit@1 {np.mean(rank == 0):.4f} ({np.mean(rank == 0) - np.mean(rank0 == 0):+.4f}) Hit@5 {np.mean(rank < 5):.4f} Hit@20 {np.mean(rank < 20):.4f}' + if first is not None: + d = (rank[first] == 0).astype(float) - (rank0[first] == 0).astype(float) + sizes = ev.sizes + big = np.zeros(len(sizes), dtype=bool) + big[np.argsort(-sizes)[:20]] = True + capped = np.minimum(sizes, 30.0) + d5 = (rank[first] < 5).astype(float) - (rank0[first] < 5).astype(float) + line += (f' macro {np.mean(rank[first] == 0):.4f} ({d.mean():+.4f}) pools +{int((d > 0).sum())} -{int((d < 0).sum())}' + f' no top 20 {np.sum(d * sizes * ~big) / np.sum(sizes * ~big):+.4f} cap30 {np.sum(d * capped) / capped.sum():+.4f} macro@5 {d5.mean():+.4f}') + print(line) + if args.save: + pickle.dump({q['query_id']: t for q, t in zip(queries, terms)}, open(ROOT / args.save, 'wb')) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/79/79577548448dbdc58d3ba016e846b757ee7788355fb323e9a422d2eff5737394/e74-full-fwd-o-freq5-100.log b/shared/package-files/79/79577548448dbdc58d3ba016e846b757ee7788355fb323e9a422d2eff5737394/e74-full-fwd-o-freq5-100.log new file mode 100644 index 0000000000000000000000000000000000000000..a5f9391077dfd3c2cbf2bf078b07f6d2e1897a8a --- /dev/null +++ b/shared/package-files/79/79577548448dbdc58d3ba016e846b757ee7788355fb323e9a422d2eff5737394/e74-full-fwd-o-freq5-100.log @@ -0,0 +1,12 @@ +released rule from saved branches: Hit@1 0.7941 pool-macro 0.8662 Hit@5 0.8663 Hit@20 0.9407 | twin pools 354 (macro 0.7712), others macro 0.8773 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4505 (domain 0.4208 / other 0.4804) macro 0.3836 + lam 1.00/1.00: Hit@1 0.8003 (+0.0062 [-0.0575, +0.0502]) macro +0.0180 [+0.0115, +0.0248] pools +98 -37 | no top 20 +0.0249 cap30 +0.0260 [+0.0115, +0.0401] | Hit@5 +0.0218 macro@5 +0.0065 cap30@5 +0.0149 +without consensus term: Hit@1 0.7941 (ref 0.7783; +0.0158 [-0.0290, +0.0788]) macro 0.8662 (-0.0044 [-0.0083, -0.0003]) pools +16 -31 cap30 -0.0031 | Hit@5 0.8663 (-0.0091) Hit@20 0.9407 (+0.0092) + macro Hit@5 0.9330 (-0.0003 [-0.0030, +0.0024]) pools +11 -12 + macro Hit@20 0.9657 (+0.0006 [-0.0015, +0.0027]) pools +7 -5 + domain 0.9369 (-0.0005) other 0.6506 (+0.0322) | Orbitrap no energy 0.6255 (+0.0415) | above 850 0.5477 (+0.0824) below 850 0.8502 (+0.0006) +full rule : Hit@1 0.8003 (ref 0.8173; -0.0170 [-0.0379, +0.0004]) macro 0.8842 (-0.0024 [-0.0059, +0.0012]) pools +15 -23 cap30 -0.0075 | Hit@5 0.8881 (+0.0143) Hit@20 0.9360 (+0.0315) + macro Hit@5 0.9395 (-0.0009 [-0.0035, +0.0021]) pools +9 -12 + macro Hit@20 0.9663 (+0.0003 [-0.0018, +0.0024]) pools +7 -6 + domain 0.9453 (+0.0001) other 0.6547 (-0.0342) | Orbitrap no energy 0.6235 (-0.0383) | above 850 0.4878 (-0.0677) below 850 0.8715 (-0.0055) diff --git a/shared/package-files/79/79c80f9944fd28f66d2cebe3e4f38c144ee4243bf4ace41c57c91912b3ce9802/eval-score-I30-on-plain.log b/shared/package-files/79/79c80f9944fd28f66d2cebe3e4f38c144ee4243bf4ace41c57c91912b3ce9802/eval-score-I30-on-plain.log new file mode 100644 index 0000000000000000000000000000000000000000..680801efcb7197270abd8b6a8082ae96737622c6 --- /dev/null +++ b/shared/package-files/79/79c80f9944fd28f66d2cebe3e4f38c144ee4243bf4ace41c57c91912b3ce9802/eval-score-I30-on-plain.log @@ -0,0 +1,41 @@ +19429 queries, 1 members, 50.6 s +cos pool rule all=0.6007 dom=0.8352 non=0.3652 h5=0.7106 macro=0.7183 +cen pool rule all=0.5870 dom=0.8107 non=0.3624 h5=0.7046 macro=0.6902 +cos_pm pool rule all=0.6007 dom=0.8352 non=0.3652 h5=0.7106 macro=0.7183 +dot pool rule all=0.5808 dom=0.8040 non=0.3567 h5=0.7178 macro=0.7023 +geo pool rule all=0.5874 dom=0.8234 non=0.3504 h5=0.6980 macro=0.7091 +idf05 pool rule all=0.6067 dom=0.8379 non=0.3745 h5=0.7225 macro=0.7230 +idf1 pool rule all=0.6065 dom=0.8359 non=0.3762 h5=0.7343 macro=0.7221 +lin pool rule all=0.5632 dom=0.7957 non=0.3299 h5=0.6848 macro=0.6793 +log01 pool rule all=0.5934 dom=0.8265 non=0.3595 h5=0.7300 macro=0.7132 +log05 pool rule all=0.6085 dom=0.8385 non=0.3775 h5=0.7249 macro=0.7247 +log20 pool rule all=0.6086 dom=0.8412 non=0.3750 h5=0.7209 macro=0.7283 +nll02 pool rule all=0.4521 dom=0.7270 non=0.1760 h5=0.5869 macro=0.5848 +nll10 pool rule all=0.4251 dom=0.6723 non=0.1769 h5=0.5520 macro=0.5387 +poolcen pool rule all=0.5900 dom=0.8110 non=0.3682 h5=0.7000 macro=0.6929 +pow020 pool rule all=0.5636 dom=0.7813 non=0.3450 h5=0.7386 macro=0.6763 +pow030 pool rule all=0.5758 dom=0.8023 non=0.3483 h5=0.7145 macro=0.6931 +pow040 pool rule all=0.5854 dom=0.8186 non=0.3512 h5=0.7223 macro=0.7076 +pow05 pool rule all=0.6020 dom=0.8367 non=0.3665 h5=0.7254 macro=0.7206 +pow05idf025 pool rule all=0.6052 dom=0.8347 non=0.3747 h5=0.7280 macro=0.7203 +pow05idf05 pool rule all=0.6027 dom=0.8389 non=0.3655 h5=0.7302 macro=0.7227 +pow05m pool rule all=0.6020 dom=0.8367 non=0.3665 h5=0.7254 macro=0.7206 +pow05s pool rule all=0.6006 dom=0.8344 non=0.3659 h5=0.7213 macro=0.7194 +pow060 pool rule all=0.6072 dom=0.8400 non=0.3735 h5=0.7221 macro=0.7253 +pow060idf025 pool rule all=0.6092 dom=0.8388 non=0.3788 h5=0.7288 macro=0.7274 +pow060idf050 pool rule all=0.6060 dom=0.8381 non=0.3730 h5=0.7312 macro=0.7247 +pow060m pool rule all=0.6072 dom=0.8400 non=0.3735 h5=0.7221 macro=0.7253 +pow065 pool rule all=0.6058 dom=0.8406 non=0.3702 h5=0.7214 macro=0.7259 +pow070 pool rule all=0.6066 dom=0.8395 non=0.3727 h5=0.7186 macro=0.7250 +pow070idf025 pool rule all=0.6084 dom=0.8408 non=0.3750 h5=0.7256 macro=0.7268 +pow070idf050 pool rule all=0.6123 dom=0.8398 non=0.3839 h5=0.7300 macro=0.7283 +pow070m pool rule all=0.6066 dom=0.8395 non=0.3727 h5=0.7186 macro=0.7250 +pow075 pool rule all=0.6045 dom=0.8377 non=0.3703 h5=0.7171 macro=0.7245 +pow080 pool rule all=0.6044 dom=0.8382 non=0.3696 h5=0.7150 macro=0.7236 +pow080m pool rule all=0.6044 dom=0.8382 non=0.3696 h5=0.7150 macro=0.7236 +pow085 pool rule all=0.6045 dom=0.8371 non=0.3710 h5=0.7129 macro=0.7227 +pow085idf025 pool rule all=0.6041 dom=0.8381 non=0.3693 h5=0.7229 macro=0.7242 +pow085idf050 pool rule all=0.6070 dom=0.8391 non=0.3740 h5=0.7316 macro=0.7253 +pow090 pool rule all=0.6044 dom=0.8369 non=0.3710 h5=0.7140 macro=0.7221 +pow2 pool rule all=0.5726 dom=0.8073 non=0.3371 h5=0.6862 macro=0.6940 +tani pool rule all=0.5734 dom=0.8059 non=0.3399 h5=0.7095 macro=0.6955 diff --git a/shared/package-files/79/79d88183b562cf0bf3e106ae070f7eb31c438e82d9f3b6c222aaf13fc07f2d1f/library-reverse-small-top_20_4.log b/shared/package-files/79/79d88183b562cf0bf3e106ae070f7eb31c438e82d9f3b6c222aaf13fc07f2d1f/library-reverse-small-top_20_4.log new file mode 100644 index 0000000000000000000000000000000000000000..23da48f2a811f0b5f91f47c0f64a9bb2684ef574 --- /dev/null +++ b/shared/package-files/79/79d88183b562cf0bf3e106ae070f7eb31c438e82d9f3b6c222aaf13fc07f2d1f/library-reverse-small-top_20_4.log @@ -0,0 +1,10 @@ +base (released rule without consensus): Hit@1 0.7685 domain 0.9301 other 0.6062 macro 0.8650 +top_20_4 alone per spectrum 0.2263 (0.2358 / 0.2167) pool mean 0.3162 (0.2853 / 0.3472) macro 0.2590 + other w 0.05 (x0.05/sd): Hit@1 0.7585 (-0.0100 [-0.0295, +0.0021]) macro 0.8641 (-0.0009 [-0.0027, +0.0009]) pools +4 -7 | domain 0.9296 other 0.5866 Hit@5 0.8822 + other w 0.10 (x0.05/sd): Hit@1 0.7528 (-0.0157 [-0.0361, -0.0002]) macro 0.8624 (-0.0027 [-0.0056, +0.0003]) pools +9 -18 | domain 0.9296 other 0.5752 Hit@5 0.8817 + other w 0.20 (x0.05/sd): Hit@1 0.7486 (-0.0199 [-0.0415, -0.0015]) macro 0.8609 (-0.0041 [-0.0080, +0.0000]) pools +20 -34 | domain 0.9299 other 0.5666 Hit@5 0.8845 + other w 0.30 (x0.05/sd): Hit@1 0.7456 (-0.0229 [-0.0450, -0.0034]) macro 0.8591 (-0.0059 [-0.0103, -0.0009]) pools +24 -44 | domain 0.9296 other 0.5608 Hit@5 0.8936 + all w 0.05 (x0.05/sd): Hit@1 0.7594 (-0.0091 [-0.0289, +0.0029]) macro 0.8647 (-0.0003 [-0.0027, +0.0021]) pools +8 -9 | domain 0.9316 other 0.5865 Hit@5 0.8822 + all w 0.10 (x0.05/sd): Hit@1 0.7539 (-0.0146 [-0.0355, +0.0011]) macro 0.8618 (-0.0032 [-0.0071, +0.0006]) pools +16 -27 | domain 0.9319 other 0.5751 Hit@5 0.8819 + all w 0.20 (x0.05/sd): Hit@1 0.7477 (-0.0207 [-0.0433, -0.0022]) macro 0.8603 (-0.0047 [-0.0095, +0.0003]) pools +31 -47 | domain 0.9294 other 0.5653 Hit@5 0.8870 + all w 0.30 (x0.05/sd): Hit@1 0.7447 (-0.0238 [-0.0465, -0.0038]) macro 0.8574 (-0.0077 [-0.0136, -0.0018]) pools +41 -67 | domain 0.9284 other 0.5602 Hit@5 0.8930 diff --git a/shared/package-files/79/79d9896b58164e93d18c0f98cbbd1792eebb608a56d4368648681c35cf9641b6/replay-4Mp-I1+I3x2-val-tiny.log b/shared/package-files/79/79d9896b58164e93d18c0f98cbbd1792eebb608a56d4368648681c35cf9641b6/replay-4Mp-I1+I3x2-val-tiny.log new file mode 100644 index 0000000000000000000000000000000000000000..ac1c5f23715b4b5c2870db2e7b52d3057193923f --- /dev/null +++ b/shared/package-files/79/79d9896b58164e93d18c0f98cbbd1792eebb608a56d4368648681c35cf9641b6/replay-4Mp-I1+I3x2-val-tiny.log @@ -0,0 +1,12 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 4, "inverse_members": 3, "workers": 7} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.9997027500066906} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 2.033989051997196} +{"event": "inverse_annotated", "pools": 40, "pairs": 9390, "formulae": 1921, "unsupported_candidates": 75, "seconds": 1.8115352370077744} +{"event": "inverse", "scored": 180, "seconds": 3.9724518440052634} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 90.89554880101059} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 0.6539340950112091, "total_seconds": 114.08863453000959} +{"event": "measured", "exit_code": 0, "wall_seconds": 116.5, "user_seconds": 250.8, "system_seconds": 9.9, "max_rss_gib": 2.33} +{"event": "replay_checked", "exit_code": 0, "package_files": 223, "package_unchanged": true, "processes_left": 0, "rankings": 180} +{"event": "compared_with_full_fold_saved_simulations", "queries": 180, "top1_equal": 180, "top5_equal": 179} diff --git a/shared/package-files/79/79df8e94ed2953da21aba96121e4b52493330500bde77c56db3cc3c5f89fdf46/measure.py b/shared/package-files/79/79df8e94ed2953da21aba96121e4b52493330500bde77c56db3cc3c5f89fdf46/measure.py new file mode 100644 index 0000000000000000000000000000000000000000..8aebfa9e68bf6e881ab1a672d6683273ae69a2aa --- /dev/null +++ b/shared/package-files/79/79df8e94ed2953da21aba96121e4b52493330500bde77c56db3cc3c5f89fdf46/measure.py @@ -0,0 +1,17 @@ +"""Run a command; report wall time and the peak resident memory of its process tree. + +measure.py COMMAND [ARG...] (GNU time is not installed in this environment) +""" +import json +import resource +import subprocess +import sys +import time + +tick = time.monotonic() +code = subprocess.call(sys.argv[1:]) +usage = resource.getrusage(resource.RUSAGE_CHILDREN) +print(json.dumps(dict(event='measured', exit_code=code, wall_seconds=round(time.monotonic() - tick, 1), + user_seconds=round(usage.ru_utime, 1), system_seconds=round(usage.ru_stime, 1), + max_rss_gib=round(usage.ru_maxrss / 1024 ** 2, 2))), file=sys.stderr) +sys.exit(code) diff --git a/shared/package-files/7b/7b00b578b0c2d0ea7f2261c741fba7c85c77d30df618d203a119c55c2c72b042/fused-I5h-30k.log b/shared/package-files/7b/7b00b578b0c2d0ea7f2261c741fba7c85c77d30df618d203a119c55c2c72b042/fused-I5h-30k.log new file mode 100644 index 0000000000000000000000000000000000000000..1c9dc519cc8a2b26d2662b2d32001e50dbc8420a --- /dev/null +++ b/shared/package-files/7b/7b00b578b0c2d0ea7f2261c741fba7c85c77d30df618d203a119c55c2c72b042/fused-I5h-30k.log @@ -0,0 +1,56 @@ +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 | diff=+0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] + pools +0 -0 | macro 0.8379 +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +I3-30k all=0.7454 dom=0.9047 non=0.5856 h5=0.8747 h20=0.9315 | diff=-0.0027 [-0.0106,+0.0044] | ind 0.6004 -0.0008 [-0.0031,+0.0018] + pools +18 -30 | macro 0.8343 -0.0035 [-0.0074,+0.0003] | without top 20 -0.0030 [-0.0116,+0.0049] | weight min(n,30) -0.0025 [-0.0103,+0.0049] +--- I3-30k: pool-rule Hit@1 by stratum and precursor m/z (variant / reference / difference in points of the official metric) + domain [ 0, 400) n 3886 pools 969 | 0.940 / 0.941 / -0.0002 | top-5 0.975 / 0.976 | inverse alone 0.700 + domain [ 400, 500) n 3468 pools 914 | 0.922 / 0.931 / -0.0015 | top-5 0.975 / 0.980 | inverse alone 0.717 + domain [ 500, 600) n 1394 pools 304 | 0.925 / 0.930 / -0.0004 | top-5 0.986 / 0.988 | inverse alone 0.759 + domain [ 600, 700) n 303 pools 80 | 0.924 / 0.924 / +0.0000 | top-5 1.000 / 1.000 | inverse alone 0.822 + domain [ 700, 850) n 291 pools 58 | 0.729 / 0.715 / +0.0002 | top-5 0.921 / 0.893 | inverse alone 0.509 + domain [ 850,1001) n 392 pools 82 | 0.444 / 0.454 / -0.0002 | top-5 0.584 / 0.592 | inverse alone 0.416 + no CE [M+H]+ [ 0, 400) n 568 pools 172 | 0.820 / 0.820 / +0.0000 | top-5 0.886 / 0.891 | inverse alone 0.489 + no CE [M+H]+ [ 400, 500) n 944 pools 286 | 0.658 / 0.694 / -0.0017 | top-5 0.860 / 0.861 | inverse alone 0.390 + no CE [M+H]+ [ 500, 600) n 852 pools 231 | 0.762 / 0.736 / +0.0011 | top-5 0.933 / 0.912 | inverse alone 0.440 + no CE [M+H]+ [ 600, 700) n 312 pools 75 | 0.776 / 0.753 / +0.0004 | top-5 0.952 / 0.936 | inverse alone 0.253 + no CE [M+H]+ [ 700, 850) n 1046 pools 146 | 0.677 / 0.674 / +0.0002 | top-5 0.789 / 0.797 | inverse alone 0.363 + no CE [M+H]+ [ 850,1001) n 1236 pools 125 | 0.367 / 0.380 / -0.0009 | top-5 0.624 / 0.624 | inverse alone 0.317 + no CE [M+Na]+ [ 0, 400) n 148 pools 31 | 0.601 / 0.601 / +0.0000 | top-5 0.615 / 0.628 | inverse alone 0.182 + no CE [M+Na]+ [ 400, 500) n 426 pools 99 | 0.606 / 0.608 / -0.0001 | top-5 0.805 / 0.800 | inverse alone 0.333 + no CE [M+Na]+ [ 500, 600) n 706 pools 135 | 0.633 / 0.629 / +0.0002 | top-5 0.868 / 0.841 | inverse alone 0.370 + no CE [M+Na]+ [ 600, 700) n 313 pools 69 | 0.585 / 0.585 / +0.0000 | top-5 0.773 / 0.757 | inverse alone 0.144 + no CE [M+Na]+ [ 700, 850) n 947 pools 109 | 0.623 / 0.611 / +0.0006 | top-5 0.771 / 0.775 | inverse alone 0.270 + no CE [M+Na]+ [ 850,1001) n 1956 pools 148 | 0.407 / 0.412 / -0.0004 | top-5 0.721 / 0.725 | inverse alone 0.216 + rest [ 0, 400) n 24 pools 14 | 0.667 / 0.667 / +0.0000 | top-5 0.750 / 0.792 | inverse alone 0.208 + rest [ 400, 500) n 23 pools 10 | 0.565 / 0.565 / +0.0000 | top-5 0.783 / 0.783 | inverse alone 0.174 + rest [ 500, 600) n 84 pools 31 | 0.774 / 0.786 / -0.0001 | top-5 0.988 / 0.988 | inverse alone 0.429 + rest [ 600, 700) n 27 pools 10 | 0.852 / 0.852 / +0.0000 | top-5 0.963 / 0.963 | inverse alone 0.259 + rest [ 700, 850) n 63 pools 18 | 0.651 / 0.651 / +0.0000 | top-5 0.937 / 0.810 | inverse alone 0.476 + rest [ 850,1001) n 20 pools 9 | 0.800 / 0.600 / +0.0002 | top-5 0.800 / 0.800 | inverse alone 0.150 +I5h-30k all=0.7413 dom=0.9025 non=0.5794 h5=0.8715 h20=0.9290 | diff=-0.0068 [-0.0180,+0.0031] | ind 0.5956 -0.0057 [-0.0107,-0.0007] + pools +48 -57 | macro 0.8352 -0.0027 [-0.0086,+0.0035] | without top 20 -0.0077 [-0.0205,+0.0040] | weight min(n,30) -0.0059 [-0.0167,+0.0041] +--- I5h-30k: pool-rule Hit@1 by stratum and precursor m/z (variant / reference / difference in points of the official metric) + domain [ 0, 400) n 3886 pools 969 | 0.924 / 0.941 / -0.0033 | top-5 0.972 / 0.976 | inverse alone 0.591 + domain [ 400, 500) n 3468 pools 914 | 0.925 / 0.931 / -0.0010 | top-5 0.975 / 0.980 | inverse alone 0.672 + domain [ 500, 600) n 1394 pools 304 | 0.931 / 0.930 / +0.0001 | top-5 0.996 / 0.988 | inverse alone 0.736 + domain [ 600, 700) n 303 pools 80 | 0.924 / 0.924 / +0.0000 | top-5 1.000 / 1.000 | inverse alone 0.802 + domain [ 700, 850) n 291 pools 58 | 0.725 / 0.715 / +0.0002 | top-5 0.869 / 0.893 | inverse alone 0.498 + domain [ 850,1001) n 392 pools 82 | 0.503 / 0.454 / +0.0010 | top-5 0.628 / 0.592 | inverse alone 0.454 + no CE [M+H]+ [ 0, 400) n 568 pools 172 | 0.820 / 0.820 / +0.0000 | top-5 0.889 / 0.891 | inverse alone 0.408 + no CE [M+H]+ [ 400, 500) n 944 pools 286 | 0.698 / 0.694 / +0.0002 | top-5 0.865 / 0.861 | inverse alone 0.387 + no CE [M+H]+ [ 500, 600) n 852 pools 231 | 0.738 / 0.736 / +0.0001 | top-5 0.914 / 0.912 | inverse alone 0.427 + no CE [M+H]+ [ 600, 700) n 312 pools 75 | 0.769 / 0.753 / +0.0003 | top-5 0.946 / 0.936 | inverse alone 0.260 + no CE [M+H]+ [ 700, 850) n 1046 pools 146 | 0.653 / 0.674 / -0.0011 | top-5 0.789 / 0.797 | inverse alone 0.250 + no CE [M+H]+ [ 850,1001) n 1236 pools 125 | 0.366 / 0.380 / -0.0009 | top-5 0.606 / 0.624 | inverse alone 0.201 + no CE [M+Na]+ [ 0, 400) n 148 pools 31 | 0.601 / 0.601 / +0.0000 | top-5 0.601 / 0.628 | inverse alone 0.162 + no CE [M+Na]+ [ 400, 500) n 426 pools 99 | 0.606 / 0.608 / -0.0001 | top-5 0.800 / 0.800 | inverse alone 0.293 + no CE [M+Na]+ [ 500, 600) n 706 pools 135 | 0.579 / 0.629 / -0.0018 | top-5 0.848 / 0.841 | inverse alone 0.312 + no CE [M+Na]+ [ 600, 700) n 313 pools 69 | 0.604 / 0.585 / +0.0003 | top-5 0.773 / 0.757 | inverse alone 0.220 + no CE [M+Na]+ [ 700, 850) n 947 pools 109 | 0.638 / 0.611 / +0.0013 | top-5 0.787 / 0.775 | inverse alone 0.218 + no CE [M+Na]+ [ 850,1001) n 1956 pools 148 | 0.396 / 0.412 / -0.0016 | top-5 0.707 / 0.725 | inverse alone 0.137 + rest [ 0, 400) n 24 pools 14 | 0.667 / 0.667 / +0.0000 | top-5 0.750 / 0.792 | inverse alone 0.292 + rest [ 400, 500) n 23 pools 10 | 0.565 / 0.565 / +0.0000 | top-5 0.783 / 0.783 | inverse alone 0.174 + rest [ 500, 600) n 84 pools 31 | 0.762 / 0.786 / -0.0001 | top-5 0.988 / 0.988 | inverse alone 0.310 + rest [ 600, 700) n 27 pools 10 | 0.852 / 0.852 / +0.0000 | top-5 0.963 / 0.963 | inverse alone 0.148 + rest [ 700, 850) n 63 pools 18 | 0.587 / 0.651 / -0.0002 | top-5 0.825 / 0.810 | inverse alone 0.397 + rest [ 850,1001) n 20 pools 9 | 0.600 / 0.600 / +0.0000 | top-5 0.800 / 0.800 | inverse alone 0.150 diff --git a/shared/package-files/7b/7b388ef14c549ad46442da12f15d8741a16f11506532f95d6f8667fa2cd8b4d3/train-queue.txt b/shared/package-files/7b/7b388ef14c549ad46442da12f15d8741a16f11506532f95d6f8667fa2cd8b4d3/train-queue.txt new file mode 100644 index 0000000000000000000000000000000000000000..b76fbbd5f4d03efe675cf00df8944eaa555921d9 --- /dev/null +++ b/shared/package-files/7b/7b388ef14c549ad46442da12f15d8741a16f11506532f95d6f8667fa2cd8b4d3/train-queue.txt @@ -0,0 +1,3 @@ +I30-ff512x6-real08-corpus2+train3-noise05-merge05 --steps 50000 --seed 1 --noise-rate 0.5 --noise-max 12 --noise-shape 3 --merge-rate 0.5 --merge-max 8 +I31-ff512x6-real08-corpus2+train3-noise05-p48 --steps 50000 --seed 1 --noise-rate 0.5 --noise-max 12 --noise-shape 3 --store inv/p48 --extra-store inv/p48/corpus2+train3.npz --max-peaks 48 +I32-ff512x6-real08-corpus2+train3-noise05-real48-sim24 --steps 50000 --seed 1 --noise-rate 0.5 --noise-max 12 --noise-shape 3 --store inv/p48 --extra-store inv/p48/corpus2+train3.npz --max-peaks 48 --sim-max-peaks 24 diff --git a/shared/package-files/7b/7b58a139f5e68ed402e51c594f7cf6227c5ca0b7b8835b87c960c9e2e3e26aa7/fp_families.py b/shared/package-files/7b/7b58a139f5e68ed402e51c594f7cf6227c5ca0b7b8835b87c960c9e2e3e26aa7/fp_families.py new file mode 100644 index 0000000000000000000000000000000000000000..3e3e4a2033c347a40b2dbde87e4d9a4cd4a15b85 --- /dev/null +++ b/shared/package-files/7b/7b58a139f5e68ed402e51c594f7cf6227c5ca0b7b8835b87c960c9e2e3e26aa7/fp_families.py @@ -0,0 +1,123 @@ +"""Which structure fingerprints separate the candidates that the released model confuses? + +fp_families.py RANKINGS.jsonl [--workers 6] + +Analysis only (validation labels pick the confused pairs; nothing is fitted). For every +validation pool whose released top-1 is wrong, the labelled candidate and the wrong top-1 are +described with several RDKit fingerprint families; reported per family: cost per molecule, +bits set, Tanimoto similarity of the confused pair (lower = the family separates the pair +better), share of identical pairs, and the correlation with the Morgan similarity. +""" +import argparse +import json +import multiprocessing +import time +from pathlib import Path + +import numpy as np + +ROOT = Path('/workspace/research/validation-input') +BITS = 4096 + + +def generators(): + from rdkit.Chem import rdFingerprintGenerator as G + return { + 'morgan2': G.GetMorganGenerator(radius=2, fpSize=BITS), + 'morgan3': G.GetMorganGenerator(radius=3, fpSize=BITS), + 'morgan1': G.GetMorganGenerator(radius=1, fpSize=BITS), + 'fmorgan2': G.GetMorganGenerator(radius=2, fpSize=BITS, atomInvariantsGenerator=G.GetMorganFeatureAtomInvGen()), + 'atompair': G.GetAtomPairGenerator(fpSize=BITS), + 'torsion': G.GetTopologicalTorsionGenerator(fpSize=BITS), + 'rdkit5': G.GetRDKitFPGenerator(maxPath=5, fpSize=BITS), + 'rdkit7': G.GetRDKitFPGenerator(maxPath=7, fpSize=BITS), + } + + +def describe(pairs): + from rdkit import Chem, RDLogger + from rdkit.Chem import MACCSkeys + RDLogger.DisableLog('rdApp.*') + gens = generators() + names = list(gens) + ['maccs'] + sim = np.zeros((len(pairs), len(names))) + bits = np.zeros((len(pairs), len(names))) + cost = np.zeros(len(names)) + for n, (a, b) in enumerate(pairs): + ma, mb = Chem.MolFromSmiles(a), Chem.MolFromSmiles(b) + for k, name in enumerate(names): + t = time.perf_counter() + if name == 'maccs': + fa = np.array(list(MACCSkeys.GenMACCSKeys(ma)), dtype=bool) + fb = np.array(list(MACCSkeys.GenMACCSKeys(mb)), dtype=bool) + else: + fa = gens[name].GetFingerprintAsNumPy(ma).astype(bool) + fb = gens[name].GetFingerprintAsNumPy(mb).astype(bool) + cost[k] += time.perf_counter() - t + union = (fa | fb).sum() + sim[n, k] = (fa & fb).sum() / union if union else 1.0 + bits[n, k] = fa.sum() + return names, sim, bits, cost + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('rankings') + p.add_argument('--workers', type=int, default=6) + args = p.parse_args() + queries = [json.loads(line) for line in open(ROOT / 'queries.jsonl')] + pools = {} + for line in open(ROOT / 'candidate_pools.jsonl'): + row = json.loads(line) + pools[row['candidate_pool_id']] = row['candidates'] + target = np.load('/workspace/research/inv/targets-validation-input.npy') + top = {} + for line in open(args.rankings): + row = json.loads(line) + top[row['query_id']] = row['ranking'][0] + from rdkit import Chem + from rdkit.Chem.rdMolDescriptors import CalcMolFormula + seen, pairs, meta = set(), [], [] + size = {} + for q in queries: + size[q['candidate_pool_id']] = size.get(q['candidate_pool_id'], 0) + 1 + for i, q in enumerate(queries): + pid = q['candidate_pool_id'] + if pid in seen: + continue + seen.add(pid) + cands = pools[pid] + t = cands[int(target[i])] + if top[q['query_id']] == t['candidate_id']: + continue + wrong = next(c for c in cands if c['candidate_id'] == top[q['query_id']]) + same = CalcMolFormula(Chem.MolFromSmiles(t['smiles'])) == CalcMolFormula(Chem.MolFromSmiles(wrong['smiles'])) + domain = q['adduct'] == '[M+H]+' and q.get('collision_energy') is not None + pairs.append((t['smiles'], wrong['smiles'])) + meta.append((size[pid], same, domain)) + meta = np.array(meta, dtype=float) + chunks = [pairs[i::args.workers] for i in range(args.workers)] + with multiprocessing.Pool(args.workers) as pool: + parts = pool.map(describe, chunks) + names = parts[0][0] + sim = np.zeros((len(pairs), len(names))) + bits = np.zeros((len(pairs), len(names))) + for k, part in enumerate(parts): + sim[k::args.workers], bits[k::args.workers] = part[1], part[2] + cost = sum(part[3] for part in parts) / (2 * len(pairs)) * 1e3 + weight, same, domain = meta[:, 0], meta[:, 1] == 1, meta[:, 2] == 1 + print(f'missed pools {len(pairs)} ({weight.sum():.0f} queries); same formula {same.sum()} pools / {weight[same].sum():.0f} queries; ' + f'first spectrum in domain {domain.sum()} pools') + for label, mask in (('all missed pools', np.ones(len(pairs), bool)), ('same-formula misses', same), + ('same-formula misses, domain', same & domain), ('other-formula misses', ~same)): + print(f'--- {label}: {mask.sum()} pools, {weight[mask].sum():.0f} queries (pool-weighted statistics)') + for k, name in enumerate(names): + s = sim[mask, k] + corr = np.corrcoef(s, sim[mask, 0])[0, 1] if mask.sum() > 2 else float('nan') + print(f' {name:9s} ms/mol {cost[k]:.3f} bits {bits[mask, k].mean():6.1f} | Tanimoto(label, wrong top-1) mean {s.mean():.3f} ' + f'median {np.median(s):.3f} | identical {np.mean(s == 1):.3f} | >0.8 {np.mean(s > 0.8):.3f} | <0.5 {np.mean(s < 0.5):.3f} ' + f'| corr with morgan2 {corr:.2f}') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/7b/7b653dc1af94b943dced392eddf0cc29522acf251b9cd9a44efcff8d634e4f89/eval-score-N5-recur-hyb-s10-f5-p48.log b/shared/package-files/7b/7b653dc1af94b943dced392eddf0cc29522acf251b9cd9a44efcff8d634e4f89/eval-score-N5-recur-hyb-s10-f5-p48.log new file mode 100644 index 0000000000000000000000000000000000000000..8828bdd4ad657458e814d4014453dbeef1601b39 --- /dev/null +++ b/shared/package-files/7b/7b653dc1af94b943dced392eddf0cc29522acf251b9cd9a44efcff8d634e4f89/eval-score-N5-recur-hyb-s10-f5-p48.log @@ -0,0 +1,41 @@ +19429 queries, 5 members, 161.9 s +cos pool rule all=0.6441 dom=0.8545 non=0.4328 h5=0.7546 macro=0.7472 +cen pool rule all=0.6380 dom=0.8347 non=0.4404 h5=0.7545 macro=0.7253 +cos_pm pool rule all=0.6591 dom=0.8558 non=0.4616 h5=0.7594 macro=0.7504 +dot pool rule all=0.6729 dom=0.8408 non=0.5044 h5=0.7833 macro=0.7428 +geo pool rule all=0.6394 dom=0.8463 non=0.4316 h5=0.7497 macro=0.7395 +idf05 pool rule all=0.6608 dom=0.8617 non=0.4590 h5=0.7664 macro=0.7555 +idf1 pool rule all=0.6847 dom=0.8581 non=0.5107 h5=0.7980 macro=0.7525 +lin pool rule all=0.6218 dom=0.8211 non=0.4216 h5=0.7356 macro=0.7106 +log01 pool rule all=0.6729 dom=0.8615 non=0.4834 h5=0.7917 macro=0.7469 +log05 pool rule all=0.6824 dom=0.8650 non=0.4990 h5=0.7995 macro=0.7552 +log20 pool rule all=0.6857 dom=0.8623 non=0.5083 h5=0.7891 macro=0.7566 +nll02 pool rule all=0.5060 dom=0.7519 non=0.2592 h5=0.6510 macro=0.6152 +nll10 pool rule all=0.4746 dom=0.7103 non=0.2380 h5=0.6146 macro=0.5715 +poolcen pool rule all=0.6700 dom=0.8282 non=0.5111 h5=0.8001 macro=0.7242 +pow020 pool rule all=0.6341 dom=0.8406 non=0.4267 h5=0.7739 macro=0.7307 +pow030 pool rule all=0.6684 dom=0.8546 non=0.4815 h5=0.7807 macro=0.7372 +pow040 pool rule all=0.6681 dom=0.8564 non=0.4790 h5=0.7894 macro=0.7460 +pow05 pool rule all=0.6791 dom=0.8576 non=0.4998 h5=0.7981 macro=0.7510 +pow05idf025 pool rule all=0.6818 dom=0.8648 non=0.4981 h5=0.8003 macro=0.7561 +pow05idf05 pool rule all=0.6845 dom=0.8670 non=0.5014 h5=0.8027 macro=0.7578 +pow05m pool rule all=0.6768 dom=0.8576 non=0.4953 h5=0.7958 macro=0.7493 +pow05s pool rule all=0.6789 dom=0.8585 non=0.4986 h5=0.7972 macro=0.7501 +pow060 pool rule all=0.6854 dom=0.8613 non=0.5088 h5=0.7959 macro=0.7561 +pow060idf025 pool rule all=0.6899 dom=0.8625 non=0.5166 h5=0.7994 macro=0.7599 +pow060idf050 pool rule all=0.6892 dom=0.8647 non=0.5130 h5=0.8016 macro=0.7599 +pow060m pool rule all=0.6769 dom=0.8596 non=0.4935 h5=0.7921 macro=0.7516 +pow065 pool rule all=0.6861 dom=0.8604 non=0.5111 h5=0.7923 macro=0.7552 +pow070 pool rule all=0.6890 dom=0.8606 non=0.5167 h5=0.7922 macro=0.7552 +pow070idf025 pool rule all=0.6895 dom=0.8657 non=0.5125 h5=0.7947 macro=0.7584 +pow070idf050 pool rule all=0.6892 dom=0.8656 non=0.5121 h5=0.8001 macro=0.7578 +pow070m pool rule all=0.6808 dom=0.8610 non=0.4998 h5=0.7871 macro=0.7528 +pow075 pool rule all=0.6887 dom=0.8613 non=0.5153 h5=0.7905 macro=0.7561 +pow080 pool rule all=0.6891 dom=0.8609 non=0.5167 h5=0.7932 macro=0.7555 +pow080m pool rule all=0.6787 dom=0.8591 non=0.4976 h5=0.7881 macro=0.7522 +pow085 pool rule all=0.6571 dom=0.8584 non=0.4549 h5=0.7647 macro=0.7534 +pow085idf025 pool rule all=0.6871 dom=0.8625 non=0.5110 h5=0.7955 macro=0.7558 +pow085idf050 pool rule all=0.6875 dom=0.8634 non=0.5110 h5=0.7998 macro=0.7561 +pow090 pool rule all=0.6561 dom=0.8592 non=0.4523 h5=0.7619 macro=0.7543 +pow2 pool rule all=0.6230 dom=0.8248 non=0.4204 h5=0.7470 macro=0.7203 +tani pool rule all=0.6277 dom=0.8384 non=0.4161 h5=0.7565 macro=0.7333 diff --git a/shared/package-files/7b/7b940eaf2b6251a1fa57220170859dab716eb75b0ac59f23a5daa56368a267c4/netprop_final2.sh b/shared/package-files/7b/7b940eaf2b6251a1fa57220170859dab716eb75b0ac59f23a5daa56368a267c4/netprop_final2.sh new file mode 100644 index 0000000000000000000000000000000000000000..0ea826e52fa048c6d745d15cb821914ba8b418c1 --- /dev/null +++ b/shared/package-files/7b/7b940eaf2b6251a1fa57220170859dab716eb75b0ac59f23a5daa56368a267c4/netprop_final2.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# E65: controls and shard behaviour of the cross-pool consensus term at the released setting (answers = 10) +cd /workspace/research +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps OMP_NUM_THREADS=2 +PY=/opt/glacier/bin/python +V=10:3:half=0.5 +A="--pred evals/fullfold/5Ms-I9b+I13-L-ion/pred --brief --m 10 --tau 0.02 --variants $V --lams 1/1" +N="--neigh evals/netprop/neigh-val.npz" +taskset -c 0-1 $PY allcond/analysis/netprop.py evaluate $A $N --shuffle 1 > logs/netprop-released-shuffle.log 2>&1 & +taskset -c 2-3 $PY allcond/analysis/netprop.py evaluate $A $N --control random-candidate > logs/netprop-released-randcand.log 2>&1 & +taskset -c 4-5 $PY allcond/analysis/netprop.py evaluate $A $N --shuffle 2 > logs/netprop-released-shuffle2.log 2>&1 & +for spec in 0.5:1 0.25:1 0.25:2 0.1:1 0.1:2 0.03:1 0.03:2; do + tag=$(echo $spec | tr ':.' '-_') + [ -f evals/netprop/neigh-sub-$tag.npz ] || taskset -c 6-7 $PY allcond/analysis/netprop.py search --out evals/netprop/neigh-sub-$tag.npz --pools $spec > logs/netprop-search-$tag.log 2>&1 + taskset -c 6-7 $PY allcond/analysis/netprop.py evaluate $A --neigh evals/netprop/neigh-sub-$tag.npz --pools $spec > logs/netprop-released-sub-$tag.log 2>&1 +done +wait +echo done > logs/netprop-released.done diff --git a/shared/package-files/7b/7bcbdc24da67282ee1fe76b19026a8e66d797a2bb4e059d8d39ffd6635e32ddd/norm-fusion-meqq.log b/shared/package-files/7b/7bcbdc24da67282ee1fe76b19026a8e66d797a2bb4e059d8d39ffd6635e32ddd/norm-fusion-meqq.log new file mode 100644 index 0000000000000000000000000000000000000000..ccfcd6e63e864dd7c686371fda42aa1688a3a7c2 --- /dev/null +++ b/shared/package-files/7b/7bcbdc24da67282ee1fe76b19026a8e66d797a2bb4e059d8d39ffd6635e32ddd/norm-fusion-meqq.log @@ -0,0 +1,33 @@ +released all=0.7384 dom=0.9007 non=0.5755 h5=0.8418 h20=0.9104 macro=0.8210 +zscore wd=2.0 wn=0.5 all=0.7190 dom=0.8989 non=0.5384 h5=0.8305 h20=0.9020 macro=0.8069 | -0.0194 [-0.0342,-0.0077] +zscore wd=2.0 wn=0.35 all=0.7154 dom=0.8990 non=0.5310 h5=0.8275 h20=0.9032 macro=0.8036 | -0.0230 [-0.0372,-0.0108] +zscore wd=1.5 wn=0.5 all=0.7118 dom=0.8888 non=0.5340 h5=0.8320 h20=0.9031 macro=0.8071 | -0.0266 [-0.0436,-0.0119] +zscore wd=2.0 wn=0.2 all=0.7103 dom=0.8932 non=0.5268 h5=0.8334 h20=0.9036 macro=0.8015 | -0.0281 [-0.0442,-0.0141] +zscore wd=1.5 wn=max(0.2,2.0/N) all=0.7103 dom=0.8893 non=0.5307 h5=0.8349 h20=0.9057 macro=0.8113 | -0.0281 [-0.0440,-0.0136] +zscore wd=1.5 wn=max(0.2,1.0/N) all=0.7097 dom=0.8894 non=0.5293 h5=0.8349 h20=0.9048 macro=0.8089 | -0.0287 [-0.0447,-0.0146] +zscore wd=1.5 wn=max(0.35,2.0/N) all=0.7093 dom=0.8881 non=0.5298 h5=0.8292 h20=0.9048 macro=0.8107 | -0.0291 [-0.0458,-0.0149] +robust wd=1.0 wn=0.2 all=0.7098 dom=0.8836 non=0.5353 h5=0.8273 h20=0.9043 macro=0.8004 | -0.0286 [-0.0441,-0.0155] +robust wd=1.5 wn=0.2 all=0.7064 dom=0.8752 non=0.5370 h5=0.8198 h20=0.9011 macro=0.7882 | -0.0320 [-0.0468,-0.0196] +robust wd=0.75 wn=0.2 all=0.7046 dom=0.8761 non=0.5323 h5=0.8295 h20=0.9058 macro=0.8051 | -0.0338 [-0.0514,-0.0189] +robust wd=1.5 wn=0.1 all=0.7016 dom=0.8755 non=0.5271 h5=0.8214 h20=0.8975 macro=0.7829 | -0.0367 [-0.0524,-0.0238] +robust wd=1.0 wn=max(0.2,1.0/N) all=0.7107 dom=0.8836 non=0.5372 h5=0.8271 h20=0.9043 macro=0.8039 | -0.0276 [-0.0435,-0.0148] +robust wd=1.0 wn=max(0.2,0.5/N) all=0.7104 dom=0.8836 non=0.5365 h5=0.8276 h20=0.9044 macro=0.8030 | -0.0280 [-0.0436,-0.0150] +robust wd=1.0 wn=max(0.2,2.0/N) all=0.7096 dom=0.8839 non=0.5346 h5=0.8247 h20=0.9033 macro=0.7965 | -0.0288 [-0.0447,-0.0160] +rank wd=2.0 wn=0.1 all=0.6722 dom=0.8272 non=0.5167 h5=0.8128 h20=0.8806 macro=0.7345 | -0.0661 [-0.0846,-0.0494] +rank wd=1.5 wn=0.1 all=0.6711 dom=0.8262 non=0.5153 h5=0.8153 h20=0.8837 macro=0.7351 | -0.0673 [-0.0867,-0.0510] +rank wd=2.0 wn=0.05 all=0.6705 dom=0.8272 non=0.5133 h5=0.8145 h20=0.8807 macro=0.7351 | -0.0678 [-0.0871,-0.0503] +rank wd=1.5 wn=0.05 all=0.6694 dom=0.8262 non=0.5119 h5=0.8210 h20=0.8838 macro=0.7357 | -0.0690 [-0.0888,-0.0517] +rank wd=1.5 wn=max(0.1,0.5/N) all=0.6700 dom=0.8262 non=0.5133 h5=0.8141 h20=0.8822 macro=0.7318 | -0.0684 [-0.0881,-0.0519] +rank wd=1.5 wn=max(0.05,0.5/N) all=0.6686 dom=0.8262 non=0.5104 h5=0.8182 h20=0.8822 macro=0.7324 | -0.0698 [-0.0895,-0.0522] +rank wd=1.5 wn=max(0.1,1.0/N) all=0.6681 dom=0.8259 non=0.5096 h5=0.8127 h20=0.8808 macro=0.7283 | -0.0703 [-0.0896,-0.0535] +logrank wd=1.5 wn=0.75 all=0.6893 dom=0.8404 non=0.5376 h5=0.8408 h20=0.9013 macro=0.7469 | -0.0491 [-0.0634,-0.0352] +logrank wd=1.0 wn=0.75 all=0.6845 dom=0.8342 non=0.5343 h5=0.8559 h20=0.9070 macro=0.7578 | -0.0538 [-0.0718,-0.0377] +logrank wd=1.5 wn=0.5 all=0.6822 dom=0.8416 non=0.5221 h5=0.8345 h20=0.9009 macro=0.7516 | -0.0562 [-0.0749,-0.0410] +logrank wd=1.5 wn=0.35 all=0.6811 dom=0.8415 non=0.5201 h5=0.8349 h20=0.8999 macro=0.7525 | -0.0573 [-0.0753,-0.0417] +logrank wd=1.5 wn=max(0.35,0.5/N) all=0.6810 dom=0.8415 non=0.5199 h5=0.8349 h20=0.9000 macro=0.7519 | -0.0574 [-0.0754,-0.0418] +logrank wd=1.5 wn=max(0.2,1.0/N) all=0.6809 dom=0.8418 non=0.5193 h5=0.8286 h20=0.8922 macro=0.7501 | -0.0575 [-0.0742,-0.0430] +logrank wd=1.5 wn=max(0.2,0.5/N) all=0.6807 dom=0.8418 non=0.5190 h5=0.8286 h20=0.8925 macro=0.7504 | -0.0576 [-0.0743,-0.0431] +forward z x 0.01 + released inverse term all=0.6714 dom=0.8537 non=0.4884 h5=0.8170 h20=0.8839 macro=0.7711 | -0.0670 [-0.1272,-0.0294] +forward z x 0.02 + released inverse term all=0.7159 dom=0.8976 non=0.5335 h5=0.8237 h20=0.9010 macro=0.8071 | -0.0225 [-0.0364,-0.0094] +forward z x 0.05 + released inverse term all=0.7112 dom=0.8934 non=0.5283 h5=0.8332 h20=0.9001 macro=0.8131 | -0.0272 [-0.0433,-0.0126] +forward z x 0.1 + released inverse term all=0.6966 dom=0.8755 non=0.5170 h5=0.8327 h20=0.8988 macro=0.7992 | -0.0418 [-0.0591,-0.0259] diff --git a/shared/package-files/7b/7bd2dfcbb51b5638dd0a54e65287b93c3cf2067b38cb01db7c9edca726cb8bdf/I19-ff512x6-real08-corpus2+train3-noise05-jit08.log b/shared/package-files/7b/7bd2dfcbb51b5638dd0a54e65287b93c3cf2067b38cb01db7c9edca726cb8bdf/I19-ff512x6-real08-corpus2+train3-noise05-jit08.log new file mode 100644 index 0000000000000000000000000000000000000000..a1392c5e748d638e6224e41411389fc9f3219eb4 --- /dev/null +++ b/shared/package-files/7b/7bd2dfcbb51b5638dd0a54e65287b93c3cf2067b38cb01db7c9edca726cb8bdf/I19-ff512x6-real08-corpus2+train3-noise05-jit08.log @@ -0,0 +1,12 @@ +{"extra_rows": 2031301, "extra_structures": 434950} +{"args": {"store": "/workspace/research/inv", "out": "runs/I19-ff512x6-real08-corpus2+train3-noise05-jit08", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/selfsim/corpus2+train3.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 1, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "noise_rate": 0.5, "noise_max": 12, "noise_scatter": 0.35, "noise_shape": 3.0, "noise_real_rate": 0.0, "synth_peak_drop": -1.0, "synth_jitter": 0.8, "noise_near": 0.0, "noise_deltas": "inv/noise_deltas.json", "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"gen-x1.manifest.json": null, "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc"}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 12.807007113005966, "extra_store": {"path": "inv/selfsim/corpus2+train3.npz", "rows": 2031301, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/selfsim/train3.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 17.868643710809152, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 43.40271363919601}], "spectra": 2031301, "structures": 434950}}} +{"step": 5000, "elapsed": 122.89247310091741, "val_loss": 0.03769003911150656, "val_cos": 0.6351265645909465, "val_loss_ema": 0.03506690962903995, "val_cos_ema": 0.6560519946524043} +{"step": 10000, "elapsed": 241.18909381492995, "val_loss": 0.03136553374853031, "val_cos": 0.6962334086409169, "val_loss_ema": 0.030148990683526396, "val_cos_ema": 0.7082829277835323, "ind_cos": 0.45205620464254465, "agg_cos": 0.4891656801688198, "ind_nll": 0.3135519069432292, "agg_nll": 0.2895156724484019, "retrieval_seconds": 11.547416899935342} +{"step": 15000, "elapsed": 354.96333089098334, "val_loss": 0.029885894965448113, "val_cos": 0.7181207809122317, "val_loss_ema": 0.02857240176899102, "val_cos_ema": 0.7286305014009342} +{"step": 20000, "elapsed": 455.4616900680121, "val_loss": 0.02877548722760898, "val_cos": 0.730062623848371, "val_loss_ema": 0.02760639295715932, "val_cos_ema": 0.741453834112345, "ind_cos": 0.5139224870039631, "agg_cos": 0.5566421328941273, "ind_nll": 0.4076895362602296, "agg_nll": 0.38900612486489267, "retrieval_seconds": 11.382992881932296} +{"step": 25000, "elapsed": 566.4225651749875, "val_loss": 0.028477733112766957, "val_cos": 0.7375770131793967, "val_loss_ema": 0.027340128698009822, "val_cos_ema": 0.7472576683453215} +{"step": 30000, "elapsed": 665.1743251919979, "val_loss": 0.02754206203127111, "val_cos": 0.7456102060507167, "val_loss_ema": 0.026788575189456845, "val_cos_ema": 0.7542761992583573, "ind_cos": 0.5410983581244532, "agg_cos": 0.5792372227083226, "ind_nll": 0.4386226774409388, "agg_nll": 0.4280199701477173, "retrieval_seconds": 11.324746005935594} +{"step": 35000, "elapsed": 774.31287277292, "val_loss": 0.028099377737330473, "val_cos": 0.7470852280860762, "val_loss_ema": 0.027340684733969275, "val_cos_ema": 0.7524030052128905} +{"step": 40000, "elapsed": 868.8698491069954, "val_loss": 0.027492598784406123, "val_cos": 0.752357755823286, "val_loss_ema": 0.027221920008126545, "val_cos_ema": 0.7546660527191955, "ind_cos": 0.536774924082557, "agg_cos": 0.5725976632868393, "ind_nll": 0.44433578671058727, "agg_nll": 0.4258582531267693, "retrieval_seconds": 11.217270076973364} +{"step": 45000, "elapsed": 987.770604688907, "val_loss": 0.02711030717700807, "val_cos": 0.756390153732822, "val_loss_ema": 0.02730759745293561, "val_cos_ema": 0.7553835590081193} +{"step": 50000, "elapsed": 1090.247666540905, "val_loss": 0.02738600794755705, "val_cos": 0.754768325638382, "val_loss_ema": 0.027265339505378558, "val_cos_ema": 0.7557645033278219, "ind_cos": 0.5379072520459107, "agg_cos": 0.5739873385145916, "ind_nll": 0.4516444490195069, "agg_nll": 0.43522569355087753, "retrieval_seconds": 11.337262545945123} diff --git a/shared/package-files/7d/7d60031e505fa4257bb3257c0d5d528655c01574f1d40cad07b31d948cca1ddd/train.py b/shared/package-files/7d/7d60031e505fa4257bb3257c0d5d528655c01574f1d40cad07b31d948cca1ddd/train.py new file mode 100644 index 0000000000000000000000000000000000000000..3fa1045b3defe5eecf0711c57a4681b66a14ead3 --- /dev/null +++ b/shared/package-files/7d/7d60031e505fa4257bb3257c0d5d528655c01574f1d40cad07b31d948cca1ddd/train.py @@ -0,0 +1,308 @@ +#!/usr/bin/env python3 +"""Train native GLACIER from random initialization on all acquisition conditions. + +Plain PyTorch loop around the pinned ``JointModel`` (same losses, optimizer, +LR and MAGMa schedules as the native recipe). Differences from the starter +wrapper: native batch size 32 without gradient accumulation, several loader +workers, every adduct/instrument/collision-energy condition, optional EMA +weights and optional warm start from one of OUR OWN train-fold checkpoints. +No test input is read. Validation rows are used for a monitoring loss only. +""" + +import argparse +import functools +import hashlib +import json +import math +import os +from pathlib import Path +import random +import shutil +import sys +import time + + +def sha256(path): + h = hashlib.sha256() + with Path(path).open('rb') as f: + for block in iter(lambda: f.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + + +def seed_worker(base, worker): + import numpy as np + random.seed(base + worker) + np.random.seed((base + worker) % 2**32) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--data-root', type=Path, required=True) + p.add_argument('--source-root', type=Path, default=Path('/workspace/research/ms-pred')) + p.add_argument('--config', type=Path, default=Path(__file__).with_name('config.json')) + p.add_argument('--work-dir', type=Path, required=True) + p.add_argument('--subset', choices=['all', 'released', 'other'], default='all') + p.add_argument('--batch-size', type=int, default=32) + p.add_argument('--workers', type=int, default=5) + p.add_argument('--max-steps', type=int, required=True) + p.add_argument('--max-seconds', type=float, default=1e9) + p.add_argument('--checkpoint-every', type=int, default=5000) + p.add_argument('--resume-every', type=int, default=1000) + p.add_argument('--validate-every', type=int, default=5000) + p.add_argument('--validation-rows', type=int, default=2048) + p.add_argument('--ema-decay', type=float, default=0.999) + p.add_argument('--seed', type=int, default=1) + p.add_argument('--init', type=Path, help='warm start from our own exported train-fold checkpoint') + p.add_argument('--override', action='append', default=[], help='config override key=value (JSON value)') + p.add_argument('--limit-train', type=int) + p.add_argument('--fork', type=Path, help='resume state (last.ckpt copy) of another of our runs to branch from') + p.add_argument('--loss-precursor-window', type=float, + help='fragment-only intensity loss: ignore predicted and target peaks at or above precursor - window') + args = p.parse_args() + args.work_dir = args.work_dir.resolve() + args.work_dir.mkdir(parents=True, exist_ok=True) + source = args.source_root.resolve() / 'src' + sys.path.insert(0, str(source)) + sys.path.insert(0, str(Path(__file__).resolve().parent)) + import numpy as np + import torch + from torch.utils.data import DataLoader, Sampler + from ms_pred.glacier.joint_model import JointModel + from dataset_all import AllConditionDataset + + config = json.loads(args.config.read_text()) + for item in args.override: + key, value = item.split('=', 1) + config[key] = json.loads(value) + manifest_path = args.data_root / 'manifest.json' + source_digest = hashlib.sha256() + for path in sorted((source / 'ms_pred').rglob('*.py')): + source_digest.update(str(path.relative_to(source)).encode()) + source_digest.update(path.read_bytes()) + identity = { + 'initialization': 'random' if not args.init else f'own-checkpoint:{sha256(args.init)}', + 'data_manifest_sha256': sha256(manifest_path), 'subset': args.subset, + 'config': config, 'source_sha256': source_digest.hexdigest(), 'seed': args.seed, + 'batch_size': args.batch_size, 'ema_decay': args.ema_decay, 'limit_train': args.limit_train, + 'trainer': 'allcond-plain-loop-v1', + } + if args.loss_precursor_window is not None: + identity['loss_precursor_window'] = args.loss_precursor_window + if args.fork: + if args.init: + raise ValueError('--fork and --init are exclusive') + identity['initialization'] = f'own-checkpoint:{sha256(args.fork)}' + identity['fork'] = str(args.fork) + recipe = args.work_dir / 'recipe.json' + last_path = args.work_dir / 'last.ckpt' + if recipe.exists() and json.loads(recipe.read_text()) != identity: + raise ValueError('recipe changed; use a new work directory') + recipe.write_text(json.dumps(identity, indent=2) + '\n') + if not (args.work_dir / 'training-source').exists(): + shutil.copytree(Path(__file__).parent, args.work_dir / 'training-source', + ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + + random.seed(args.seed) + np.random.seed(args.seed) + torch.manual_seed(args.seed) + torch.cuda.manual_seed_all(args.seed) + + train = AllConditionDataset(args.data_root, 'train', config, subset=args.subset, limit=args.limit_train) + validation = AllConditionDataset(args.data_root, 'validation', config, subset=args.subset, + limit=args.validation_rows) + model = JointModel(**dict(config, node_feats=train.processor.get_node_feats(), + edge_feats=train.processor.get_edge_feats())) + logged = {} + model.log = lambda name, value, **kwargs: logged.__setitem__(name, float(value)) + if args.init: + saved = torch.load(args.init, map_location='cpu', weights_only=False) + if saved.get('task_training', {}).get('pretrained_assets', []) != []: + raise ValueError('warm start must come from our own random-initialized train-fold run') + model.load_state_dict(saved['state_dict']) + if args.loss_precursor_window is not None: + full_loss, precursor_window = model.inten_loss_fn, float(args.loss_precursor_window) + + def fragment_loss(pred, targ, parent_mass=None, use_hun=False): + # compare fragment regions only; spectra without any fragment target keep the full comparison + limit = parent_mass.view(-1, 1).to(pred.dtype) - precursor_window + targ_low = targ[:, :, 0] < limit + full = ~((targ_low & (targ[:, :, 1] > 0)).any(dim=1, keepdim=True)) + targ_inten = torch.where(targ_low | full, targ[:, :, 1], torch.zeros_like(targ[:, :, 1])) + pred_inten = torch.where((pred[:, :, 0] < limit) | full, pred[:, :, 1], torch.zeros_like(pred[:, :, 1])) + return full_loss(torch.stack([pred[:, :, 0], pred_inten], dim=-1), + torch.stack([targ[:, :, 0], targ_inten], dim=-1), parent_mass=parent_mass, use_hun=use_hun) + + model.inten_loss_fn = fragment_loss + device = torch.device('cuda') + model.to(device) + optim_config = model.configure_optimizers() + optimizer = optim_config['optimizer'] + scheduler = optim_config['lr_scheduler']['scheduler'] + ema = {k: v.detach().clone() for k, v in model.state_dict().items() if v.dtype.is_floating_point} + + state = {'step': 0, 'epoch': 0, 'batch_in_epoch': 0, 'elapsed': 0.0, 'skipped': 0} + resume_path = last_path if last_path.exists() else args.fork + if resume_path is not None and resume_path.exists(): + saved = torch.load(resume_path, map_location='cpu', weights_only=False) + if resume_path != last_path and saved['identity'].get('initialization') != 'random' \ + and not str(saved['identity'].get('initialization')).startswith('own-checkpoint:'): + raise ValueError('fork source must be one of our own train-fold runs') + model.load_state_dict(saved['state_dict']) + optimizer.load_state_dict(saved['optimizer']) + scheduler.load_state_dict(saved['scheduler']) + ema = {k: v.to(device) for k, v in saved['ema_state_dict'].items()} + state = saved['loop_state'] + model.step = saved['magma_step'] + print(json.dumps({'event': 'resumed', 'source': str(resume_path), **state}), flush=True) + + class EpochSampler(Sampler): + """Deterministic per-epoch permutation that can restart mid-epoch.""" + + def __init__(self, size, epoch, start): + self.size, self.epoch, self.start = size, epoch, start + + def __iter__(self): + generator = torch.Generator().manual_seed(args.seed * 1000003 + self.epoch) + order = torch.randperm(self.size, generator=generator).tolist() + usable = (self.size // args.batch_size) * args.batch_size + return iter(order[self.start * args.batch_size:usable]) + + def __len__(self): + return (self.size // args.batch_size) * args.batch_size - self.start * args.batch_size + + def loader_for(epoch, start): + return DataLoader(train, batch_size=args.batch_size, sampler=EpochSampler(len(train), epoch, start), + num_workers=args.workers, collate_fn=train.collate_fn, drop_last=True, + multiprocessing_context='spawn' if args.workers else None, + prefetch_factor=4 if args.workers else None, + worker_init_fn=functools.partial(seed_worker, args.seed * 7919 + epoch * 131)) + + def to_device(batch): + out = {} + for key, value in batch.items(): + if torch.is_tensor(value): + out[key] = value.to(device, non_blocking=True) + elif isinstance(value, dict): + out[key] = to_device(value) + else: + out[key] = value + return out + + validation_batches = None + + def validate(weights=None): + nonlocal validation_batches + if validation_batches is None: + validation_batches = [validation.collate_fn([validation[i] for i in range(s, min(s + 64, len(validation)))]) + for s in range(0, len(validation), 64)] + backup = None + if weights is not None: + backup = {k: v.detach().clone() for k, v in model.state_dict().items() if k in weights} + model.load_state_dict(weights, strict=False) + model.eval() + total, count = 0.0, 0 + with torch.no_grad(): + for batch in validation_batches: + size = len(batch['names']) + loss = model.validation_step(to_device(batch), 0)['loss'] + total += float(loss) * size + count += size + model.train() + if backup is not None: + model.load_state_dict(backup, strict=False) + return total / max(count, 1) + + def export(path, weights, kind): + state_dict = dict(model.state_dict()) + state_dict.update(weights) + payload = { + 'state_dict': {k: v.detach().cpu() for k, v in state_dict.items()}, + 'hyper_parameters': dict(model.hparams), 'global_step': state['step'], 'weights': kind, + 'task_training': dict(identity, elapsed_seconds=state['elapsed'], pretrained_assets=[], + data='MassSpecGym v1.5 train fold'), + } + temporary = Path(str(path) + '.tmp') + torch.save(payload, temporary) + os.replace(temporary, path) + + def save_resume(): + payload = { + 'state_dict': model.state_dict(), 'optimizer': optimizer.state_dict(), + 'scheduler': scheduler.state_dict(), 'ema_state_dict': ema, 'loop_state': state, + 'magma_step': model.step, 'identity': identity, + } + temporary = Path(str(last_path) + '.tmp') + torch.save(payload, temporary) + os.replace(temporary, last_path) + + checkpoints = args.work_dir / 'checkpoints' + checkpoints.mkdir(exist_ok=True) + print(json.dumps({'parameters': sum(p.numel() for p in model.parameters()), 'train_rows': len(train), + 'validation_rows': len(validation), 'steps_per_epoch': len(train) // args.batch_size, + 'identity': identity['initialization'], 'gpu': torch.cuda.get_device_name()}), flush=True) + model.train() + started = time.monotonic() + base_elapsed = state['elapsed'] + window = [] + done = state['step'] >= args.max_steps + while not done: + loader = loader_for(state['epoch'], state['batch_in_epoch']) + for batch in loader: + batch = to_device(batch) + loss = model.training_step(batch, state['step'])['loss'] + if not torch.isfinite(loss): + state['skipped'] += 1 + optimizer.zero_grad(set_to_none=True) + else: + optimizer.zero_grad(set_to_none=True) + loss.backward() + torch.nn.utils.clip_grad_value_(model.parameters(), 5) + optimizer.step() + window.append(float(loss)) + scheduler.step() + state['step'] += 1 + state['batch_in_epoch'] += 1 + with torch.no_grad(): + decay = min(args.ema_decay, (1 + state['step']) / (10 + state['step'])) + for key, value in model.state_dict().items(): + if key in ema: + ema[key].mul_(decay).add_(value.detach(), alpha=1 - decay) + state['elapsed'] = base_elapsed + time.monotonic() - started + step = state['step'] + if step % 100 == 0: + record = {'step': step, 'epoch': state['epoch'], 'elapsed_seconds': state['elapsed'], + 'train_loss': float(np.mean(window)) if window else None, + 'lr': scheduler.get_last_lr()[0], 'magma_weight': model.magma_weight_scheduler(), + 'skipped': state['skipped'], 'metrics': dict(logged)} + window = [] + with (args.work_dir / 'metrics.jsonl').open('a') as f: + f.write(json.dumps(record) + '\n') + if step % args.validate_every == 0 or step == args.max_steps: + record = {'step': step, 'elapsed_seconds': state['elapsed'], 'validation_loss': validate(), + 'validation_loss_ema': validate(ema)} + print(json.dumps(record), flush=True) + with (args.work_dir / 'validation.jsonl').open('a') as f: + f.write(json.dumps(record) + '\n') + if step % args.checkpoint_every == 0 or step == args.max_steps: + export(checkpoints / f'step-{step:07d}.ckpt', {}, 'raw') + export(checkpoints / f'step-{step:07d}-ema.ckpt', ema, 'ema') + if step % args.resume_every == 0 or step == args.max_steps: + save_resume() + if step >= args.max_steps or state['elapsed'] >= args.max_seconds: + done = True + break + else: + state['epoch'] += 1 + state['batch_in_epoch'] = 0 + del loader + save_resume() + (args.work_dir / 'result.json').write_text(json.dumps({ + 'global_step': state['step'], 'elapsed_seconds': state['elapsed'], 'skipped_batches': state['skipped'], + 'hardware': torch.cuda.get_device_name(), + 'peak_cuda_allocated_bytes': torch.cuda.max_memory_allocated(), + }, indent=2) + '\n') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/7d/7d646cad31b3844f264b38853106d87eb3edadb6b6f671e106b0af9be94985a8/swap-I16-w-1.0_0.05_0.5.log b/shared/package-files/7d/7d646cad31b3844f264b38853106d87eb3edadb6b6f671e106b0af9be94985a8/swap-I16-w-1.0_0.05_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..51d783b413c259f20347d70e8cc099e9e6afe158 --- /dev/null +++ b/shared/package-files/7d/7d646cad31b3844f264b38853106d87eb3edadb6b6f671e106b0af9be94985a8/swap-I16-w-1.0_0.05_0.5.log @@ -0,0 +1,2 @@ +without consensus term: Hit@1 0.7699 (ref 0.7713; -0.0014 [-0.0080, +0.0044]) macro 0.8636 (+0.0044 [-0.0003, +0.0092]) pools +42 -27 cap30 -0.0012 | Hit@5 0.8796 (-0.0001) Hit@20 0.9409 (+0.0032) + domain 0.9363 (+0.0049) other 0.6029 (-0.0077) | Orbitrap no energy 0.5659 (-0.0105) | above 850 0.4159 (+0.0014) below 850 0.8506 (-0.0020) diff --git a/shared/package-files/7d/7d73e8b8f2ff337d5945992bbd145fff73e54dc7f34fcca016aa7f7c635a0daa/swap-I14.log b/shared/package-files/7d/7d73e8b8f2ff337d5945992bbd145fff73e54dc7f34fcca016aa7f7c635a0daa/swap-I14.log new file mode 100644 index 0000000000000000000000000000000000000000..b6e945185e3045ed2166c57539a424c47c9d92a1 --- /dev/null +++ b/shared/package-files/7d/7d73e8b8f2ff337d5945992bbd145fff73e54dc7f34fcca016aa7f7c635a0daa/swap-I14.log @@ -0,0 +1,9 @@ +wrote /workspace/research/evals/fullfold/swap-I14/pred 19429 +released rule from saved branches: Hit@1 0.7607 pool-macro 0.8576 Hit@5 0.8779 Hit@20 0.9297 | twin pools 354 (macro 0.7514), others macro 0.8701 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4497 (domain 0.4171 / other 0.4825) macro 0.3810 + lam 1.00/1.00: Hit@1 0.8016 (+0.0409 [+0.0195, +0.0685]) macro +0.0159 [+0.0095, +0.0227] pools +91 -37 | no top 20 +0.0359 cap30 +0.0348 [+0.0204, +0.0518] | Hit@5 -0.0010 macro@5 +0.0086 cap30@5 +0.0174 +without consensus term: Hit@1 0.7607 (ref 0.7713; -0.0107 [-0.0202, -0.0031]) macro 0.8576 (-0.0015 [-0.0074, +0.0041]) pools +42 -47 cap30 -0.0111 | Hit@5 0.8779 (-0.0017) Hit@20 0.9297 (-0.0080) + domain 0.9299 (-0.0014) other 0.5907 (-0.0199) | Orbitrap no energy 0.5545 (-0.0219) | above 850 0.3990 (-0.0155) below 850 0.8430 (-0.0095) +full rule : Hit@1 0.8016 (ref 0.8022; -0.0006 [-0.0068, +0.0057]) macro 0.8736 (-0.0003 [-0.0053, +0.0047]) pools +34 -35 cap30 -0.0007 | Hit@5 0.8769 (+0.0050) Hit@20 0.9161 (-0.0003) + domain 0.9383 (+0.0018) other 0.6644 (-0.0030) | Orbitrap no energy 0.6373 (-0.0030) | above 850 0.5394 (-0.0053) below 850 0.8613 (+0.0005) diff --git a/shared/package-files/7d/7dfa0a727313a047e27e84edc1bc3676297ab316599bc0c369be0cbd9f143a33/recipe.json b/shared/package-files/7d/7dfa0a727313a047e27e84edc1bc3676297ab316599bc0c369be0cbd9f143a33/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..d733862c547c23fd8b50b710eace25b791eb6ad5 --- /dev/null +++ b/shared/package-files/7d/7dfa0a727313a047e27e84edc1bc3676297ab316599bc0c369be0cbd9f143a33/recipe.json @@ -0,0 +1,55 @@ +{ + "initialization": "own-checkpoint:0739bdd163a52753b55f2558914ac1fb8383b00c0436512105f4f0e28d55a5a8", + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "subset": "all", + "config": { + "hidden_size": 256, + "graphormer_layers": 5, + "graphormer_dropout": 0.1, + "frag_decoder_layers": 4, + "frag_encoder_layers": 0, + "frag_dropout": 0.1, + "inten_decoder_layers": 4, + "inten_encoder_layers": 3, + "inten_dropout": 0.1, + "max_breakpoints": 200, + "max_broken_bonds": 6, + "multi_hop_max_dist": 10, + "num_edge_dis": 10, + "pe_embed_k": 14, + "embed_elem_group": true, + "embed_adduct": true, + "embed_collision": true, + "embed_instrument": true, + "encode_forms": true, + "num_bins": 150000, + "enable_aux_loss": true, + "enable_decoder_norm": false, + "sk_tau": 0.05, + "linsat_tau": 15, + "inten_weight": 1, + "frag_weight": 0.1, + "warmup": 2000, + "magma_warmup_steps": 2500, + "magma_decay_rate": 0.9, + "magma_decay_steps": 2500, + "inten_loss_fn": "cosine", + "lr": 0.0004, + "lr_decay_rate": 0.9, + "weight_decay": 0 + }, + "source_sha256": "5cc5255f6671ddba726b5d29553967093a187bfa4290fa80d9d81fb573fe0fe6", + "seed": 1, + "batch_size": 32, + "ema_decay": 0.999, + "limit_train": null, + "trainer": "allcond-plain-loop-v1", + "synthetic": { + "manifest_sha256": "431454e702f8da3194684fc9a565135d29a38a407aaa31e9399d871360c6e962", + "per_item": 1, + "weight": 1.0, + "schedule": "e2e", + "instrument": "flag" + }, + "fork": "/workspace/research/forks/B-step0035000-resume.ckpt" +} diff --git a/shared/package-files/7d/7dfb8fc900ad5e1fc5e72a6554191c246519ef9db722496f8e628ab7a1856cbf/consensus-equivalence-5Ms-I9b+I13-L-ion-net.log b/shared/package-files/7d/7dfb8fc900ad5e1fc5e72a6554191c246519ef9db722496f8e628ab7a1856cbf/consensus-equivalence-5Ms-I9b+I13-L-ion-net.log new file mode 100644 index 0000000000000000000000000000000000000000..7a02ba6432b8994f22fc5f97f9fd9460af17cb9f --- /dev/null +++ b/shared/package-files/7d/7dfb8fc900ad5e1fc5e72a6554191c246519ef9db722496f8e628ab7a1856cbf/consensus-equivalence-5Ms-I9b+I13-L-ion-net.log @@ -0,0 +1,7 @@ +distances: largest absolute difference package run - base run 0 +inverse: largest absolute difference package run - base run 0 +library: largest absolute difference package run - base run 0 +ion: largest absolute difference package run - base run 0 +consensus term: 19428 queries covered by both, coverage differs for 0, largest absolute difference 4.44e-16 +label rank: package == lab for 19429 / 19429 queries; Hit@1 package 0.8022 lab 0.8022; Hit@5 0.8719 / 0.8719; Hit@20 0.9164 / 0.9164 +per spectrum (no pool mean): base 0.6184 with the term 0.6807 diff --git a/shared/package-files/7e/7e0e1ce97b422ac2526766408e8e3a05333163b8fbe12606fa2490f6f01cdc72/matched-soupB3-full.log b/shared/package-files/7e/7e0e1ce97b422ac2526766408e8e3a05333163b8fbe12606fa2490f6f01cdc72/matched-soupB3-full.log new file mode 100644 index 0000000000000000000000000000000000000000..90f53e220ba83366d4249d9b83296a5c5f5a8c91 --- /dev/null +++ b/shared/package-files/7e/7e0e1ce97b422ac2526766408e8e3a05333163b8fbe12606fa2490f6f01cdc72/matched-soupB3-full.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 75.36021813799744} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 79.08760412099946} +ind meanD all=0.4879 dom=0.7236 non=0.2513 h5=0.6372 h20=0.7135 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6159 dom=0.7958 non=0.4353 h5=0.8313 h20=0.9064 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.4879 dom=0.7236 non=0.2513 h5=0.6372 h20=0.7135 | diff=+0.0000 [+0.0000,+0.0000] +agg Dmean all=0.6159 dom=0.7958 non=0.4353 h5=0.8313 h20=0.9064 | diff=+0.0000 [+0.0000,+0.0000] +ind gmean all=0.4879 dom=0.7236 non=0.2513 h5=0.6372 h20=0.7135 | diff=+0.0000 [+0.0000,+0.0000] +agg gmean all=0.6159 dom=0.7958 non=0.4353 h5=0.8313 h20=0.9064 | diff=+0.0000 [+0.0000,+0.0000] diff --git a/shared/package-files/7e/7e0e67b354a4dab7f2cf3cf465f4b9fd9c516ba254cbdeb46077dd41f0888d08/replay-5Ms-I1+I3x2-L-val-tiny.log b/shared/package-files/7e/7e0e67b354a4dab7f2cf3cf465f4b9fd9c516ba254cbdeb46077dd41f0888d08/replay-5Ms-I1+I3x2-L-val-tiny.log new file mode 100644 index 0000000000000000000000000000000000000000..39cad2b81ca11d4a398053e3387ec66101199974 --- /dev/null +++ b/shared/package-files/7e/7e0e67b354a4dab7f2cf3cf465f4b9fd9c516ba254cbdeb46077dd41f0888d08/replay-5Ms-I1+I3x2-L-val-tiny.log @@ -0,0 +1,13 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 5, "inverse_members": 3, "library": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.8801667299994733} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 1.9107884789991658} +{"event": "candidate_store", "pools": 40, "pairs": 9390, "seconds": 1.3627447269973345} +{"event": "library", "scored": 180, "search_seconds": 1.0243157560034888, "seconds": 1.5191401549964212} +{"event": "inverse_annotated", "pools": 40, "pairs": 9390, "formulae": 1921, "unsupported_candidates": 75, "seconds": 5.53599966224283e-05} +{"event": "inverse", "scored": 180, "seconds": 1.4134102490061196} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 118.79757010399771} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 0.5000633699964965, "total_seconds": 140.679142375011} +{"event": "measured", "exit_code": 0, "wall_seconds": 142.6, "user_seconds": 269.7, "system_seconds": 10.3, "max_rss_gib": 2.54} +{"event": "replay_checked", "exit_code": 0, "package_files": 238, "package_unchanged": true, "processes_left": 0, "rankings": 180} diff --git a/shared/package-files/7e/7e520586af71c1333e5f0993b9fdba275c5da838447eb21b2a048d32a0075326/recur-support-30.log b/shared/package-files/7e/7e520586af71c1333e5f0993b9fdba275c5da838447eb21b2a048d32a0075326/recur-support-30.log new file mode 100644 index 0000000000000000000000000000000000000000..7c44445623798585830bfaf49377abdca050e3f8 --- /dev/null +++ b/shared/package-files/7e/7e520586af71c1333e5f0993b9fdba275c5da838447eb21b2a048d32a0075326/recur-support-30.log @@ -0,0 +1,2 @@ +support tol 30 mDa: 17307 of 19429 spectra in groups of >= 3; peaks 432025 -> 342323; 1 s +wrote /workspace/research/inv/recur/support-30.npz 155 s diff --git a/shared/package-files/7e/7e908cf91a9ea6278f966c2e5f100b1fd3f44e4699f98b8c654cb012218b4405/replay-B20k+B30k-I1+I3x2-val-tiny.log b/shared/package-files/7e/7e908cf91a9ea6278f966c2e5f100b1fd3f44e4699f98b8c654cb012218b4405/replay-B20k+B30k-I1+I3x2-val-tiny.log new file mode 100644 index 0000000000000000000000000000000000000000..bebcd0048bb295bceaa3296d0e018094e478c7fc --- /dev/null +++ b/shared/package-files/7e/7e908cf91a9ea6278f966c2e5f100b1fd3f44e4699f98b8c654cb012218b4405/replay-B20k+B30k-I1+I3x2-val-tiny.log @@ -0,0 +1,10 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 2, "inverse_members": 3, "workers": 12} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.376540579018183} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 1.4037958190310746} +{"event": "inverse_annotated", "pools": 40, "pairs": 9390, "formulae": 1921, "unsupported_candidates": 75, "seconds": 0.9113915340276435} +{"event": "inverse", "scored": 180, "seconds": 2.5158363429363817} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 44.80639465304557} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 0.44483629090245813, "total_seconds": 61.204152995953336} +{"event": "measured", "exit_code": 0, "wall_seconds": 62.6, "user_seconds": 171.7, "system_seconds": 6.8, "max_rss_gib": 2.14} diff --git a/shared/package-files/7e/7ee975cc9919f324b93610eab0993ca1089c73fc56d7cac015929db5961d4beb/eval-score-I21.log b/shared/package-files/7e/7ee975cc9919f324b93610eab0993ca1089c73fc56d7cac015929db5961d4beb/eval-score-I21.log new file mode 100644 index 0000000000000000000000000000000000000000..87e4e5840d30f3922ff8b13fd050417991f1ef08 --- /dev/null +++ b/shared/package-files/7e/7ee975cc9919f324b93610eab0993ca1089c73fc56d7cac015929db5961d4beb/eval-score-I21.log @@ -0,0 +1,41 @@ +19429 queries, 1 members, 55.2 s +cos pool rule all=0.5990 dom=0.8348 non=0.3621 h5=0.7132 macro=0.7150 +cen pool rule all=0.5821 dom=0.8074 non=0.3560 h5=0.7086 macro=0.6852 +cos_pm pool rule all=0.5990 dom=0.8348 non=0.3621 h5=0.7132 macro=0.7150 +dot pool rule all=0.5750 dom=0.7887 non=0.3604 h5=0.7276 macro=0.6985 +geo pool rule all=0.5801 dom=0.8167 non=0.3425 h5=0.7025 macro=0.7073 +idf05 pool rule all=0.5998 dom=0.8323 non=0.3663 h5=0.7210 macro=0.7129 +idf1 pool rule all=0.5986 dom=0.8321 non=0.3641 h5=0.7294 macro=0.7126 +lin pool rule all=0.5572 dom=0.7869 non=0.3266 h5=0.6776 macro=0.6725 +log01 pool rule all=0.5957 dom=0.8212 non=0.3692 h5=0.7308 macro=0.7073 +log05 pool rule all=0.6111 dom=0.8383 non=0.3830 h5=0.7293 macro=0.7203 +log20 pool rule all=0.6067 dom=0.8380 non=0.3745 h5=0.7243 macro=0.7194 +nll02 pool rule all=0.4551 dom=0.7208 non=0.1884 h5=0.5959 macro=0.5827 +nll10 pool rule all=0.4170 dom=0.6628 non=0.1702 h5=0.5585 macro=0.5289 +poolcen pool rule all=0.5841 dom=0.8007 non=0.3667 h5=0.7116 macro=0.6840 +pow020 pool rule all=0.5602 dom=0.7672 non=0.3524 h5=0.7409 macro=0.6731 +pow030 pool rule all=0.5787 dom=0.7921 non=0.3644 h5=0.7151 macro=0.6867 +pow040 pool rule all=0.5930 dom=0.8147 non=0.3705 h5=0.7297 macro=0.7026 +pow05 pool rule all=0.5998 dom=0.8278 non=0.3708 h5=0.7252 macro=0.7150 +pow05idf025 pool rule all=0.6016 dom=0.8294 non=0.3730 h5=0.7298 macro=0.7159 +pow05idf05 pool rule all=0.6079 dom=0.8325 non=0.3823 h5=0.7320 macro=0.7174 +pow05m pool rule all=0.5998 dom=0.8278 non=0.3708 h5=0.7252 macro=0.7150 +pow05s pool rule all=0.5999 dom=0.8299 non=0.3691 h5=0.7240 macro=0.7138 +pow060 pool rule all=0.6031 dom=0.8329 non=0.3725 h5=0.7230 macro=0.7159 +pow060idf025 pool rule all=0.6048 dom=0.8373 non=0.3714 h5=0.7277 macro=0.7191 +pow060idf050 pool rule all=0.6086 dom=0.8397 non=0.3765 h5=0.7340 macro=0.7188 +pow060m pool rule all=0.6031 dom=0.8329 non=0.3725 h5=0.7230 macro=0.7159 +pow065 pool rule all=0.6068 dom=0.8382 non=0.3744 h5=0.7209 macro=0.7194 +pow070 pool rule all=0.6100 dom=0.8411 non=0.3780 h5=0.7228 macro=0.7212 +pow070idf025 pool rule all=0.6087 dom=0.8397 non=0.3767 h5=0.7276 macro=0.7188 +pow070idf050 pool rule all=0.6085 dom=0.8428 non=0.3733 h5=0.7349 macro=0.7183 +pow070m pool rule all=0.6100 dom=0.8411 non=0.3780 h5=0.7228 macro=0.7212 +pow075 pool rule all=0.6049 dom=0.8407 non=0.3682 h5=0.7250 macro=0.7200 +pow080 pool rule all=0.6037 dom=0.8395 non=0.3670 h5=0.7216 macro=0.7194 +pow080m pool rule all=0.6037 dom=0.8395 non=0.3670 h5=0.7216 macro=0.7194 +pow085 pool rule all=0.6031 dom=0.8381 non=0.3671 h5=0.7175 macro=0.7177 +pow085idf025 pool rule all=0.6052 dom=0.8388 non=0.3707 h5=0.7228 macro=0.7194 +pow085idf050 pool rule all=0.6024 dom=0.8374 non=0.3666 h5=0.7305 macro=0.7168 +pow090 pool rule all=0.6037 dom=0.8379 non=0.3685 h5=0.7161 macro=0.7183 +pow2 pool rule all=0.5681 dom=0.8000 non=0.3353 h5=0.6943 macro=0.6908 +tani pool rule all=0.5710 dom=0.8035 non=0.3375 h5=0.7167 macro=0.6911 diff --git a/shared/package-files/7e/7ef045a2f08c5a3934709c2dede3f9ae6917fc0490157c9e6d25fcaef085f18e/swap-I18-w0.75_0.05_0.5.log b/shared/package-files/7e/7ef045a2f08c5a3934709c2dede3f9ae6917fc0490157c9e6d25fcaef085f18e/swap-I18-w0.75_0.05_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..b30a2d44c458cc81eb958e5f8de2750993ec77d3 --- /dev/null +++ b/shared/package-files/7e/7ef045a2f08c5a3934709c2dede3f9ae6917fc0490157c9e6d25fcaef085f18e/swap-I18-w0.75_0.05_0.5.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7737 pool-macro 0.8656 Hit@5 0.8812 Hit@20 0.9342 | twin pools 354 (macro 0.7599), others macro 0.8780 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4504 (domain 0.4193 / other 0.4816) macro 0.3828 + lam 1.00/1.00: Hit@1 0.8034 (+0.0296 [+0.0107, +0.0544]) macro +0.0136 [+0.0074, +0.0195] pools +80 -34 | no top 20 +0.0232 cap30 +0.0231 [+0.0113, +0.0372] | Hit@5 -0.0054 macro@5 +0.0047 cap30@5 +0.0122 +without consensus term: Hit@1 0.7737 (ref 0.7713; +0.0024 [-0.0024, +0.0075]) macro 0.8656 (+0.0065 [+0.0018, +0.0109]) pools +43 -21 cap30 +0.0028 | Hit@5 0.8812 (+0.0015) Hit@20 0.9342 (-0.0035) + domain 0.9340 (+0.0027) other 0.6128 (+0.0022) | Orbitrap no energy 0.5786 (+0.0022) | above 850 0.4218 (+0.0072) below 850 0.8539 (+0.0013) +full rule : Hit@1 0.8034 (ref 0.8022; +0.0012 [-0.0042, +0.0067]) macro 0.8792 (+0.0053 [+0.0012, +0.0095]) pools +36 -18 cap30 +0.0014 | Hit@5 0.8758 (+0.0039) Hit@20 0.9168 (+0.0005) + domain 0.9406 (+0.0042) other 0.6656 (-0.0018) | Orbitrap no energy 0.6347 (-0.0056) | above 850 0.5366 (-0.0080) below 850 0.8641 (+0.0033) diff --git a/shared/package-files/80/80170b137db2ab2c41a87442a3a96656844ddf03ba4c64c31520f98f0e5dd498/multires-meqq-normalized.log b/shared/package-files/80/80170b137db2ab2c41a87442a3a96656844ddf03ba4c64c31520f98f0e5dd498/multires-meqq-normalized.log new file mode 100644 index 0000000000000000000000000000000000000000..abf3af46629fa70a8c797579c6ba7fea7e838e8c --- /dev/null +++ b/shared/package-files/80/80170b137db2ab2c41a87442a3a96656844ddf03ba4c64c31520f98f0e5dd498/multires-meqq-normalized.log @@ -0,0 +1,118 @@ +non-domain pool-size bins: 1-1 2-4 5-15 16-63 64-9999 +forward 0.01 Da alone all=0.6539 dom=0.8039 non=0.5034 h5=0.8177 h20=0.8925 macro=0.7519 | non-domain by size 0.682 0.622 0.318 0.471 0.591 +forward bin0.02 alone all=0.6547 dom=0.7953 non=0.5136 h5=0.8242 h20=0.8937 macro=0.7484 | +0.0008 [-0.0147,+0.0171] | non-domain by size 0.675 0.617 0.342 0.511 0.531 +forward bin0.05 alone all=0.6449 dom=0.7895 non=0.4996 h5=0.8054 h20=0.8929 macro=0.7404 | -0.0091 [-0.0266,+0.0086] | non-domain by size 0.668 0.621 0.332 0.483 0.531 +forward bin0.1 alone all=0.5938 dom=0.7537 non=0.4332 h5=0.7936 h20=0.8838 macro=0.7126 | -0.0601 [-0.1231,-0.0188] | non-domain by size 0.642 0.584 0.336 0.480 0.119 +forward bin0.2 alone all=0.5890 dom=0.7483 non=0.4291 h5=0.7762 h20=0.8584 macro=0.7023 | -0.0649 [-0.1268,-0.0217] | non-domain by size 0.613 0.566 0.347 0.474 0.119 +forward bin0.5 alone all=0.6336 dom=0.7651 non=0.5017 h5=0.7842 h20=0.8958 macro=0.7191 | -0.0203 [-0.0409,-0.0007] | non-domain by size 0.653 0.587 0.317 0.502 0.531 +forward bin1 alone all=0.5859 dom=0.7420 non=0.4291 h5=0.7688 h20=0.8686 macro=0.7005 | -0.0680 [-0.1303,-0.0264] | non-domain by size 0.635 0.570 0.296 0.478 0.119 +forward 0.01 + 0.5 * bin0.02 all=0.6631 dom=0.8094 non=0.5162 h5=0.8281 h20=0.8985 macro=0.7563 | +0.0092 [-0.0013,+0.0196] | non-domain by size 0.693 0.622 0.339 0.493 0.591 +forward 0.01 + 1.0 * bin0.02 all=0.6566 dom=0.8031 non=0.5095 h5=0.8301 h20=0.9017 macro=0.7552 | +0.0027 [-0.0118,+0.0174] | non-domain by size 0.686 0.626 0.339 0.498 0.531 +forward 0.01 + 0.5 * bin0.05 all=0.6599 dom=0.8045 non=0.5147 h5=0.8147 h20=0.9006 macro=0.7572 | +0.0060 [-0.0086,+0.0209] | non-domain by size 0.693 0.626 0.343 0.505 0.531 +forward 0.01 + 1.0 * bin0.05 all=0.6602 dom=0.8047 non=0.5151 h5=0.8177 h20=0.9021 macro=0.7566 | +0.0063 [-0.0102,+0.0228] | non-domain by size 0.686 0.631 0.343 0.506 0.531 +forward 0.01 + 0.5 * bin0.1 all=0.6557 dom=0.7996 non=0.5112 h5=0.8110 h20=0.9024 macro=0.7552 | +0.0017 [-0.0119,+0.0150] | non-domain by size 0.686 0.631 0.356 0.495 0.531 +forward 0.01 + 1.0 * bin0.1 all=0.6504 dom=0.7921 non=0.5081 h5=0.8028 h20=0.9012 macro=0.7499 | -0.0036 [-0.0190,+0.0106] | non-domain by size 0.675 0.626 0.345 0.496 0.531 +forward 0.01 + 0.5 * bin0.2 all=0.6608 dom=0.8016 non=0.5193 h5=0.8044 h20=0.9025 macro=0.7552 | +0.0068 [-0.0080,+0.0214] | non-domain by size 0.682 0.624 0.356 0.515 0.531 +forward 0.01 + 1.0 * bin0.2 all=0.6564 dom=0.7961 non=0.5162 h5=0.7950 h20=0.8945 macro=0.7499 | +0.0025 [-0.0131,+0.0179] | non-domain by size 0.672 0.614 0.367 0.513 0.531 +forward 0.01 + 0.5 * bin0.5 all=0.6590 dom=0.7997 non=0.5177 h5=0.8141 h20=0.9035 macro=0.7537 | +0.0050 [-0.0094,+0.0193] | non-domain by size 0.682 0.612 0.364 0.512 0.531 +forward 0.01 + 1.0 * bin0.5 all=0.6592 dom=0.7949 non=0.5229 h5=0.8118 h20=0.9034 macro=0.7531 | +0.0053 [-0.0113,+0.0209] | non-domain by size 0.690 0.618 0.353 0.527 0.531 +forward 0.01 + 0.5 * bin1 all=0.6603 dom=0.7980 non=0.5219 h5=0.8032 h20=0.9040 macro=0.7561 | +0.0063 [-0.0091,+0.0214] | non-domain by size 0.690 0.627 0.356 0.519 0.531 +forward 0.01 + 1.0 * bin1 all=0.6564 dom=0.7938 non=0.5185 h5=0.7947 h20=0.8975 macro=0.7504 | +0.0025 [-0.0129,+0.0184] | non-domain by size 0.686 0.623 0.345 0.516 0.531 +--- fused +packaged rule all=0.7384 dom=0.9007 non=0.5755 h5=0.8418 h20=0.9104 macro=0.8210 | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[all] + 0.25 * bin0.02 all=0.7334 dom=0.9001 non=0.5660 h5=0.8427 h20=0.9126 macro=0.8201 | -0.0050 [-0.0135,+0.0016] | non-domain by size 0.737 0.672 0.343 0.556 0.591 +[all] + 0.5 * bin0.02 all=0.7327 dom=0.8997 non=0.5650 h5=0.8443 h20=0.9143 macro=0.8198 | -0.0057 [-0.0190,+0.0055] | non-domain by size 0.737 0.671 0.343 0.572 0.531 +[all] + 1.0 * bin0.02 all=0.7326 dom=0.8967 non=0.5678 h5=0.8481 h20=0.9134 macro=0.8196 | -0.0058 [-0.0196,+0.0062] | non-domain by size 0.737 0.674 0.364 0.580 0.531 +[all] + 2.0 * bin0.02 all=0.7335 dom=0.8957 non=0.5706 h5=0.8555 h20=0.9144 macro=0.8196 | -0.0049 [-0.0202,+0.0086] | non-domain by size 0.748 0.674 0.373 0.584 0.531 +[all] + 0.25 * bin0.05 all=0.7343 dom=0.9011 non=0.5669 h5=0.8423 h20=0.9124 macro=0.8213 | -0.0041 [-0.0148,+0.0052] | non-domain by size 0.741 0.677 0.332 0.559 0.591 +[all] + 0.5 * bin0.05 all=0.7309 dom=0.9016 non=0.5595 h5=0.8405 h20=0.9094 macro=0.8204 | -0.0075 [-0.0211,+0.0051] | non-domain by size 0.741 0.671 0.332 0.561 0.531 +[all] + 1.0 * bin0.05 all=0.7326 dom=0.8984 non=0.5662 h5=0.8469 h20=0.9105 macro=0.8225 | -0.0058 [-0.0215,+0.0095] | non-domain by size 0.755 0.673 0.364 0.571 0.531 +[all] + 2.0 * bin0.05 all=0.7275 dom=0.8991 non=0.5552 h5=0.8388 h20=0.9104 macro=0.8213 | -0.0109 [-0.0275,+0.0051] | non-domain by size 0.752 0.664 0.361 0.553 0.531 +[all] + 0.25 * bin0.1 all=0.7361 dom=0.9021 non=0.5694 h5=0.8488 h20=0.9097 macro=0.8213 | -0.0023 [-0.0145,+0.0080] | non-domain by size 0.745 0.673 0.353 0.563 0.591 +[all] + 0.5 * bin0.1 all=0.7336 dom=0.9016 non=0.5650 h5=0.8534 h20=0.9093 macro=0.8201 | -0.0047 [-0.0193,+0.0088] | non-domain by size 0.741 0.669 0.377 0.569 0.531 +[all] + 1.0 * bin0.1 all=0.7294 dom=0.8978 non=0.5603 h5=0.8417 h20=0.9095 macro=0.8198 | -0.0090 [-0.0264,+0.0078] | non-domain by size 0.752 0.671 0.377 0.559 0.531 +[all] + 2.0 * bin0.1 all=0.7312 dom=0.8957 non=0.5660 h5=0.8257 h20=0.9088 macro=0.8181 | -0.0072 [-0.0256,+0.0108] | non-domain by size 0.748 0.664 0.374 0.563 0.531 +[all] + 0.25 * bin0.2 all=0.7305 dom=0.9024 non=0.5578 h5=0.8410 h20=0.9120 macro=0.8207 | -0.0079 [-0.0221,+0.0051] | non-domain by size 0.745 0.664 0.401 0.551 0.531 +[all] + 0.5 * bin0.2 all=0.7273 dom=0.8988 non=0.5551 h5=0.8335 h20=0.9116 macro=0.8198 | -0.0111 [-0.0280,+0.0046] | non-domain by size 0.741 0.667 0.401 0.549 0.531 +[all] + 1.0 * bin0.2 all=0.7249 dom=0.8918 non=0.5573 h5=0.8218 h20=0.9081 macro=0.8184 | -0.0135 [-0.0317,+0.0030] | non-domain by size 0.763 0.661 0.381 0.556 0.531 +[all] + 2.0 * bin0.2 all=0.7162 dom=0.8890 non=0.5427 h5=0.8129 h20=0.8969 macro=0.8104 | -0.0222 [-0.0408,-0.0046] | non-domain by size 0.741 0.650 0.368 0.536 0.531 +[all] + 0.25 * bin0.5 all=0.7318 dom=0.9016 non=0.5614 h5=0.8506 h20=0.9111 macro=0.8210 | -0.0065 [-0.0212,+0.0056] | non-domain by size 0.755 0.665 0.374 0.562 0.531 +[all] + 0.5 * bin0.5 all=0.7348 dom=0.8983 non=0.5707 h5=0.8504 h20=0.9114 macro=0.8210 | -0.0036 [-0.0197,+0.0109] | non-domain by size 0.755 0.666 0.385 0.580 0.531 +[all] + 1.0 * bin0.5 all=0.7273 dom=0.8927 non=0.5612 h5=0.8476 h20=0.9117 macro=0.8190 | -0.0111 [-0.0295,+0.0054] | non-domain by size 0.763 0.661 0.354 0.569 0.531 +[all] + 2.0 * bin0.5 all=0.7238 dom=0.8913 non=0.5556 h5=0.8398 h20=0.9077 macro=0.8163 | -0.0146 [-0.0342,+0.0051] | non-domain by size 0.766 0.651 0.363 0.559 0.531 +[all] + 0.25 * bin1 all=0.7338 dom=0.9019 non=0.5650 h5=0.8407 h20=0.9087 macro=0.8213 | -0.0046 [-0.0194,+0.0079] | non-domain by size 0.755 0.662 0.374 0.569 0.531 +[all] + 0.5 * bin1 all=0.7302 dom=0.9010 non=0.5587 h5=0.8359 h20=0.9118 macro=0.8190 | -0.0082 [-0.0253,+0.0079] | non-domain by size 0.755 0.659 0.363 0.560 0.531 +[all] + 1.0 * bin1 all=0.7260 dom=0.8956 non=0.5556 h5=0.8200 h20=0.9116 macro=0.8160 | -0.0124 [-0.0309,+0.0042] | non-domain by size 0.770 0.655 0.354 0.555 0.531 +[all] + 2.0 * bin1 all=0.6947 dom=0.8950 non=0.4936 h5=0.8112 h20=0.9078 macro=0.8122 | -0.0437 [-0.1088,-0.0009] | non-domain by size 0.752 0.652 0.363 0.543 0.119 +[non] + 0.25 * bin0.02 all=0.7341 dom=0.9007 non=0.5668 h5=0.8427 h20=0.9126 macro=0.8198 | -0.0043 [-0.0127,+0.0020] | non-domain by size 0.737 0.672 0.343 0.556 0.591 +[non] + 0.5 * bin0.02 all=0.7336 dom=0.9003 non=0.5663 h5=0.8443 h20=0.9143 macro=0.8198 | -0.0047 [-0.0178,+0.0057] | non-domain by size 0.737 0.671 0.343 0.572 0.531 +[non] + 1.0 * bin0.02 all=0.7362 dom=0.8999 non=0.5718 h5=0.8473 h20=0.9134 macro=0.8204 | -0.0022 [-0.0163,+0.0090] | non-domain by size 0.737 0.674 0.364 0.580 0.531 +[non] + 2.0 * bin0.02 all=0.7370 dom=0.8994 non=0.5740 h5=0.8546 h20=0.9143 macro=0.8210 | -0.0013 [-0.0160,+0.0106] | non-domain by size 0.748 0.674 0.373 0.584 0.531 +[non] + 0.25 * bin0.05 all=0.7345 dom=0.9007 non=0.5677 h5=0.8419 h20=0.9124 macro=0.8213 | -0.0039 [-0.0146,+0.0051] | non-domain by size 0.741 0.677 0.332 0.559 0.591 +[non] + 0.5 * bin0.05 all=0.7298 dom=0.8996 non=0.5593 h5=0.8405 h20=0.9104 macro=0.8198 | -0.0086 [-0.0230,+0.0036] | non-domain by size 0.741 0.671 0.332 0.561 0.531 +[non] + 1.0 * bin0.05 all=0.7339 dom=0.8996 non=0.5674 h5=0.8471 h20=0.9116 macro=0.8225 | -0.0045 [-0.0199,+0.0097] | non-domain by size 0.755 0.673 0.364 0.571 0.531 +[non] + 2.0 * bin0.05 all=0.7279 dom=0.8992 non=0.5559 h5=0.8387 h20=0.9113 macro=0.8196 | -0.0105 [-0.0270,+0.0050] | non-domain by size 0.752 0.664 0.361 0.553 0.531 +[non] + 0.25 * bin0.1 all=0.7354 dom=0.9000 non=0.5702 h5=0.8486 h20=0.9107 macro=0.8210 | -0.0029 [-0.0149,+0.0068] | non-domain by size 0.745 0.673 0.353 0.563 0.591 +[non] + 0.5 * bin0.1 all=0.7330 dom=0.8994 non=0.5659 h5=0.8528 h20=0.9101 macro=0.8201 | -0.0054 [-0.0195,+0.0075] | non-domain by size 0.741 0.669 0.377 0.569 0.531 +[non] + 1.0 * bin0.1 all=0.7334 dom=0.9000 non=0.5662 h5=0.8416 h20=0.9101 macro=0.8213 | -0.0049 [-0.0226,+0.0120] | non-domain by size 0.752 0.671 0.377 0.559 0.531 +[non] + 2.0 * bin0.1 all=0.7331 dom=0.8995 non=0.5661 h5=0.8257 h20=0.9096 macro=0.8196 | -0.0052 [-0.0228,+0.0120] | non-domain by size 0.748 0.664 0.374 0.563 0.531 +[non] + 0.25 * bin0.2 all=0.7297 dom=0.9000 non=0.5586 h5=0.8404 h20=0.9129 macro=0.8198 | -0.0087 [-0.0226,+0.0036] | non-domain by size 0.745 0.664 0.401 0.551 0.531 +[non] + 0.5 * bin0.2 all=0.7276 dom=0.8985 non=0.5560 h5=0.8334 h20=0.9123 macro=0.8198 | -0.0108 [-0.0283,+0.0043] | non-domain by size 0.741 0.667 0.401 0.549 0.531 +[non] + 1.0 * bin0.2 all=0.7284 dom=0.8982 non=0.5580 h5=0.8221 h20=0.9089 macro=0.8204 | -0.0099 [-0.0278,+0.0060] | non-domain by size 0.763 0.661 0.381 0.556 0.531 +[non] + 2.0 * bin0.2 all=0.7210 dom=0.8977 non=0.5436 h5=0.8134 h20=0.8976 macro=0.8151 | -0.0174 [-0.0354,-0.0006] | non-domain by size 0.741 0.650 0.368 0.536 0.531 +[non] + 0.25 * bin0.5 all=0.7316 dom=0.9000 non=0.5625 h5=0.8504 h20=0.9112 macro=0.8210 | -0.0068 [-0.0211,+0.0048] | non-domain by size 0.755 0.665 0.374 0.562 0.531 +[non] + 0.5 * bin0.5 all=0.7349 dom=0.8982 non=0.5709 h5=0.8504 h20=0.9116 macro=0.8216 | -0.0035 [-0.0200,+0.0107] | non-domain by size 0.755 0.666 0.385 0.580 0.531 +[non] + 1.0 * bin0.5 all=0.7300 dom=0.8976 non=0.5618 h5=0.8470 h20=0.9125 macro=0.8198 | -0.0083 [-0.0263,+0.0079] | non-domain by size 0.763 0.661 0.354 0.569 0.531 +[non] + 2.0 * bin0.5 all=0.7271 dom=0.8974 non=0.5561 h5=0.8396 h20=0.9086 macro=0.8181 | -0.0113 [-0.0306,+0.0074] | non-domain by size 0.766 0.651 0.363 0.559 0.531 +[non] + 0.25 * bin1 all=0.7333 dom=0.9000 non=0.5659 h5=0.8406 h20=0.9094 macro=0.8210 | -0.0051 [-0.0196,+0.0071] | non-domain by size 0.755 0.662 0.374 0.569 0.531 +[non] + 0.5 * bin1 all=0.7288 dom=0.8985 non=0.5583 h5=0.8366 h20=0.9127 macro=0.8193 | -0.0096 [-0.0275,+0.0055] | non-domain by size 0.755 0.659 0.363 0.560 0.531 +[non] + 1.0 * bin1 all=0.7265 dom=0.8979 non=0.5545 h5=0.8205 h20=0.9123 macro=0.8190 | -0.0118 [-0.0303,+0.0045] | non-domain by size 0.770 0.655 0.354 0.555 0.531 +[non] + 2.0 * bin1 all=0.6954 dom=0.8979 non=0.4921 h5=0.8123 h20=0.9091 macro=0.8163 | -0.0430 [-0.1071,-0.0002] | non-domain by size 0.752 0.652 0.363 0.543 0.119 +[dom] + 0.25 * bin0.02 all=0.7376 dom=0.9000 non=0.5744 h5=0.8418 h20=0.9104 macro=0.8213 | -0.0008 [-0.0027,+0.0005] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.5 * bin0.02 all=0.7367 dom=0.8994 non=0.5734 h5=0.8418 h20=0.9104 macro=0.8207 | -0.0016 [-0.0059,+0.0028] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 1.0 * bin0.02 all=0.7365 dom=0.8991 non=0.5733 h5=0.8421 h20=0.9104 macro=0.8201 | -0.0019 [-0.0062,+0.0027] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 2.0 * bin0.02 all=0.7340 dom=0.8961 non=0.5712 h5=0.8419 h20=0.9105 macro=0.8187 | -0.0044 [-0.0095,+0.0008] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.25 * bin0.05 all=0.7382 dom=0.9011 non=0.5746 h5=0.8419 h20=0.9104 macro=0.8210 | -0.0002 [-0.0031,+0.0033] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.5 * bin0.05 all=0.7384 dom=0.9016 non=0.5746 h5=0.8418 h20=0.9094 macro=0.8213 | +0.0001 [-0.0029,+0.0036] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 1.0 * bin0.05 all=0.7374 dom=0.8997 non=0.5744 h5=0.8416 h20=0.9094 macro=0.8213 | -0.0010 [-0.0054,+0.0037] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 2.0 * bin0.05 all=0.7380 dom=0.9008 non=0.5746 h5=0.8414 h20=0.9095 macro=0.8228 | -0.0004 [-0.0048,+0.0043] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.25 * bin0.1 all=0.7390 dom=0.9027 non=0.5746 h5=0.8420 h20=0.9094 macro=0.8213 | +0.0006 [-0.0018,+0.0040] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.5 * bin0.1 all=0.7389 dom=0.9027 non=0.5745 h5=0.8424 h20=0.9096 macro=0.8207 | +0.0006 [-0.0019,+0.0039] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 1.0 * bin0.1 all=0.7367 dom=0.8986 non=0.5741 h5=0.8422 h20=0.9098 macro=0.8193 | -0.0017 [-0.0059,+0.0027] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 2.0 * bin0.1 all=0.7353 dom=0.8956 non=0.5743 h5=0.8419 h20=0.9097 macro=0.8187 | -0.0031 [-0.0068,+0.0001] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.25 * bin0.2 all=0.7390 dom=0.9029 non=0.5745 h5=0.8420 h20=0.9095 macro=0.8216 | +0.0007 [-0.0018,+0.0039] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.5 * bin0.2 all=0.7381 dom=0.9010 non=0.5745 h5=0.8421 h20=0.9097 macro=0.8207 | -0.0003 [-0.0035,+0.0033] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 1.0 * bin0.2 all=0.7343 dom=0.8938 non=0.5741 h5=0.8419 h20=0.9096 macro=0.8187 | -0.0041 [-0.0083,-0.0010] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 2.0 * bin0.2 all=0.7330 dom=0.8915 non=0.5739 h5=0.8417 h20=0.9096 macro=0.8160 | -0.0054 [-0.0096,-0.0019] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.25 * bin0.5 all=0.7386 dom=0.9022 non=0.5744 h5=0.8417 h20=0.9102 macro=0.8210 | +0.0003 [-0.0022,+0.0037] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.5 * bin0.5 all=0.7375 dom=0.8999 non=0.5744 h5=0.8420 h20=0.9102 macro=0.8198 | -0.0009 [-0.0039,+0.0029] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 1.0 * bin0.5 all=0.7348 dom=0.8949 non=0.5740 h5=0.8422 h20=0.9096 macro=0.8196 | -0.0036 [-0.0078,-0.0003] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 2.0 * bin0.5 all=0.7343 dom=0.8938 non=0.5742 h5=0.8423 h20=0.9095 macro=0.8187 | -0.0041 [-0.0083,-0.0004] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.25 * bin1 all=0.7388 dom=0.9024 non=0.5745 h5=0.8418 h20=0.9097 macro=0.8210 | +0.0004 [-0.0021,+0.0037] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 0.5 * bin1 all=0.7385 dom=0.9019 non=0.5745 h5=0.8411 h20=0.9095 macro=0.8201 | +0.0002 [-0.0023,+0.0034] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 1.0 * bin1 all=0.7361 dom=0.8965 non=0.5750 h5=0.8415 h20=0.9097 macro=0.8172 | -0.0023 [-0.0045,-0.0003] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[dom] + 2.0 * bin1 all=0.7354 dom=0.8953 non=0.5748 h5=0.8412 h20=0.9097 macro=0.8160 | -0.0030 [-0.0057,-0.0005] | non-domain by size 0.748 0.668 0.352 0.573 0.591 +[all] + 0.25 * each of 0.05/0.5 all=0.7325 dom=0.8995 non=0.5648 h5=0.8400 h20=0.9102 macro=0.8210 | -0.0059 [-0.0211,+0.0072] | non-domain by size 0.752 0.671 0.374 0.568 0.531 +[all] + 0.5 * each of 0.05/0.5 all=0.7326 dom=0.8975 non=0.5671 h5=0.8470 h20=0.9108 macro=0.8210 | -0.0058 [-0.0219,+0.0099] | non-domain by size 0.755 0.670 0.353 0.576 0.531 +[all] + 1.0 * each of 0.05/0.5 all=0.7296 dom=0.8937 non=0.5648 h5=0.8342 h20=0.9094 macro=0.8204 | -0.0088 [-0.0270,+0.0090] | non-domain by size 0.770 0.665 0.361 0.572 0.531 +[all] + 0.25 * each of 0.1/1 all=0.7351 dom=0.9011 non=0.5685 h5=0.8490 h20=0.9095 macro=0.8210 | -0.0032 [-0.0185,+0.0116] | non-domain by size 0.752 0.664 0.377 0.577 0.531 +[all] + 0.5 * each of 0.1/1 all=0.7311 dom=0.8971 non=0.5644 h5=0.8340 h20=0.9091 macro=0.8190 | -0.0073 [-0.0252,+0.0092] | non-domain by size 0.763 0.660 0.354 0.572 0.531 +[all] + 1.0 * each of 0.1/1 all=0.7247 dom=0.8935 non=0.5552 h5=0.8291 h20=0.9090 macro=0.8148 | -0.0137 [-0.0319,+0.0031] | non-domain by size 0.755 0.657 0.363 0.554 0.531 +[all] + 0.25 * each of 0.05/0.1/0.5 all=0.7355 dom=0.8981 non=0.5724 h5=0.8543 h20=0.9099 macro=0.8225 | -0.0028 [-0.0193,+0.0122] | non-domain by size 0.752 0.674 0.385 0.581 0.531 +[all] + 0.5 * each of 0.05/0.1/0.5 all=0.7296 dom=0.8944 non=0.5642 h5=0.8380 h20=0.9083 macro=0.8213 | -0.0087 [-0.0263,+0.0077] | non-domain by size 0.763 0.667 0.374 0.568 0.531 +[all] + 1.0 * each of 0.05/0.1/0.5 all=0.7236 dom=0.8934 non=0.5532 h5=0.8336 h20=0.9058 macro=0.8184 | -0.0148 [-0.0328,+0.0020] | non-domain by size 0.766 0.667 0.353 0.550 0.531 +[all] + 0.25 * each of 0.02/0.05/0.1/0.2/0.5/1 all=0.7278 dom=0.8947 non=0.5602 h5=0.8383 h20=0.9110 macro=0.8201 | -0.0106 [-0.0296,+0.0066] | non-domain by size 0.759 0.669 0.385 0.561 0.531 +[all] + 0.5 * each of 0.02/0.05/0.1/0.2/0.5/1 all=0.7250 dom=0.8923 non=0.5570 h5=0.8280 h20=0.9108 macro=0.8198 | -0.0134 [-0.0329,+0.0037] | non-domain by size 0.766 0.669 0.363 0.557 0.531 +[all] + 1.0 * each of 0.02/0.05/0.1/0.2/0.5/1 all=0.7231 dom=0.8917 non=0.5539 h5=0.8205 h20=0.9100 macro=0.8190 | -0.0152 [-0.0346,+0.0022] | non-domain by size 0.777 0.664 0.363 0.552 0.531 +[non] + 0.25 * each of 0.05/0.5 all=0.7331 dom=0.8996 non=0.5659 h5=0.8400 h20=0.9103 macro=0.8216 | -0.0053 [-0.0207,+0.0078] | non-domain by size 0.752 0.671 0.374 0.568 0.531 +[non] + 0.5 * each of 0.05/0.5 all=0.7329 dom=0.8982 non=0.5669 h5=0.8467 h20=0.9116 macro=0.8207 | -0.0055 [-0.0221,+0.0091] | non-domain by size 0.755 0.670 0.353 0.576 0.531 +[non] + 1.0 * each of 0.05/0.5 all=0.7319 dom=0.8980 non=0.5652 h5=0.8338 h20=0.9103 macro=0.8207 | -0.0064 [-0.0240,+0.0103] | non-domain by size 0.770 0.665 0.361 0.572 0.531 +[non] + 0.25 * each of 0.1/1 all=0.7353 dom=0.9000 non=0.5700 h5=0.8487 h20=0.9103 macro=0.8213 | -0.0030 [-0.0180,+0.0111] | non-domain by size 0.752 0.664 0.377 0.577 0.531 +[non] + 0.5 * each of 0.1/1 all=0.7320 dom=0.8989 non=0.5644 h5=0.8338 h20=0.9099 macro=0.8204 | -0.0064 [-0.0241,+0.0098] | non-domain by size 0.763 0.660 0.354 0.572 0.531 +[non] + 1.0 * each of 0.1/1 all=0.7272 dom=0.8986 non=0.5551 h5=0.8299 h20=0.9101 macro=0.8178 | -0.0112 [-0.0291,+0.0048] | non-domain by size 0.755 0.657 0.363 0.554 0.531 +[non] + 0.25 * each of 0.05/0.1/0.5 all=0.7357 dom=0.8985 non=0.5722 h5=0.8541 h20=0.9106 macro=0.8225 | -0.0027 [-0.0190,+0.0116] | non-domain by size 0.752 0.674 0.385 0.581 0.531 +[non] + 0.5 * each of 0.05/0.1/0.5 all=0.7309 dom=0.8976 non=0.5636 h5=0.8375 h20=0.9091 macro=0.8210 | -0.0075 [-0.0252,+0.0087] | non-domain by size 0.763 0.667 0.374 0.568 0.531 +[non] + 1.0 * each of 0.05/0.1/0.5 all=0.7255 dom=0.8976 non=0.5528 h5=0.8338 h20=0.9066 macro=0.8196 | -0.0129 [-0.0312,+0.0039] | non-domain by size 0.766 0.667 0.353 0.550 0.531 +[non] + 0.25 * each of 0.02/0.05/0.1/0.2/0.5/1 all=0.7295 dom=0.8976 non=0.5608 h5=0.8376 h20=0.9117 macro=0.8213 | -0.0089 [-0.0274,+0.0076] | non-domain by size 0.759 0.669 0.385 0.561 0.531 +[non] + 0.5 * each of 0.02/0.05/0.1/0.2/0.5/1 all=0.7279 dom=0.8976 non=0.5576 h5=0.8281 h20=0.9115 macro=0.8207 | -0.0104 [-0.0286,+0.0060] | non-domain by size 0.766 0.669 0.363 0.557 0.531 +[non] + 1.0 * each of 0.02/0.05/0.1/0.2/0.5/1 all=0.7262 dom=0.8974 non=0.5543 h5=0.8207 h20=0.9107 macro=0.8204 | -0.0122 [-0.0310,+0.0045] | non-domain by size 0.777 0.664 0.363 0.552 0.531 diff --git a/shared/package-files/80/8020bac8ebd76a2d5dfe8e5ba08c6714f0c22fc9dc981376b823ffee78c5bd50/synthlib-evaluate-bin001-modes.log b/shared/package-files/80/8020bac8ebd76a2d5dfe8e5ba08c6714f0c22fc9dc981376b823ffee78c5bd50/synthlib-evaluate-bin001-modes.log new file mode 100644 index 0000000000000000000000000000000000000000..0e8d4dda106962283326786f49cb9d99646cf5d2 --- /dev/null +++ b/shared/package-files/80/8020bac8ebd76a2d5dfe8e5ba08c6714f0c22fc9dc981376b823ffee78c5bd50/synthlib-evaluate-bin001-modes.log @@ -0,0 +1,88 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.281, to the average candidate 0.111 + domain: label 0.361, candidate 0.119, best similarity median 0.551 + other: label 0.200, candidate 0.103, best similarity median 0.453 +--- neighbour branch alone (per spectrum / pool mean) +frag k=20 p=3 debias ind all=0.2402 dom=0.3415 non=0.1385 | pool all=0.3952 dom=0.4849 non=0.3052 +frag k=20 p=3 rawdebias ind all=0.2402 dom=0.3415 non=0.1385 | pool all=0.3375 dom=0.4574 non=0.2171 +frag k=20 p=6 debias ind all=0.2372 dom=0.3387 non=0.1352 | pool all=0.3943 dom=0.4837 non=0.3046 +frag k=20 p=6 rawdebias ind all=0.2372 dom=0.3387 non=0.1352 | pool all=0.3083 dom=0.4202 non=0.1959 +loss k=20 p=3 debias ind all=0.2257 dom=0.3191 non=0.1320 | pool all=0.3465 dom=0.4290 non=0.2636 +loss k=20 p=3 rawdebias ind all=0.2257 dom=0.3191 non=0.1320 | pool all=0.3165 dom=0.3965 non=0.2361 +loss k=20 p=6 debias ind all=0.2189 dom=0.3112 non=0.1263 | pool all=0.3508 dom=0.4270 non=0.2743 +loss k=20 p=6 rawdebias ind all=0.2189 dom=0.3112 non=0.1263 | pool all=0.2831 dom=0.3717 non=0.1941 +sum k=20 p=3 debias ind all=0.3561 dom=0.5248 non=0.1867 | pool all=0.5151 dom=0.6536 non=0.3760 +sum k=20 p=3 rawdebias ind all=0.3561 dom=0.5248 non=0.1867 | pool all=0.5054 dom=0.6489 non=0.3613 +sum k=20 p=6 debias ind all=0.3372 dom=0.4959 non=0.1779 | pool all=0.4925 dom=0.6240 non=0.3604 +sum k=20 p=6 rawdebias ind all=0.3372 dom=0.4959 non=0.1779 | pool all=0.4502 dom=0.5994 non=0.3004 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8379 | +0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] +sum k=20 p=3 debias u=0.1/0 all=0.7505 dom=0.9134 non=0.5869 h5=0.8745 h20=0.9313 macro=0.8387 | +0.0024 [+0.0002,+0.0051] | ind 0.6017 +0.0005 [-0.0003,+0.0013] + pools +6 -3 | macro +0.0009 [-0.0009,+0.0027] | without top 20 +0.0027 [+0.0002,+0.0058] | weight min(n,30) +0.0027 [+0.0002,+0.0060] +sum k=20 p=3 debias u=0.25/0 all=0.7508 dom=0.9140 non=0.5870 h5=0.8760 h20=0.9319 macro=0.8390 | +0.0027 [+0.0004,+0.0057] | ind 0.6017 +0.0005 [-0.0008,+0.0019] + pools +11 -7 | macro +0.0012 [-0.0012,+0.0035] | without top 20 +0.0031 [+0.0004,+0.0065] | weight min(n,30) +0.0032 [+0.0004,+0.0067] +sum k=20 p=3 debias u=0.5/0 all=0.7519 dom=0.9157 non=0.5874 h5=0.8760 h20=0.9317 macro=0.8390 | +0.0038 [+0.0004,+0.0077] | ind 0.6012 -0.0001 [-0.0019,+0.0019] + pools +23 -19 | macro +0.0012 [-0.0024,+0.0050] | without top 20 +0.0042 [+0.0004,+0.0087] | weight min(n,30) +0.0043 [+0.0004,+0.0090] +sum k=20 p=3 debias u=1/0 all=0.7494 dom=0.9126 non=0.5857 h5=0.8756 h20=0.9315 macro=0.8364 | +0.0013 [-0.0032,+0.0064] | ind 0.6006 -0.0006 [-0.0033,+0.0022] + pools +27 -32 | macro -0.0015 [-0.0056,+0.0030] | without top 20 +0.0015 [-0.0038,+0.0070] | weight min(n,30) +0.0015 [-0.0038,+0.0072] +sum k=20 p=3 debias u=2/0 all=0.7512 dom=0.9122 non=0.5896 h5=0.8745 h20=0.9316 macro=0.8340 | +0.0031 [-0.0040,+0.0108] | ind 0.5990 -0.0022 [-0.0062,+0.0018] + pools +40 -53 | macro -0.0038 [-0.0095,+0.0015] | without top 20 +0.0035 [-0.0042,+0.0123] | weight min(n,30) +0.0029 [-0.0047,+0.0112] +sum k=20 p=3 debias u=0/0.25 all=0.7491 dom=0.9099 non=0.5876 h5=0.8748 h20=0.9301 macro=0.8376 | +0.0010 [-0.0069,+0.0101] | ind 0.6054 +0.0042 [+0.0016,+0.0069] + pools +13 -14 | macro -0.0003 [-0.0032,+0.0027] | without top 20 +0.0011 [-0.0078,+0.0110] | weight min(n,30) -0.0002 [-0.0083,+0.0074] +sum k=20 p=3 debias u=0/0.5 all=0.7486 dom=0.9101 non=0.5864 h5=0.8839 h20=0.9295 macro=0.8370 | +0.0005 [-0.0102,+0.0105] | ind 0.6050 +0.0038 [+0.0005,+0.0072] + pools +22 -25 | macro -0.0009 [-0.0047,+0.0030] | without top 20 +0.0005 [-0.0114,+0.0120] | weight min(n,30) -0.0007 [-0.0114,+0.0095] +sum k=20 p=3 debias u=0/1 all=0.7563 dom=0.9093 non=0.6028 h5=0.8801 h20=0.9301 macro=0.8358 | +0.0082 [-0.0077,+0.0306] | ind 0.6043 +0.0030 [-0.0014,+0.0074] + pools +32 -39 | macro -0.0021 [-0.0068,+0.0030] | without top 20 +0.0002 [-0.0135,+0.0135] | weight min(n,30) +0.0008 [-0.0122,+0.0131] +sum k=20 p=3 debias u=0/2 all=0.7762 dom=0.9084 non=0.6434 h5=0.8702 h20=0.9230 macro=0.8355 | +0.0281 [-0.0167,+0.0905] | ind 0.5983 -0.0029 [-0.0088,+0.0028] + pools +47 -55 | macro -0.0024 [-0.0080,+0.0035] | without top 20 -0.0089 [-0.0244,+0.0069] | weight min(n,30) -0.0055 [-0.0202,+0.0092] +sum k=20 p=6 rawdebias u=0.1/0 all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8379 | +0.0000 [+0.0000,+0.0000] | ind 0.6014 +0.0002 [-0.0001,+0.0005] + pools +0 -0 | macro +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +sum k=20 p=6 rawdebias u=0.25/0 all=0.7483 dom=0.9092 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8382 | +0.0002 [+0.0000,+0.0005] | ind 0.6013 +0.0001 [-0.0002,+0.0004] + pools +1 -0 | macro +0.0003 [+0.0000,+0.0009] | without top 20 +0.0002 [+0.0000,+0.0005] | weight min(n,30) +0.0002 [+0.0000,+0.0005] +sum k=20 p=6 rawdebias u=0.5/0 all=0.7484 dom=0.9095 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8385 | +0.0003 [+0.0000,+0.0008] | ind 0.6014 +0.0002 [-0.0002,+0.0007] + pools +2 -0 | macro +0.0006 [+0.0000,+0.0015] | without top 20 +0.0003 [+0.0000,+0.0009] | weight min(n,30) +0.0004 [+0.0000,+0.0009] +sum k=20 p=6 rawdebias u=1/0 all=0.7494 dom=0.9113 non=0.5869 h5=0.8744 h20=0.9313 macro=0.8393 | +0.0013 [+0.0002,+0.0030] | ind 0.6013 +0.0001 [-0.0005,+0.0007] + pools +5 -0 | macro +0.0015 [+0.0003,+0.0027] | without top 20 +0.0015 [+0.0002,+0.0034] | weight min(n,30) +0.0015 [+0.0002,+0.0034] +sum k=20 p=6 rawdebias u=2/0 all=0.7489 dom=0.9102 non=0.5869 h5=0.8744 h20=0.9313 macro=0.8382 | +0.0008 [-0.0006,+0.0027] | ind 0.6006 -0.0006 [-0.0015,+0.0005] + pools +5 -4 | macro +0.0003 [-0.0015,+0.0021] | without top 20 +0.0009 [-0.0006,+0.0029] | weight min(n,30) +0.0009 [-0.0007,+0.0030] +sum k=20 p=6 rawdebias u=0/0.25 all=0.7482 dom=0.9089 non=0.5869 h5=0.8742 h20=0.9313 macro=0.8379 | +0.0001 [-0.0003,+0.0006] | ind 0.6016 +0.0004 [-0.0001,+0.0009] + pools +1 -1 | macro +0.0000 [-0.0009,+0.0009] | without top 20 +0.0001 [-0.0003,+0.0007] | weight min(n,30) +0.0001 [-0.0003,+0.0007] +sum k=20 p=6 rawdebias u=0/0.5 all=0.7466 dom=0.9089 non=0.5837 h5=0.8742 h20=0.9313 macro=0.8376 | -0.0015 [-0.0051,+0.0005] | ind 0.6016 +0.0004 [-0.0001,+0.0011] + pools +1 -2 | macro -0.0003 [-0.0015,+0.0006] | without top 20 -0.0017 [-0.0056,+0.0006] | weight min(n,30) -0.0017 [-0.0055,+0.0006] +sum k=20 p=6 rawdebias u=0/1 all=0.7450 dom=0.9089 non=0.5805 h5=0.8742 h20=0.9313 macro=0.8373 | -0.0031 [-0.0081,+0.0005] | ind 0.6023 +0.0011 [+0.0003,+0.0021] + pools +2 -4 | macro -0.0006 [-0.0021,+0.0009] | without top 20 -0.0035 [-0.0093,+0.0005] | weight min(n,30) -0.0033 [-0.0089,+0.0006] +sum k=20 p=6 rawdebias u=0/2 all=0.7451 dom=0.9089 non=0.5806 h5=0.8741 h20=0.9309 macro=0.8373 | -0.0030 [-0.0081,+0.0005] | ind 0.6024 +0.0012 [+0.0001,+0.0024] + pools +3 -5 | macro -0.0006 [-0.0024,+0.0009] | without top 20 -0.0034 [-0.0092,+0.0006] | weight min(n,30) -0.0033 [-0.0088,+0.0006] +sum k=20 p=3 rawdebias u=0.1/0 all=0.7480 dom=0.9087 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8376 | -0.0001 [-0.0003,+0.0000] | ind 0.6014 +0.0002 [-0.0002,+0.0005] + pools +0 -1 | macro -0.0003 [-0.0009,+0.0000] | without top 20 -0.0001 [-0.0004,+0.0000] | weight min(n,30) -0.0001 [-0.0004,+0.0000] +sum k=20 p=3 rawdebias u=0.25/0 all=0.7488 dom=0.9100 non=0.5869 h5=0.8744 h20=0.9313 macro=0.8382 | +0.0007 [-0.0002,+0.0021] | ind 0.6014 +0.0002 [-0.0002,+0.0006] + pools +2 -1 | macro +0.0003 [-0.0006,+0.0012] | without top 20 +0.0008 [-0.0002,+0.0025] | weight min(n,30) +0.0008 [-0.0002,+0.0025] +sum k=20 p=3 rawdebias u=0.5/0 all=0.7489 dom=0.9103 non=0.5869 h5=0.8744 h20=0.9313 macro=0.8385 | +0.0008 [-0.0001,+0.0024] | ind 0.6013 +0.0001 [-0.0005,+0.0007] + pools +3 -1 | macro +0.0006 [-0.0006,+0.0018] | without top 20 +0.0009 [-0.0001,+0.0027] | weight min(n,30) +0.0010 [-0.0001,+0.0028] +sum k=20 p=3 rawdebias u=1/0 all=0.7490 dom=0.9105 non=0.5869 h5=0.8744 h20=0.9313 macro=0.8382 | +0.0009 [-0.0006,+0.0029] | ind 0.6015 +0.0003 [-0.0006,+0.0012] + pools +6 -5 | macro +0.0003 [-0.0015,+0.0024] | without top 20 +0.0010 [-0.0007,+0.0032] | weight min(n,30) +0.0011 [-0.0007,+0.0033] +sum k=20 p=3 rawdebias u=2/0 all=0.7490 dom=0.9107 non=0.5866 h5=0.8746 h20=0.9312 macro=0.8382 | +0.0009 [-0.0009,+0.0028] | ind 0.6014 +0.0002 [-0.0011,+0.0014] + pools +9 -8 | macro +0.0003 [-0.0021,+0.0027] | without top 20 +0.0010 [-0.0010,+0.0034] | weight min(n,30) +0.0010 [-0.0010,+0.0035] +sum k=20 p=3 rawdebias u=0/0.25 all=0.7469 dom=0.9089 non=0.5842 h5=0.8720 h20=0.9303 macro=0.8382 | -0.0012 [-0.0048,+0.0009] | ind 0.6021 +0.0009 [+0.0003,+0.0017] + pools +3 -2 | macro +0.0003 [-0.0009,+0.0015] | without top 20 -0.0014 [-0.0053,+0.0010] | weight min(n,30) -0.0014 [-0.0053,+0.0010] +sum k=20 p=3 rawdebias u=0/0.5 all=0.7468 dom=0.9089 non=0.5840 h5=0.8717 h20=0.9303 macro=0.8379 | -0.0013 [-0.0049,+0.0008] | ind 0.6028 +0.0016 [+0.0005,+0.0028] + pools +3 -3 | macro +0.0000 [-0.0015,+0.0015] | without top 20 -0.0015 [-0.0055,+0.0009] | weight min(n,30) -0.0015 [-0.0055,+0.0009] +sum k=20 p=3 rawdebias u=0/1 all=0.7460 dom=0.9089 non=0.5826 h5=0.8717 h20=0.9319 macro=0.8379 | -0.0021 [-0.0074,+0.0022] | ind 0.6038 +0.0026 [+0.0011,+0.0042] + pools +4 -4 | macro +0.0000 [-0.0015,+0.0018] | without top 20 -0.0023 [-0.0084,+0.0026] | weight min(n,30) -0.0021 [-0.0079,+0.0027] +sum k=20 p=3 rawdebias u=0/2 all=0.7452 dom=0.9089 non=0.5808 h5=0.8724 h20=0.9301 macro=0.8376 | -0.0029 [-0.0081,+0.0009] | ind 0.6053 +0.0041 [+0.0022,+0.0062] + pools +7 -8 | macro -0.0003 [-0.0027,+0.0021] | without top 20 -0.0033 [-0.0092,+0.0011] | weight min(n,30) -0.0032 [-0.0087,+0.0011] +--- diagnose ('sum', 20, 3.0, 'debias'): reference hit / branch hit + all per spectrum n=19429 both 0.3202 reference only 0.2810 branch only 0.0358 neither 0.3630 | P(branch | reference miss) 0.090 + all pool rule, per query n=19429 both 0.4843 reference only 0.2638 branch only 0.0307 neither 0.2212 | P(branch | reference miss) 0.122 + domain per spectrum n= 9734 both 0.4991 reference only 0.3818 branch only 0.0257 neither 0.0935 | P(branch | reference miss) 0.216 + domain pool rule, per query n= 9734 both 0.6276 reference only 0.2813 branch only 0.0260 neither 0.0651 | P(branch | reference miss) 0.285 + other per spectrum n= 9695 both 0.1407 reference only 0.1798 branch only 0.0460 neither 0.6335 | P(branch | reference miss) 0.068 + other pool rule, per query n= 9695 both 0.3405 reference only 0.2462 branch only 0.0355 neither 0.3778 | P(branch | reference miss) 0.086 + pools: reference 0.8379, branch 0.5851, either 0.8650, branch only 92 pools (597 spectra) + best similarity [0.0,0.3): n= 830 domain share 0.23 reference 0.458 branch 0.148 branch | reference miss 0.040 | pool rule: reference 0.645 branch 0.354 + best similarity [0.3,0.4): n= 3733 domain share 0.33 reference 0.479 branch 0.184 branch | reference miss 0.045 | pool rule: reference 0.681 branch 0.419 + best similarity [0.4,0.5): n= 5707 domain share 0.41 reference 0.513 branch 0.247 branch | reference miss 0.076 | pool rule: reference 0.701 branch 0.450 + best similarity [0.5,0.6): n= 3663 domain share 0.55 reference 0.630 branch 0.394 branch | reference miss 0.116 | pool rule: reference 0.763 branch 0.521 + best similarity [0.6,0.7): n= 2167 domain share 0.62 reference 0.698 branch 0.475 branch | reference miss 0.150 | pool rule: reference 0.794 branch 0.588 + best similarity [0.7,0.8): n= 1259 domain share 0.75 reference 0.814 branch 0.635 branch | reference miss 0.167 | pool rule: reference 0.872 branch 0.712 + best similarity [0.8,0.9): n= 1030 domain share 0.78 reference 0.820 branch 0.685 branch | reference miss 0.211 | pool rule: reference 0.871 branch 0.720 + best similarity [0.9,1.0): n= 787 domain share 0.81 reference 0.850 branch 0.701 branch | reference miss 0.288 | pool rule: reference 0.909 branch 0.738 diff --git a/shared/package-files/80/804a29288f1ea8fb3c6e8613a238eea80b61af5d6eed991e8e5a9039f0ae4531/recipe.json b/shared/package-files/80/804a29288f1ea8fb3c6e8613a238eea80b61af5d6eed991e8e5a9039f0ae4531/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..ef13292ba18525b97a6d950900c8efaff3d8e0cd --- /dev/null +++ b/shared/package-files/80/804a29288f1ea8fb3c6e8613a238eea80b61af5d6eed991e8e5a9039f0ae4531/recipe.json @@ -0,0 +1,54 @@ +{ + "initialization": "random", + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "subset": "all", + "config": { + "hidden_size": 256, + "graphormer_layers": 5, + "graphormer_dropout": 0.1, + "frag_decoder_layers": 4, + "frag_encoder_layers": 0, + "frag_dropout": 0.1, + "inten_decoder_layers": 4, + "inten_encoder_layers": 3, + "inten_dropout": 0.1, + "max_breakpoints": 200, + "max_broken_bonds": 6, + "multi_hop_max_dist": 10, + "num_edge_dis": 10, + "pe_embed_k": 14, + "embed_elem_group": true, + "embed_adduct": true, + "embed_collision": true, + "embed_instrument": true, + "encode_forms": true, + "num_bins": 150000, + "enable_aux_loss": true, + "enable_decoder_norm": false, + "sk_tau": 0.05, + "linsat_tau": 15, + "inten_weight": 1, + "frag_weight": 0.1, + "warmup": 2000, + "magma_warmup_steps": 2500, + "magma_decay_rate": 0.9, + "magma_decay_steps": 2500, + "inten_loss_fn": "cosine", + "lr": 0.0004, + "lr_decay_rate": 0.9, + "weight_decay": 0 + }, + "source_sha256": "5cc5255f6671ddba726b5d29553967093a187bfa4290fa80d9d81fb573fe0fe6", + "seed": 4, + "batch_size": 32, + "ema_decay": 0.999, + "limit_train": null, + "trainer": "allcond-plain-loop-v1", + "synthetic": { + "manifest_sha256": "431454e702f8da3194684fc9a565135d29a38a407aaa31e9399d871360c6e962", + "per_item": 1, + "weight": 1.0, + "schedule": "e2e", + "instrument": "flag" + } +} diff --git a/shared/package-files/80/806c224704c8bc0ba7f41f47420e717d727b018188b51163a2a0d12688e8f1ef/formula_errors.py b/shared/package-files/80/806c224704c8bc0ba7f41f47420e717d727b018188b51163a2a0d12688e8f1ef/formula_errors.py new file mode 100644 index 0000000000000000000000000000000000000000..37bcae31809dd170bf46880b226535627662329f --- /dev/null +++ b/shared/package-files/80/806c224704c8bc0ba7f41f47420e717d727b018188b51163a2a0d12688e8f1ef/formula_errors.py @@ -0,0 +1,44 @@ +"""Are pool-level failures wrong-formula or same-formula (isomer) confusions? (development only) + +Usage: formula_errors.py INPUT_ROOT SCORELAB_CACHE.pkl VARIANT +Reports Hit@1, share of top-1 candidates with the target's exact mass (same formula), and the +oracle Hit@1 when ranking only among same-formula candidates (upper bound for any formula-level +evidence). +""" +import collections, pickle, sys +from pathlib import Path +import numpy as np +sys.path.insert(0, '/workspace/research/allcond/analysis') +import scorelab, infer + +root = Path(sys.argv[1]) +queries = list(infer.read_jsonl(root / 'queries.jsonl')) +pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(root / 'candidate_pools.jsonl')} +ev = scorelab.Evaluator(queries, pools) +results = pickle.load(open(sys.argv[2], 'rb')) +dist, fallback = results[sys.argv[3]], results[next(iter(results))] +masses = pickle.load(open(f'/workspace/research/cache/{root.name}-candidate-masses.pkl', 'rb')) +rows = {} +for pid, members in ev.by_pool.items(): + ids, ms = masses[pid] + ds = [dist[i] if dist[i] is not None else fallback[i] for i in members] + ds = [d for d in ds if d is not None] + mean = np.mean(ds, axis=0) + order = np.lexsort((ev.ids[pid], mean)) + t = ev.target[members[0]] + same = np.abs(ms - ms[t]) < 1e-6 + rank = int(np.where(order == t)[0][0]) + oracle_rank = int(np.sum(same[order[:rank]])) + rows[pid] = (rank == 0, bool(same[order[0]]), oracle_rank == 0, int(same.sum()), len(np.unique(np.round(ms[np.isfinite(ms)], 6))), rank, oracle_rank) +groups = collections.defaultdict(list) +for i, q in enumerate(queries): + r = rows[q['candidate_pool_id']] + n = len(ev.by_pool[q['candidate_pool_id']]) + groups['all'].append(r) + groups[(q['adduct'], 'ce' if q['collision_energy'] is not None else 'ceNA', q['instrument_type'] or 'none')].append(r) + groups['pool_n>=16' if n >= 16 else 'pool_n<16'].append(r) +for key, rs in sorted(groups.items(), key=str): + a = np.array([r[:3] for r in rs], dtype=float) + print(f'{str(key):38s} n={len(rs):6d} hit1={a[:, 0].mean():.3f} top1_same_formula={a[:, 1].mean():.3f} oracle_formula_hit1={a[:, 2].mean():.3f} ' + f'same-formula cands median={np.median([r[3] for r in rs]):.0f} formulas median={np.median([r[4] for r in rs]):.0f} ' + f'oracle h5={np.mean([r[6] < 5 for r in rs]):.3f}') diff --git a/shared/package-files/80/808e5056e236a25d261be5dbf42b051d1502abf2e178a43f82697606e79a90b7/eval-S2-25k30k-full.log b/shared/package-files/80/808e5056e236a25d261be5dbf42b051d1502abf2e178a43f82697606e79a90b7/eval-S2-25k30k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..1a0da7983d20623836059e0d9cc16c4b42952638 --- /dev/null +++ b/shared/package-files/80/808e5056e236a25d261be5dbf42b051d1502abf2e178a43f82697606e79a90b7/eval-S2-25k30k-full.log @@ -0,0 +1,46 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 3, "inverse_members": 0, "workers": 12} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 50.92374444400775} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 54.9819132820121} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 2540748, "seconds": 59.923695651988965, "per_second": 1068.0249157475944} +{"event": "simulating", "finished": 128000, "total": 2540748, "seconds": 125.41248134800117, "per_second": 1020.6320664752566} +{"event": "simulating", "finished": 192000, "total": 2540748, "seconds": 193.38432302999718, "per_second": 992.841596421534} +{"event": "simulating", "finished": 256000, "total": 2540748, "seconds": 264.8499482789921, "per_second": 966.5850481130939} +{"event": "simulating", "finished": 320000, "total": 2540748, "seconds": 335.7564894899988, "per_second": 953.0716755052679} +{"event": "simulating", "finished": 384000, "total": 2540748, "seconds": 409.082338608001, "per_second": 938.6863322104064} +{"event": "simulating", "finished": 448000, "total": 2540748, "seconds": 483.8261023829982, "per_second": 925.9525225973894} +{"event": "simulating", "finished": 512000, "total": 2540748, "seconds": 559.6750590799929, "per_second": 914.8165380848625} +{"event": "simulating", "finished": 576000, "total": 2540748, "seconds": 631.6486759010004, "per_second": 911.899323114037} +{"event": "simulating", "finished": 640000, "total": 2540748, "seconds": 707.4018123459973, "per_second": 904.719197534328} +{"event": "simulating", "finished": 704000, "total": 2540748, "seconds": 785.6325658739952, "per_second": 896.0932000276985} +{"event": "simulating", "finished": 768000, "total": 2540748, "seconds": 863.4767333489872, "per_second": 889.4275552988191} +{"event": "simulating", "finished": 832000, "total": 2540748, "seconds": 940.7607462869928, "per_second": 884.3906415990982} +{"event": "simulating", "finished": 896000, "total": 2540748, "seconds": 1019.2980729709961, "per_second": 879.0362934645668} +{"event": "simulating", "finished": 960000, "total": 2540748, "seconds": 1102.422662483994, "per_second": 870.8093843398636} +{"event": "simulating", "finished": 1024000, "total": 2540748, "seconds": 1185.2494136079913, "per_second": 863.9531800170771} +{"event": "simulating", "finished": 1088000, "total": 2540748, "seconds": 1268.4835276709928, "per_second": 857.7170899472611} +{"event": "simulating", "finished": 1152000, "total": 2540748, "seconds": 1351.959942941001, "per_second": 852.0962518267991} +{"event": "simulating", "finished": 1216000, "total": 2540748, "seconds": 1438.407771973987, "per_second": 845.3791919736587} +{"event": "simulating", "finished": 1280000, "total": 2540748, "seconds": 1524.8684156109957, "per_second": 839.4166912343843} +{"event": "simulating", "finished": 1344000, "total": 2540748, "seconds": 1610.0097051229968, "per_second": 834.7775766341266} +{"event": "simulating", "finished": 1408000, "total": 2540748, "seconds": 1695.8735611309967, "per_second": 830.2505754385305} +{"event": "simulating", "finished": 1472000, "total": 2540748, "seconds": 1778.4892593169934, "per_second": 827.6687600381141} +{"event": "simulating", "finished": 1536000, "total": 2540748, "seconds": 1869.510703041, "per_second": 821.6053524066475} +{"event": "simulating", "finished": 1600000, "total": 2540748, "seconds": 1961.2580131919967, "per_second": 815.8029128436599} +{"event": "simulating", "finished": 1664000, "total": 2540748, "seconds": 2055.3866162009945, "per_second": 809.5800502367769} +{"event": "simulating", "finished": 1728000, "total": 2540748, "seconds": 2147.3948983349983, "per_second": 804.6959603656599} +{"event": "simulating", "finished": 1792000, "total": 2540748, "seconds": 2232.963301677999, "per_second": 802.5210260524078} +{"event": "simulating", "finished": 1856000, "total": 2540748, "seconds": 2331.4216501810006, "per_second": 796.0807946756045} +{"event": "simulating", "finished": 1920000, "total": 2540748, "seconds": 2431.232382793998, "per_second": 789.7229461025505} +{"event": "simulating", "finished": 1984000, "total": 2540748, "seconds": 2533.855806497988, "per_second": 782.9964100214775} +{"event": "simulating", "finished": 2048000, "total": 2540748, "seconds": 2636.1813685259986, "per_second": 776.8812967315387} +{"event": "simulating", "finished": 2112000, "total": 2540748, "seconds": 2744.242516569997, "per_second": 769.6112815276141} +{"event": "simulating", "finished": 2176000, "total": 2540748, "seconds": 2856.9577875999967, "per_second": 761.6493353330085} +{"event": "simulating", "finished": 2240000, "total": 2540748, "seconds": 2975.237965889988, "per_second": 752.8809546264125} +{"event": "simulating", "finished": 2304000, "total": 2540748, "seconds": 3105.9912965029944, "per_second": 741.792162326421} +{"event": "simulating", "finished": 2368000, "total": 2540748, "seconds": 3254.544817917995, "per_second": 727.5979076898572} +{"event": "simulating", "finished": 2432000, "total": 2540748, "seconds": 3425.149855962998, "per_second": 710.0419258345796} +{"event": "simulating", "finished": 2496000, "total": 2540748, "seconds": 3620.0482075779873, "per_second": 689.4935804376931} +{"event": "simulated", "finished": 2540748, "total": 2540748, "failed": 0, "seconds": 3772.4106696339877} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 41.20556740798929, "total_seconds": 3889.245824644997} diff --git a/shared/package-files/80/80a21ad82da774cad3d320b4bb84b4b02ffeafddb6e69c822d8a3509071890b9/within_pool_variation.py b/shared/package-files/80/80a21ad82da774cad3d320b4bb84b4b02ffeafddb6e69c822d8a3509071890b9/within_pool_variation.py new file mode 100644 index 0000000000000000000000000000000000000000..94e9d103f4a49cbdad4bd0251d9b13fc0e2f90b8 --- /dev/null +++ b/shared/package-files/80/80a21ad82da774cad3d320b4bb84b4b02ffeafddb6e69c822d8a3509071890b9/within_pool_variation.py @@ -0,0 +1,38 @@ +import json, collections +import numpy as np +queries = [json.loads(l) for l in open('validation-input/queries.jsonl')] +pools = collections.defaultdict(list) +for q in queries: + if q.get('instrument_type') == 'Orbitrap' and q.get('collision_energy') is None: + pools[(q['candidate_pool_id'], q['adduct'])].append(q) +def vec(q): + mz = np.asarray(q['mzs']); it = np.asarray(q['intensities'], float) + keep = mz < q['precursor_mz'] - 0.5 + d = collections.defaultdict(float) + for m, i in zip(mz[keep], it[keep]): + d[int(round(m / 0.02))] += np.sqrt(i) + return d +def cos(a, b): + s = sum(v * b.get(k, 0.0) + 0 for k, v in a.items()) + s2 = sum(v * (b.get(k - 1, 0.0) + b.get(k + 1, 0.0)) for k, v in a.items()) + na = np.sqrt(sum(v * v for v in a.values())); nb = np.sqrt(sum(v * v for v in b.values())) + return (s + 0.5 * s2) / max(na * nb, 1e-12) +rng = np.random.default_rng(0) +stats = [] +for (pid, adduct), qs in pools.items(): + if len(qs) < 16: continue + vs = [vec(q) for q in qs] + pairs = [(int(a), int(b)) for a, b in rng.integers(0, len(qs), (200, 2)) if a != b] + cs = np.array([cos(vs[a], vs[b]) for a, b in pairs]) + wm = [] # intensity-weighted mean fragment m/z relative to the precursor + surv = [] # precursor share + for q in qs: + mz = np.asarray(q['mzs']); it = np.asarray(q['intensities'], float) + frag = mz < q['precursor_mz'] - 0.5 + if frag.any(): wm.append((mz[frag] * it[frag]).sum() / it[frag].sum() / q['precursor_mz']) + surv.append(it[~frag].sum() / it.sum()) + stats.append((len(qs), np.median(cs), np.quantile(cs, 0.1), np.quantile(cs, 0.9), np.std(wm), np.mean(surv), np.std(surv), np.mean([len(q['mzs']) for q in qs]))) +s = np.array(stats) +print('pools', len(s), 'spectra', int(s[:, 0].sum())) +for name, col in (('median pairwise cosine', 1), ('10% quantile cosine', 2), ('90% quantile cosine', 3), ('std of weighted mean fragment m/z / precursor', 4), ('mean precursor share', 5), ('std precursor share', 6), ('mean peaks', 7)): + print(f'{name}: quartiles over pools {np.quantile(s[:, col], [0.1, 0.25, 0.5, 0.75, 0.9]).round(3)}') diff --git a/shared/package-files/80/80bcc7a79c93636ce2bccdb38fd9104d215f49f57b549a56142bf1222ba2ac8d/swap-I16-w1.0_0.05_0.5.log b/shared/package-files/80/80bcc7a79c93636ce2bccdb38fd9104d215f49f57b549a56142bf1222ba2ac8d/swap-I16-w1.0_0.05_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..e32c5292b6849843f1d975cf772635d1b1c80e00 --- /dev/null +++ b/shared/package-files/80/80bcc7a79c93636ce2bccdb38fd9104d215f49f57b549a56142bf1222ba2ac8d/swap-I16-w1.0_0.05_0.5.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7699 pool-macro 0.8636 Hit@5 0.8796 Hit@20 0.9409 | twin pools 354 (macro 0.7627), others macro 0.8753 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4496 (domain 0.4191 / other 0.4801) macro 0.3816 + lam 1.00/1.00: Hit@1 0.8089 (+0.0390 [+0.0185, +0.0653]) macro +0.0157 [+0.0095, +0.0219] pools +85 -32 | no top 20 +0.0300 cap30 +0.0315 [+0.0170, +0.0463] | Hit@5 -0.0045 macro@5 +0.0074 cap30@5 +0.0133 +without consensus term: Hit@1 0.7699 (ref 0.7713; -0.0014 [-0.0080, +0.0044]) macro 0.8636 (+0.0044 [-0.0003, +0.0092]) pools +42 -27 cap30 -0.0012 | Hit@5 0.8796 (-0.0001) Hit@20 0.9409 (+0.0032) + domain 0.9363 (+0.0049) other 0.6029 (-0.0077) | Orbitrap no energy 0.5659 (-0.0105) | above 850 0.4159 (+0.0014) below 850 0.8506 (-0.0020) +full rule : Hit@1 0.8089 (ref 0.8022; +0.0068 [-0.0013, +0.0167]) macro 0.8792 (+0.0053 [+0.0009, +0.0097]) pools +42 -24 cap30 +0.0058 | Hit@5 0.8751 (+0.0032) Hit@20 0.9138 (-0.0025) + domain 0.9419 (+0.0054) other 0.6755 (+0.0081) | Orbitrap no energy 0.6469 (+0.0067) | above 850 0.5411 (-0.0036) below 850 0.8700 (+0.0092) diff --git a/shared/package-files/80/80f16c29663223efd03d0605ee3701e669c8c1e0a4559c2cebd2eb2740bbb110/replay-5Ms-I1+I3x2-L-val-sub.log b/shared/package-files/80/80f16c29663223efd03d0605ee3701e669c8c1e0a4559c2cebd2eb2740bbb110/replay-5Ms-I1+I3x2-L-val-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..e9d4e1a92d73011264e2536fe6fd04e787be393e --- /dev/null +++ b/shared/package-files/80/80f16c29663223efd03d0605ee3701e669c8c1e0a4559c2cebd2eb2740bbb110/replay-5Ms-I1+I3x2-L-val-sub.log @@ -0,0 +1,17 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 5, "inverse_members": 3, "library": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 6.01388834300451} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 6.417088738002349} +{"event": "candidate_store", "pools": 413, "pairs": 119929, "seconds": 9.769671813992318} +{"event": "library", "scored": 2147, "search_seconds": 10.852026759996079, "seconds": 12.393243230995722} +{"event": "inverse_annotated", "pools": 413, "pairs": 119929, "formulae": 19543, "unsupported_candidates": 938, "seconds": 0.00020573899382725358} +{"event": "inverse", "scored": 2147, "seconds": 7.606186461998732} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 210.02067063900176, "per_second": 304.73190950812494} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 435.0456529009971, "per_second": 294.221995200878} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 671.0377503039927, "per_second": 286.12399214950335} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 936.9425924719981, "per_second": 273.22911996622776} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 1178.043878995988} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 5.060491862008348, "total_seconds": 1234.0773055150057} +{"event": "measured", "exit_code": 0, "wall_seconds": 1236.1, "user_seconds": 2385.2, "system_seconds": 41.2, "max_rss_gib": 3.46} +{"event": "replay_checked", "exit_code": 0, "package_files": 238, "package_unchanged": true, "processes_left": 0, "rankings": 2147} diff --git a/shared/package-files/80/80fb9fac10628e17b4e791a5fee028cc7a46671b6e35d357d1979593fffc1ded/release-rule-grid5-min.log b/shared/package-files/80/80fb9fac10628e17b4e791a5fee028cc7a46671b6e35d357d1979593fffc1ded/release-rule-grid5-min.log new file mode 100644 index 0000000000000000000000000000000000000000..7eaf384f2a2bdb030ddddbad1d524a745456e27a --- /dev/null +++ b/shared/package-files/80/80fb9fac10628e17b4e791a5fee028cc7a46671b6e35d357d1979593fffc1ded/release-rule-grid5-min.log @@ -0,0 +1,13 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.161, to the average candidate 0.102 + domain: label 0.153, candidate 0.105, best similarity median 0.442 + other: label 0.168, candidate 0.098, best similarity median 0.444 +--- neighbour branch alone (per spectrum / pool mean) +frag k=20 p=6 debias ind all=0.1356 dom=0.1437 non=0.1274 | pool all=0.1965 dom=0.1713 non=0.2219 +loss k=20 p=6 debias ind all=0.0691 dom=0.0593 non=0.0789 | pool all=0.1212 dom=0.0784 non=0.1642 +sum k=20 p=6 debias ind all=0.1682 dom=0.1791 non=0.1573 | pool all=0.2540 dom=0.2259 non=0.2821 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8379 | +0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] +forward rule-min.pkl all=0.7490 dom=0.9098 non=0.5876 h5=0.8693 h20=0.9275 macro=0.8370 | +0.0009 [-0.0092,+0.0110] | ind 0.6013 +0.0001 [-0.0028,+0.0033] + pools +13 -16 | macro -0.0009 [-0.0038,+0.0021] | without top 20 +0.0010 [-0.0101,+0.0126] | weight min(n,30) -0.0005 [-0.0098,+0.0087] +sum k=20 p=6 debias u=0/0 all=0.7490 dom=0.9098 non=0.5876 h5=0.8693 h20=0.9275 macro=0.8370 | +0.0009 [-0.0092,+0.0110] | ind 0.6013 +0.0001 [-0.0028,+0.0033] + pools +13 -16 | macro -0.0009 [-0.0038,+0.0021] | without top 20 +0.0010 [-0.0101,+0.0126] | weight min(n,30) -0.0005 [-0.0098,+0.0087] diff --git a/shared/package-files/81/81193bf9f0264515459b79ba5b3f6687b9e9549c8177435496842f696172502d/replay-A10k-full.log b/shared/package-files/81/81193bf9f0264515459b79ba5b3f6687b9e9549c8177435496842f696172502d/replay-A10k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..e39849724c1dcb965b7a4bf1196639533eb89ab6 --- /dev/null +++ b/shared/package-files/81/81193bf9f0264515459b79ba5b3f6687b9e9549c8177435496842f696172502d/replay-A10k-full.log @@ -0,0 +1,50 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 1, "workers": 12} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 43.43249565199949} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 46.86666275304742} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 2540748, "seconds": 24.4172621689504, "per_second": 2621.096483183278} +{"event": "simulating", "finished": 128000, "total": 2540748, "seconds": 49.27648829796817, "per_second": 2597.587701988858} +{"event": "simulating", "finished": 192000, "total": 2540748, "seconds": 74.54458157892805, "per_second": 2575.6399181972706} +{"event": "simulating", "finished": 256000, "total": 2540748, "seconds": 100.63361610390712, "per_second": 2543.8815567918436} +{"event": "simulating", "finished": 320000, "total": 2540748, "seconds": 126.42749130097218, "per_second": 2531.0950704401057} +{"event": "simulating", "finished": 384000, "total": 2540748, "seconds": 153.25902815093286, "per_second": 2505.562018975015} +{"event": "simulating", "finished": 448000, "total": 2540748, "seconds": 180.301196016022, "per_second": 2484.731160408884} +{"event": "simulating", "finished": 512000, "total": 2540748, "seconds": 207.52952372992877, "per_second": 2467.1188503583608} +{"event": "simulating", "finished": 576000, "total": 2540748, "seconds": 234.61112837295514, "per_second": 2455.1265065498} +{"event": "simulating", "finished": 640000, "total": 2540748, "seconds": 262.7180172809167, "per_second": 2436.0719779476212} +{"event": "simulating", "finished": 704000, "total": 2540748, "seconds": 290.8420016330201, "per_second": 2420.558227653433} +{"event": "simulating", "finished": 768000, "total": 2540748, "seconds": 319.039070919971, "per_second": 2407.2286751131123} +{"event": "simulating", "finished": 832000, "total": 2540748, "seconds": 346.9580602099886, "per_second": 2397.9843543523693} +{"event": "simulating", "finished": 896000, "total": 2540748, "seconds": 375.6298790680012, "per_second": 2385.3267536201374} +{"event": "simulating", "finished": 960000, "total": 2540748, "seconds": 405.0995012889616, "per_second": 2369.788155614692} +{"event": "simulating", "finished": 1024000, "total": 2540748, "seconds": 434.6958984119119, "per_second": 2355.669799832506} +{"event": "simulating", "finished": 1088000, "total": 2540748, "seconds": 464.1340295759728, "per_second": 2344.1504623006927} +{"event": "simulating", "finished": 1152000, "total": 2540748, "seconds": 493.9691346909385, "per_second": 2332.129518012844} +{"event": "simulating", "finished": 1216000, "total": 2540748, "seconds": 524.5349986089859, "per_second": 2318.243783970011} +{"event": "simulating", "finished": 1280000, "total": 2540748, "seconds": 555.5626306789927, "per_second": 2303.970658421753} +{"event": "simulating", "finished": 1344000, "total": 2540748, "seconds": 585.7092365159187, "per_second": 2294.6539275951336} +{"event": "simulating", "finished": 1408000, "total": 2540748, "seconds": 616.5159930710215, "per_second": 2283.801257103481} +{"event": "simulating", "finished": 1472000, "total": 2540748, "seconds": 648.2433160420042, "per_second": 2270.75229867024} +{"event": "simulating", "finished": 1536000, "total": 2540748, "seconds": 680.335580858984, "per_second": 2257.7093469970564} +{"event": "simulating", "finished": 1600000, "total": 2540748, "seconds": 712.426585214911, "per_second": 2245.845443172707} +{"event": "simulating", "finished": 1664000, "total": 2540748, "seconds": 746.3598282439634, "per_second": 2229.487623838306} +{"event": "simulating", "finished": 1728000, "total": 2540748, "seconds": 780.2159745480167, "per_second": 2214.7713663528098} +{"event": "simulating", "finished": 1792000, "total": 2540748, "seconds": 813.5491245789453, "per_second": 2202.694276055493} +{"event": "simulating", "finished": 1856000, "total": 2540748, "seconds": 848.2436308229808, "per_second": 2188.050617249288} +{"event": "simulating", "finished": 1920000, "total": 2540748, "seconds": 883.7304653499741, "per_second": 2172.6081370745133} +{"event": "simulating", "finished": 1984000, "total": 2540748, "seconds": 920.8725940720178, "per_second": 2154.478277203284} +{"event": "simulating", "finished": 2048000, "total": 2540748, "seconds": 957.4128554239869, "per_second": 2139.0980791594347} +{"event": "simulating", "finished": 2112000, "total": 2540748, "seconds": 995.6748110369081, "per_second": 2121.1744804516416} +{"event": "simulating", "finished": 2176000, "total": 2540748, "seconds": 1035.7290405689273, "per_second": 2100.935587173186} +{"event": "simulating", "finished": 2240000, "total": 2540748, "seconds": 1078.3190849300008, "per_second": 2077.3072009065013} +{"event": "simulating", "finished": 2304000, "total": 2540748, "seconds": 1125.5329037109623, "per_second": 2047.0303377214009} +{"event": "simulating", "finished": 2368000, "total": 2540748, "seconds": 1179.9552605259232, "per_second": 2006.8557505684987} +{"event": "simulating", "finished": 2432000, "total": 2540748, "seconds": 1238.3790306039155, "per_second": 1963.8575427217918} +{"event": "simulating", "finished": 2496000, "total": 2540748, "seconds": 1307.0927468249574, "per_second": 1909.581401980083} +{"event": "simulated", "finished": 2540748, "total": 2540748, "failed": 0, "seconds": 1362.082833730965} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 16.648691146052442, "total_seconds": 1440.2481051560026} + +real 24m2.075s +user 154m21.827s +sys 3m54.741s diff --git a/shared/package-files/81/81193bf9f0264515459b79ba5b3f6687b9e9549c8177435496842f696172502d/replay.log b/shared/package-files/81/81193bf9f0264515459b79ba5b3f6687b9e9549c8177435496842f696172502d/replay.log new file mode 100644 index 0000000000000000000000000000000000000000..e39849724c1dcb965b7a4bf1196639533eb89ab6 --- /dev/null +++ b/shared/package-files/81/81193bf9f0264515459b79ba5b3f6687b9e9549c8177435496842f696172502d/replay.log @@ -0,0 +1,50 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 1, "workers": 12} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 43.43249565199949} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 46.86666275304742} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 2540748, "seconds": 24.4172621689504, "per_second": 2621.096483183278} +{"event": "simulating", "finished": 128000, "total": 2540748, "seconds": 49.27648829796817, "per_second": 2597.587701988858} +{"event": "simulating", "finished": 192000, "total": 2540748, "seconds": 74.54458157892805, "per_second": 2575.6399181972706} +{"event": "simulating", "finished": 256000, "total": 2540748, "seconds": 100.63361610390712, "per_second": 2543.8815567918436} +{"event": "simulating", "finished": 320000, "total": 2540748, "seconds": 126.42749130097218, "per_second": 2531.0950704401057} +{"event": "simulating", "finished": 384000, "total": 2540748, "seconds": 153.25902815093286, "per_second": 2505.562018975015} +{"event": "simulating", "finished": 448000, "total": 2540748, "seconds": 180.301196016022, "per_second": 2484.731160408884} +{"event": "simulating", "finished": 512000, "total": 2540748, "seconds": 207.52952372992877, "per_second": 2467.1188503583608} +{"event": "simulating", "finished": 576000, "total": 2540748, "seconds": 234.61112837295514, "per_second": 2455.1265065498} +{"event": "simulating", "finished": 640000, "total": 2540748, "seconds": 262.7180172809167, "per_second": 2436.0719779476212} +{"event": "simulating", "finished": 704000, "total": 2540748, "seconds": 290.8420016330201, "per_second": 2420.558227653433} +{"event": "simulating", "finished": 768000, "total": 2540748, "seconds": 319.039070919971, "per_second": 2407.2286751131123} +{"event": "simulating", "finished": 832000, "total": 2540748, "seconds": 346.9580602099886, "per_second": 2397.9843543523693} +{"event": "simulating", "finished": 896000, "total": 2540748, "seconds": 375.6298790680012, "per_second": 2385.3267536201374} +{"event": "simulating", "finished": 960000, "total": 2540748, "seconds": 405.0995012889616, "per_second": 2369.788155614692} +{"event": "simulating", "finished": 1024000, "total": 2540748, "seconds": 434.6958984119119, "per_second": 2355.669799832506} +{"event": "simulating", "finished": 1088000, "total": 2540748, "seconds": 464.1340295759728, "per_second": 2344.1504623006927} +{"event": "simulating", "finished": 1152000, "total": 2540748, "seconds": 493.9691346909385, "per_second": 2332.129518012844} +{"event": "simulating", "finished": 1216000, "total": 2540748, "seconds": 524.5349986089859, "per_second": 2318.243783970011} +{"event": "simulating", "finished": 1280000, "total": 2540748, "seconds": 555.5626306789927, "per_second": 2303.970658421753} +{"event": "simulating", "finished": 1344000, "total": 2540748, "seconds": 585.7092365159187, "per_second": 2294.6539275951336} +{"event": "simulating", "finished": 1408000, "total": 2540748, "seconds": 616.5159930710215, "per_second": 2283.801257103481} +{"event": "simulating", "finished": 1472000, "total": 2540748, "seconds": 648.2433160420042, "per_second": 2270.75229867024} +{"event": "simulating", "finished": 1536000, "total": 2540748, "seconds": 680.335580858984, "per_second": 2257.7093469970564} +{"event": "simulating", "finished": 1600000, "total": 2540748, "seconds": 712.426585214911, "per_second": 2245.845443172707} +{"event": "simulating", "finished": 1664000, "total": 2540748, "seconds": 746.3598282439634, "per_second": 2229.487623838306} +{"event": "simulating", "finished": 1728000, "total": 2540748, "seconds": 780.2159745480167, "per_second": 2214.7713663528098} +{"event": "simulating", "finished": 1792000, "total": 2540748, "seconds": 813.5491245789453, "per_second": 2202.694276055493} +{"event": "simulating", "finished": 1856000, "total": 2540748, "seconds": 848.2436308229808, "per_second": 2188.050617249288} +{"event": "simulating", "finished": 1920000, "total": 2540748, "seconds": 883.7304653499741, "per_second": 2172.6081370745133} +{"event": "simulating", "finished": 1984000, "total": 2540748, "seconds": 920.8725940720178, "per_second": 2154.478277203284} +{"event": "simulating", "finished": 2048000, "total": 2540748, "seconds": 957.4128554239869, "per_second": 2139.0980791594347} +{"event": "simulating", "finished": 2112000, "total": 2540748, "seconds": 995.6748110369081, "per_second": 2121.1744804516416} +{"event": "simulating", "finished": 2176000, "total": 2540748, "seconds": 1035.7290405689273, "per_second": 2100.935587173186} +{"event": "simulating", "finished": 2240000, "total": 2540748, "seconds": 1078.3190849300008, "per_second": 2077.3072009065013} +{"event": "simulating", "finished": 2304000, "total": 2540748, "seconds": 1125.5329037109623, "per_second": 2047.0303377214009} +{"event": "simulating", "finished": 2368000, "total": 2540748, "seconds": 1179.9552605259232, "per_second": 2006.8557505684987} +{"event": "simulating", "finished": 2432000, "total": 2540748, "seconds": 1238.3790306039155, "per_second": 1963.8575427217918} +{"event": "simulating", "finished": 2496000, "total": 2540748, "seconds": 1307.0927468249574, "per_second": 1909.581401980083} +{"event": "simulated", "finished": 2540748, "total": 2540748, "failed": 0, "seconds": 1362.082833730965} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 16.648691146052442, "total_seconds": 1440.2481051560026} + +real 24m2.075s +user 154m21.827s +sys 3m54.741s diff --git a/shared/package-files/81/81488fb4b6c39255ddab88cf1ae3e29f07adb7566e836c528fdaea3d1cd92fac/fullfold-5Ms-I9b+I13-L-ion.report.json b/shared/package-files/81/81488fb4b6c39255ddab88cf1ae3e29f07adb7566e836c528fdaea3d1cd92fac/fullfold-5Ms-I9b+I13-L-ion.report.json new file mode 100644 index 0000000000000000000000000000000000000000..c25ced3982fe6c63e1b92608dd0f45f8d923c050 --- /dev/null +++ b/shared/package-files/81/81488fb4b6c39255ddab88cf1ae3e29f07adb7566e836c528fdaea3d1cd92fac/fullfold-5Ms-I9b+I13-L-ion.report.json @@ -0,0 +1,123 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.7713212208554223, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.6112343565935987, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.7713212208554223, + "hit_rate_at_20": 0.9376704925626641, + "hit_rate_at_5": 0.8796644191672243 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.01224972978537238, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.005442886246989952, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.020711831590026805 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8393683637353662, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.560270213215115, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.7709246557681398, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.9736842105263158, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.9408023483365949, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.9189534141671984, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.8483333333333334, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.9448717948717948, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.6065157605246456, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7407407407407407, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7631851085832472, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.8306709265175719, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.6106240330067045, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.9313745633860695, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.7713212208554223, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7152646121675463, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8192644176739697 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/81/81488fb4b6c39255ddab88cf1ae3e29f07adb7566e836c528fdaea3d1cd92fac/fullfold-5Ms-I9b+I13-L-ion.score.log b/shared/package-files/81/81488fb4b6c39255ddab88cf1ae3e29f07adb7566e836c528fdaea3d1cd92fac/fullfold-5Ms-I9b+I13-L-ion.score.log new file mode 100644 index 0000000000000000000000000000000000000000..c25ced3982fe6c63e1b92608dd0f45f8d923c050 --- /dev/null +++ b/shared/package-files/81/81488fb4b6c39255ddab88cf1ae3e29f07adb7566e836c528fdaea3d1cd92fac/fullfold-5Ms-I9b+I13-L-ion.score.log @@ -0,0 +1,123 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.7713212208554223, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.6112343565935987, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.7713212208554223, + "hit_rate_at_20": 0.9376704925626641, + "hit_rate_at_5": 0.8796644191672243 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.01224972978537238, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.005442886246989952, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.020711831590026805 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8393683637353662, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.560270213215115, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.7709246557681398, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.9736842105263158, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.9408023483365949, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.9189534141671984, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.8483333333333334, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.9448717948717948, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.6065157605246456, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7407407407407407, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7631851085832472, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.8306709265175719, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.6106240330067045, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.9313745633860695, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.7713212208554223, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7152646121675463, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8192644176739697 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/81/815b75ad4e92febf1931f81f8535d50ae2652460d93641531c5305db29a095ef/model_manifest.json b/shared/package-files/81/815b75ad4e92febf1931f81f8535d50ae2652460d93641531c5305db29a095ef/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..d1684af6a5b215595382bdcb63a4a4776276f74b --- /dev/null +++ b/shared/package-files/81/815b75ad4e92febf1931f81f8535d50ae2652460d93641531c5305db29a095ef/model_manifest.json @@ -0,0 +1,13 @@ +{ + "schema": "massspecgym-retrieval-model/v1", + "checkpoint": { + "path": "model.pt", + "sha256": "7a957abb094d676e788e12b112be735d99b3f178ce2e01932f790f23a73845a1", + "format": "pytorch" + }, + "model_config": "model_config.json", + "training_provenance": { + "data": "MassSpecGym v1.5 train fold", + "pretrained_assets": [] + } +} diff --git a/shared/package-files/81/8178b1f0ceae2973fe7ec00b1805cc21e757a89e7bd7676e52b4c5e02fdab6b5/eval-score-N5-recur-mof-10.log b/shared/package-files/81/8178b1f0ceae2973fe7ec00b1805cc21e757a89e7bd7676e52b4c5e02fdab6b5/eval-score-N5-recur-mof-10.log new file mode 100644 index 0000000000000000000000000000000000000000..5761eef58b4fcc2f864a4e5e0d47525d8d3b227b --- /dev/null +++ b/shared/package-files/81/8178b1f0ceae2973fe7ec00b1805cc21e757a89e7bd7676e52b4c5e02fdab6b5/eval-score-N5-recur-mof-10.log @@ -0,0 +1,41 @@ +19429 queries, 5 members, 80.8 s +cos pool rule all=0.6602 dom=0.8484 non=0.4713 h5=0.7751 macro=0.7315 +cen pool rule all=0.6450 dom=0.8271 non=0.4622 h5=0.7735 macro=0.7088 +cos_pm pool rule all=0.6645 dom=0.8461 non=0.4822 h5=0.7762 macro=0.7312 +dot pool rule all=0.6500 dom=0.8111 non=0.4882 h5=0.7755 macro=0.7203 +geo pool rule all=0.6502 dom=0.8325 non=0.4670 h5=0.7574 macro=0.7183 +idf05 pool rule all=0.6677 dom=0.8451 non=0.4896 h5=0.7888 macro=0.7315 +idf1 pool rule all=0.6701 dom=0.8461 non=0.4935 h5=0.7902 macro=0.7327 +lin pool rule all=0.6059 dom=0.7990 non=0.4122 h5=0.7137 macro=0.6911 +log01 pool rule all=0.6542 dom=0.8388 non=0.4688 h5=0.7827 macro=0.7262 +log05 pool rule all=0.6657 dom=0.8542 non=0.4763 h5=0.7871 macro=0.7374 +log20 pool rule all=0.6687 dom=0.8556 non=0.4812 h5=0.7858 macro=0.7395 +nll02 pool rule all=0.4976 dom=0.7329 non=0.2614 h5=0.6436 macro=0.6043 +nll10 pool rule all=0.4439 dom=0.6773 non=0.2096 h5=0.6074 macro=0.5526 +poolcen pool rule all=0.6432 dom=0.8191 non=0.4665 h5=0.7815 macro=0.7103 +pow020 pool rule all=0.6048 dom=0.8112 non=0.3976 h5=0.7731 macro=0.7041 +pow030 pool rule all=0.6434 dom=0.8239 non=0.4622 h5=0.7728 macro=0.7123 +pow040 pool rule all=0.6571 dom=0.8388 non=0.4746 h5=0.7853 macro=0.7262 +pow05 pool rule all=0.6676 dom=0.8498 non=0.4846 h5=0.7938 macro=0.7318 +pow05idf025 pool rule all=0.6690 dom=0.8510 non=0.4862 h5=0.7984 macro=0.7354 +pow05idf05 pool rule all=0.6600 dom=0.8511 non=0.4681 h5=0.7909 macro=0.7354 +pow05m pool rule all=0.6656 dom=0.8509 non=0.4794 h5=0.7928 macro=0.7310 +pow05s pool rule all=0.6676 dom=0.8480 non=0.4865 h5=0.7946 macro=0.7310 +pow060 pool rule all=0.6695 dom=0.8535 non=0.4847 h5=0.7894 macro=0.7380 +pow060idf025 pool rule all=0.6668 dom=0.8511 non=0.4817 h5=0.7950 macro=0.7345 +pow060idf050 pool rule all=0.6719 dom=0.8528 non=0.4903 h5=0.7985 macro=0.7377 +pow060m pool rule all=0.6681 dom=0.8545 non=0.4810 h5=0.7888 macro=0.7363 +pow065 pool rule all=0.6721 dom=0.8535 non=0.4899 h5=0.7880 macro=0.7380 +pow070 pool rule all=0.6739 dom=0.8533 non=0.4939 h5=0.7829 macro=0.7386 +pow070idf025 pool rule all=0.6703 dom=0.8487 non=0.4912 h5=0.7889 macro=0.7372 +pow070idf050 pool rule all=0.6696 dom=0.8503 non=0.4882 h5=0.7919 macro=0.7369 +pow070m pool rule all=0.6683 dom=0.8545 non=0.4814 h5=0.7846 macro=0.7372 +pow075 pool rule all=0.6690 dom=0.8474 non=0.4898 h5=0.7816 macro=0.7354 +pow080 pool rule all=0.6674 dom=0.8460 non=0.4881 h5=0.7810 macro=0.7333 +pow080m pool rule all=0.6636 dom=0.8500 non=0.4765 h5=0.7784 macro=0.7351 +pow085 pool rule all=0.6650 dom=0.8450 non=0.4844 h5=0.7786 macro=0.7324 +pow085idf025 pool rule all=0.6680 dom=0.8475 non=0.4878 h5=0.7860 macro=0.7351 +pow085idf050 pool rule all=0.6696 dom=0.8491 non=0.4894 h5=0.7873 macro=0.7351 +pow090 pool rule all=0.6648 dom=0.8457 non=0.4832 h5=0.7793 macro=0.7324 +pow2 pool rule all=0.6005 dom=0.8091 non=0.3910 h5=0.7283 macro=0.7032 +tani pool rule all=0.6356 dom=0.8242 non=0.4463 h5=0.7789 macro=0.7126 diff --git a/shared/package-files/81/81798aaa8c7d026d1399c29d0ccb6e9876c4162636869eaeca07fef6d6f752ff/replay-5Ms-N5-L-ion-net-edge.log b/shared/package-files/81/81798aaa8c7d026d1399c29d0ccb6e9876c4162636869eaeca07fef6d6f752ff/replay-5Ms-N5-L-ion-net-edge.log new file mode 100644 index 0000000000000000000000000000000000000000..0d636a7e61bfcc759450bf4d7904e38bf635e950 --- /dev/null +++ b/shared/package-files/81/81798aaa8c7d026d1399c29d0ccb6e9876c4162636869eaeca07fef6d6f752ff/replay-5Ms-N5-L-ion-net-edge.log @@ -0,0 +1,15 @@ +{"event": "loaded", "queries": 204, "pools": 44, "members": 5, "inverse_members": 5, "library": true, "ion": true, "workers": 14} +{"event": "canonicalized", "unique_candidates": 10259, "unsupported": 81, "seconds": 1.5894774430198595} +{"event": "planned", "queries": 204, "groups": 131, "molecules": 12453, "simulations": 32328, "seconds": 1.6163057340309024} +{"event": "candidate_store", "pools": 44, "pairs": 10025, "seconds": 1.3381237990688533} +{"event": "intact_ion", "scored": 199, "seconds": 0.007259058998897672} +{"event": "library", "scored": 197, "search_seconds": 5.671955197001807, "seconds": 6.119584879023023} +{"event": "inverse_annotated", "pools": 44, "pairs": 10025, "formulae": 2002, "unsupported_candidates": 81, "seconds": 6.061594467610121e-05} +{"event": "inverse", "scored": 201, "seconds": 1.414467880036682} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 32328, "total": 32328, "failed": 0, "seconds": 68.62779937800951} +{"event": "consensus", "scored": 186, "pools": 44, "answers": 416, "search_seconds": 0.02597624494228512, "seconds": 0.06586426892317832} +{"event": "finished", "queries": 204, "unscored": 0, "directly_scored": 204, "scoring_seconds": 0.35300765302963555, "total_seconds": 92.15441776800435} +{"event": "measured", "exit_code": 0, "wall_seconds": 94.0, "user_seconds": 201.5, "system_seconds": 17.2, "max_rss_gib": 2.76} +{"event": "replay_checked", "exit_code": 0, "package_files": 305, "package_unchanged": true, "processes_left": 0, "rankings": 204} diff --git a/shared/package-files/81/81b7c9cccc6705058bdd03a67101a7450f3fcf1d5fa2ca01343dfd812c402a17/swap-prepare-N5-recur-ms10-p48.log b/shared/package-files/81/81b7c9cccc6705058bdd03a67101a7450f3fcf1d5fa2ca01343dfd812c402a17/swap-prepare-N5-recur-ms10-p48.log new file mode 100644 index 0000000000000000000000000000000000000000..b765a267cbf555f5cd37ee190952c32641686f46 --- /dev/null +++ b/shared/package-files/81/81b7c9cccc6705058bdd03a67101a7450f3fcf1d5fa2ca01343dfd812c402a17/swap-prepare-N5-recur-ms10-p48.log @@ -0,0 +1 @@ +wrote /workspace/research/evals/fullfold/swap-N5-recur-ms10-p48/pred 19429 diff --git a/shared/package-files/81/81c5f32fd4b63951970132f924bd3e67ab8300b56f2d0d80b383b855dbfb1081/train_inv.py b/shared/package-files/81/81c5f32fd4b63951970132f924bd3e67ab8300b56f2d0d80b383b855dbfb1081/train_inv.py new file mode 100644 index 0000000000000000000000000000000000000000..807d2430d43a087b5073080c4cd5d17837ffa235 --- /dev/null +++ b/shared/package-files/81/81c5f32fd4b63951970132f924bd3e67ab8300b56f2d0d80b383b855dbfb1081/train_inv.py @@ -0,0 +1,357 @@ +#!/usr/bin/env python3 +"""Train the inverse branch (``pkg/inverse.FormulaFormer``): annotated spectrum + formula -> Morgan-4096. + +Training rows: experimental train-fold spectra annotated under their label formula and the +supplied synthetic corpus (``prepare_inv.py``). Validation: (a) fingerprint loss / cosine on +validation spectra annotated under the label formula (diagnostic), (b) the real retrieval +protocol on an inference-style store (every candidate scored with the fingerprint predicted +under its own formula). Validation never contributes a gradient. +""" +import argparse +import copy +import hashlib +import json +import math +import sys +import time +from pathlib import Path + +import numpy as np +import torch +import torch.nn.functional as F + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +sys.path.insert(0, str(HERE)) +import inverse +import invdata +from invrun import PoolStore + + +def targets_of(input_root, cache): + """Index of the labelled candidate of every validation query (evaluation only).""" + cache = Path(cache) + if cache.exists(): + return np.load(cache) + labels = {} + for line in open('/workspace/data/validation.jsonl'): + row = json.loads(line) + labels[row['query_id']] = hashlib.sha256(row['target_smiles'].encode()).hexdigest() + ids = {} + for line in open(Path(input_root) / 'candidate_pools.jsonl'): + pool = json.loads(line) + ids[pool['candidate_pool_id']] = {c['candidate_id']: n for n, c in enumerate(pool['candidates'])} + target = np.array([ids[q['candidate_pool_id']][labels[q['query_id']]] + for q in map(json.loads, open(Path(input_root) / 'queries.jsonl'))], dtype=np.int32) + np.save(cache, target) + return target + + +def retrieval(store, target, dist, pools=None): + """Hit@1 per spectrum and with the pool mean; domain split is reported by the caller.""" + todo = range(len(store.members)) if pools is None else pools + ind, agg, n = 0, 0, 0 + for s in todo: + members = store.members[s] + d = np.stack([dist[i] for i in members]) + t = target[members] + mean = d.mean(0) + ind += int((np.argmin(d, axis=1) == t).sum()) # ties are measure-zero for float scores + agg += int((np.argmin(mean) == t).sum()) + n += len(members) + return ind / n, agg / n + + +def isomer_library(real, synth): + """Same-formula groups over the label molecules of the train fold and of the synthetic corpus. + + Returns (fps [M, bytes], order [M], start [M], size [M]): molecule m (train molecules first, + then synthetic ones) shares its formula with the molecules order[start[m] : start[m] + size[m]]. + No validation or test structure is involved. + """ + def roots(store): + mol = store['mol'].cpu().numpy() + first = np.full(store['fps'].shape[0], -1, dtype=np.int64) + first[mol[::-1]] = np.arange(len(mol))[::-1] + return store['root'].cpu().numpy()[first] + + parts = [roots(real)] + ([roots(synth)] if synth is not None else []) + _, group, counts = np.unique(np.concatenate(parts), axis=0, return_inverse=True, return_counts=True) + group = group.reshape(-1) + order = np.argsort(group, kind='stable') + begin = np.concatenate([[0], np.cumsum(counts)[:-1]]) + device = real['fps'].device + fps = torch.cat([real['fps']] + ([synth['fps']] if synth is not None else [])) + return (fps, torch.from_numpy(order).to(device), torch.from_numpy(begin[group]).to(device), + torch.from_numpy(counts[group]).to(device)) + + +def contrast_term(logits, bits, molecule, library, k, tau, generator): + """InfoNCE of the packaged score (cosine between predicted bit probabilities and a candidate + fingerprint) against ``k`` molecules sampled from the label's own formula group. + + Returns (loss per row [B], target-first indicator [B], rows with at least one decoy [B]).""" + fps, order, start, size = library + pick = (torch.rand(len(molecule), k, device=logits.device, generator=generator) * size[molecule].unsqueeze(1)).long() + decoy = order[start[molecule].unsqueeze(1) + pick.minimum(size[molecule].unsqueeze(1) - 1)] + packed = fps[decoy] # [B, k, bytes] + valid = (packed != fps[molecule].unsqueeze(1)).any(-1) # same fingerprint (or the label itself) = no decoy + cand = torch.cat([bits.unsqueeze(1), inverse.unpack_bits(packed)], dim=1) # [B, 1 + k, bits] + prob = torch.sigmoid(logits.float()) + sim = torch.einsum('bd,bkd->bk', F.normalize(prob, dim=-1), F.normalize(cand, dim=-1)) / tau + keep = torch.cat([torch.ones_like(valid[:, :1]), valid], dim=1) + sim = sim.masked_fill(~keep, float('-inf')) + return -F.log_softmax(sim, dim=1)[:, 0], sim.argmax(1) == 0, valid.any(1) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--store', type=Path, default=Path('/workspace/research/inv')) + p.add_argument('--out', type=Path, required=True) + p.add_argument('--pools', default='pools-validation-input.npz') + p.add_argument('--input', type=Path, default=Path('/workspace/research/validation-input')) + p.add_argument('--steps', type=int, default=100000) + p.add_argument('--batch', type=int, default=512) + p.add_argument('--real-frac', type=float, default=0.2) + p.add_argument('--real-balance', type=float, default=0.5, help='real sampling weight = spectra_of_molecule ** -x') + p.add_argument('--no-synth', action='store_true') + p.add_argument('--target', default='', + help='E56: alternative fingerprint target (inv/alt-NAME built by altfp.py); empty = released Morgan-4096') + p.add_argument('--heavy-boost', type=float, default=1.0, + help='E53: sampling weight of a row x (1 + (boost - 1) * clip((mass - lo) / (hi - lo), 0, 1)); 1 = off') + p.add_argument('--synth-structures', type=float, default=1.0, + help='E59: keep only this fraction of the synthetic STRUCTURES (hash of the structure slot); 1 = all') + p.add_argument('--extra-store', type=Path, + help='E60: additional simulated store in the prepare_inv layout (selfsim.py annotate: our own forward simulations of supplied structures)') + p.add_argument('--extra-frac', type=float, default=0.0, help='E60: share of the synthetic part of every batch drawn from --extra-store') + p.add_argument('--heavy-lo', type=float, default=450.0) + p.add_argument('--heavy-hi', type=float, default=850.0) + p.add_argument('--lr', type=float, default=6e-4) + p.add_argument('--weight-decay', type=float, default=1e-4) + p.add_argument('--warmup', type=int, default=2000) + p.add_argument('--ema', type=float, default=0.999) + p.add_argument('--dim', type=int, default=512) + p.add_argument('--layers', type=int, default=6) + p.add_argument('--heads', type=int, default=8) + p.add_argument('--dropout', type=float, default=0.1) + p.add_argument('--peak-drop', type=float, default=0.3) + p.add_argument('--truncate', type=float, default=0.3) + p.add_argument('--min-keep', type=int, default=4) + p.add_argument('--jitter', type=float, default=0.15) + p.add_argument('--synth-energy-drop', type=float, default=0.3) + p.add_argument('--synth-instrument-drop', type=float, default=0.3) + p.add_argument('--validate-every', type=int, default=5000) + p.add_argument('--retrieve-every', type=int, default=10000) + p.add_argument('--retrieve-pools', type=int, default=0, help='evaluate retrieval on every k-th pool only (0 = all)') + p.add_argument('--seed', type=int, default=1) + p.add_argument('--contrast-weight', type=float, default=0.0, + help='weight of the same-formula decoy InfoNCE term on the cosine score (0 = off)') + p.add_argument('--contrast-k', type=int, default=31, help='decoys sampled per spectrum from its formula group') + p.add_argument('--contrast-tau', type=float, default=0.05) + p.add_argument('--init', type=Path, help='start model and EMA from the EMA weights of one of OUR OWN runs (fresh optimizer)') + p.add_argument('--max-steps-this-run', type=int, default=0) + args = p.parse_args() + + torch.manual_seed(args.seed) + np.random.seed(args.seed) + device = torch.device('cuda') + torch.backends.cuda.matmul.allow_tf32 = True + torch.backends.cudnn.allow_tf32 = True + args.out.mkdir(parents=True, exist_ok=True) + started = time.monotonic() + real = invdata.load_padded(args.store / 'real-train.npz', device) + val = invdata.load_padded(args.store / 'real-validation.npz', device) + synth = None if args.no_synth else invdata.load_padded(args.store / 'synth.npz', device) + per_mol = torch.bincount(real['mol']).float() + real_weight = per_mol[real['mol']] ** -args.real_balance + synth_weight = None + if args.heavy_boost != 1.0: + mono = torch.tensor(inverse.MONO, dtype=torch.float32, device=device) + + def ramp(store): + mass = store['root'].float() @ mono + return 1.0 + (args.heavy_boost - 1.0) * ((mass - args.heavy_lo) / (args.heavy_hi - args.heavy_lo)).clamp(0, 1) + real_weight = real_weight * ramp(real) + if synth is not None: + synth_weight = ramp(synth) + if synth is not None and args.synth_structures < 1.0: + slot = synth['mol'].long() + keep = ((slot * 2654435761) % 4294967296).double() / 4294967296.0 < args.synth_structures + synth_weight = keep.float() if synth_weight is None else synth_weight * keep.float() + print(json.dumps({'synth_structures_kept': int(torch.unique(slot[keep]).numel()), 'synth_rows_kept': int(keep.sum())}), flush=True) + extra_store = invdata.load_padded(args.extra_store, device) if args.extra_store and args.extra_frac > 0 else None + if extra_store is not None: + assert synth is not None and not args.target and extra_store['fps'].shape[1] == synth['fps'].shape[1] + print(json.dumps({'extra_rows': int(extra_store['root'].shape[0]), 'extra_structures': int(torch.unique(extra_store['mol']).numel())}), flush=True) + pools = PoolStore(args.store / args.pools, device) if args.pools else None + fp_bits = inverse.FP_BITS + if args.target: + alt = args.store / f'alt-{args.target}' + for store, name in ((real, 'real-train'), (val, 'real-validation'), (synth, 'synth')): + if store is not None: + fps = torch.from_numpy(np.load(alt / f'{name}.fps.npy')).to(device) + assert fps.shape[0] == store['fps'].shape[0] + store['fps'] = fps + fp_bits = real['fps'].shape[1] * 8 + if pools is not None: + fps = torch.from_numpy(np.load(alt / (Path(args.pools).stem + '.cand_fps.npy'))).to(device) + assert fps.shape[0] == pools.cand_fps.shape[0] + pools.cand_fps = fps + target = targets_of(args.input, args.store / f'targets-{args.input.name}.npy') if pools else None + subset = None if not args.retrieve_pools else list(range(0, len(pools.members), args.retrieve_pools)) + domain = None + + model = inverse.FormulaFormer(dim=args.dim, layers=args.layers, heads=args.heads, dropout=args.dropout, fp_bits=fp_bits).to(device) + ema = copy.deepcopy(model).eval() + for q in ema.parameters(): + q.requires_grad_(False) + decay, no_decay = [], [] + for name, q in model.named_parameters(): + (no_decay if q.ndim < 2 else decay).append(q) + opt = torch.optim.AdamW([{'params': decay, 'weight_decay': args.weight_decay}, {'params': no_decay, 'weight_decay': 0.0}], + lr=args.lr, betas=(0.9, 0.98)) + schedule = lambda s: min(1.0, (s + 1) / args.warmup) * (0.02 + 0.98 * 0.5 * (1 + math.cos(math.pi * min(1.0, s / args.steps)))) + step = 0 + last = args.out / 'last.pt' + if args.init and not last.exists(): + state = torch.load(args.init, map_location=device, weights_only=True) + model.load_state_dict(state['ema']) + ema.load_state_dict(state['ema']) + if last.exists(): + state = torch.load(last, map_location=device) + model.load_state_dict(state['model']) + ema.load_state_dict(state['ema']) + opt.load_state_dict(state['opt']) + step = state['step'] + recipe = {'args': {k: str(v) if isinstance(v, Path) else v for k, v in vars(args).items()}, + 'parameters': sum(q.numel() for q in model.parameters()), 'model': model.config, + 'real_rows': int(real['root'].shape[0]), 'synth_rows': 0 if synth is None else int(synth['root'].shape[0]), + 'stores': {f.name: json.loads(f.read_text()).get('sha256') for f in sorted(args.store.glob('*.manifest.json'))}, + 'gpu': torch.cuda.get_device_name(0), 'load_seconds': time.monotonic() - started} + if args.init: + recipe['init'] = {'path': str(args.init), 'sha256': hashlib.sha256(args.init.read_bytes()).hexdigest()} + if extra_store is not None: + manifest = Path(str(args.extra_store).replace('.npz', '.manifest.json')) + recipe['extra_store'] = {'path': str(args.extra_store), 'rows': int(extra_store['root'].shape[0]), + 'manifest': json.loads(manifest.read_text()) if manifest.exists() else None} + library = isomer_library(real, synth) if args.contrast_weight > 0 else None + if library is not None: + recipe['isomer_library'] = {'molecules': int(library[0].shape[0]), + 'with_same_formula_molecule': float((library[3] > 1).float().mean())} + (args.out / 'recipe.json').write_text(json.dumps(recipe, indent=1) + '\n') + print(json.dumps(recipe), flush=True) + + gen = torch.Generator(device=device) + gen.manual_seed(args.seed * 1000003 + step) + n_real = args.batch if synth is None else max(1, round(args.batch * args.real_frac)) + n_synth = args.batch - n_real + n_extra = round(n_synth * args.extra_frac) if extra_store is not None else 0 + n_synth -= n_extra + aug_real = dict(peak_drop=args.peak_drop, truncate=args.truncate, min_keep=args.min_keep, jitter=args.jitter) + aug_synth = dict(aug_real, energy_drop=args.synth_energy_drop, instrument_drop=args.synth_instrument_drop) + + @torch.no_grad() + def validate(net): + net.eval() + loss, cosine, n = 0.0, 0.0, val['root'].shape[0] + for start in range(0, n, 4096): + index = torch.arange(start, min(start + 4096, n), device=device) + with torch.autocast('cuda', dtype=torch.bfloat16): + logits = net(*invdata.batch_of(val, index)).float() + bits = inverse.unpack_bits(val['fps'][val['mol'][index]]) + loss += F.binary_cross_entropy_with_logits(logits, bits, reduction='none').mean(1).sum().item() + cosine += F.cosine_similarity(torch.sigmoid(logits), bits, dim=-1).sum().item() + return loss / n, cosine / n + + def checkpoint(path, full): + state = {'ema': ema.state_dict(), 'config': model.config, 'step': step} + if full: + state.update(model=model.state_dict(), opt=opt.state_dict()) + tmp = path.with_suffix('.tmp') + torch.save(state, tmp) + tmp.replace(path) + + log = (args.out / 'metrics.jsonl').open('a') + run_started, run_step, window = time.monotonic(), step, [] + model.train() + while step < args.steps: + for group in opt.param_groups: + group['lr'] = args.lr * schedule(step) + index = torch.multinomial(real_weight, n_real, replacement=True, generator=gen) + parts = [invdata.batch_of(real, index, aug_real, gen)] + mols = [real['fps'][real['mol'][index]]] + ids = [real['mol'][index]] + if n_synth: + if synth_weight is None: + index = torch.randint(0, synth['root'].shape[0], (n_synth,), device=device, generator=gen) + else: + index = torch.multinomial(synth_weight, n_synth, replacement=True, generator=gen) + parts.append(invdata.batch_of(synth, index, aug_synth, gen)) + mols.append(synth['fps'][synth['mol'][index]]) + ids.append(synth['mol'][index] + real['fps'].shape[0]) + if n_extra: + index = torch.randint(0, extra_store['root'].shape[0], (n_extra,), device=device, generator=gen) + parts.append(invdata.batch_of(extra_store, index, aug_synth, gen)) + mols.append(extra_store['fps'][extra_store['mol'][index]]) + ids.append(extra_store['mol'][index] + real['fps'].shape[0]) + inputs = [torch.cat(x) for x in zip(*parts)] + bits = inverse.unpack_bits(torch.cat(mols)) + with torch.autocast('cuda', dtype=torch.bfloat16): + logits = model(*inputs) + per = F.binary_cross_entropy_with_logits(logits.float(), bits, reduction='none').mean(1) + loss = per.mean() + extra = (0.0, 0.0, 0.0, 0.0) + if library is not None: + nce, first, has = contrast_term(logits, bits, torch.cat(ids), library, args.contrast_k, args.contrast_tau, gen) + loss = loss + args.contrast_weight * nce.mean() + real_has, synth_has = has[:n_real], has[n_real:] + extra = (nce[:n_real][real_has].mean().item() if real_has.any() else 0.0, + nce[n_real:][synth_has].mean().item() if synth_has.any() else 0.0, + first[:n_real][real_has].float().mean().item() if real_has.any() else 0.0, + first[n_real:][synth_has].float().mean().item() if synth_has.any() else 0.0) + opt.zero_grad(set_to_none=True) + loss.backward() + torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) + opt.step() + step += 1 + with torch.no_grad(): + d = min(args.ema, (1 + step) / (10 + step)) + for a, b in zip(ema.parameters(), model.parameters()): + a.lerp_(b, 1 - d) + window.append((loss.item(), per[:n_real].mean().item(), per[n_real:n_real + n_synth].mean().item() if n_synth else 0.0) + extra + + (per[n_real + n_synth:].mean().item() if n_extra else 0.0,)) + if step % 200 == 0: + w = np.mean(window, axis=0) + window = [] + row = {'step': step, 'loss': float(w[0]), 'loss_real': float(w[1]), 'loss_synth': float(w[2]), + 'lr': opt.param_groups[0]['lr'], 'elapsed': time.monotonic() - started, + 'steps_per_second': (step - run_step) / (time.monotonic() - run_started)} + if library is not None: + row.update(nce_real=float(w[3]), nce_synth=float(w[4]), first_real=float(w[5]), first_synth=float(w[6])) + if n_extra: + row['loss_extra'] = float(w[7]) + log.write(json.dumps(row) + '\n') + log.flush() + if step % args.validate_every == 0 or step == args.steps: + row = {'step': step, 'elapsed': time.monotonic() - started} + row['val_loss'], row['val_cos'] = validate(model) + row['val_loss_ema'], row['val_cos_ema'] = validate(ema) + if pools is not None and (step % args.retrieve_every == 0 or step == args.steps): + tick = time.monotonic() + cos, nll = pools.distances(ema, subset) + row['ind_cos'], row['agg_cos'] = retrieval(pools, target, cos, subset) + row['ind_nll'], row['agg_nll'] = retrieval(pools, target, nll, subset) + row['retrieval_seconds'] = time.monotonic() - tick + checkpoint(args.out / f'step-{step:07d}-ema.pt', False) + print(json.dumps(row), flush=True) + with (args.out / 'validation.jsonl').open('a') as stream: + stream.write(json.dumps(row) + '\n') + checkpoint(last, True) + model.train() + if args.max_steps_this_run and step - run_step >= args.max_steps_this_run: + break + checkpoint(last, True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/81/81dbf6e445c3fce8cebcd6567adf2f33eed3f18482fe951cb380e894f6f74745/netprop-final-m10-save.log b/shared/package-files/81/81dbf6e445c3fce8cebcd6567adf2f33eed3f18482fe951cb380e894f6f74745/netprop-final-m10-save.log new file mode 100644 index 0000000000000000000000000000000000000000..9d33d33fc4e97a28f717d76c7d4507af7e8bd578 --- /dev/null +++ b/shared/package-files/81/81dbf6e445c3fce8cebcd6567adf2f33eed3f18482fe951cb380e894f6f74745/netprop-final-m10-save.log @@ -0,0 +1,4 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4486 (domain 0.4175 / other 0.4798) macro 0.3789 + lam 1.00/1.00: Hit@1 0.8022 (+0.0308 [+0.0100, +0.0559]) macro +0.0148 [+0.0089, +0.0213] pools +83 -33 | no top 20 +0.0245 cap30 +0.0244 [+0.0102, +0.0396] | Hit@5 -0.0078 macro@5 +0.0077 cap30@5 +0.0117 diff --git a/shared/package-files/81/81dbf6e445c3fce8cebcd6567adf2f33eed3f18482fe951cb380e894f6f74745/netprop-final-m10.log b/shared/package-files/81/81dbf6e445c3fce8cebcd6567adf2f33eed3f18482fe951cb380e894f6f74745/netprop-final-m10.log new file mode 100644 index 0000000000000000000000000000000000000000..9d33d33fc4e97a28f717d76c7d4507af7e8bd578 --- /dev/null +++ b/shared/package-files/81/81dbf6e445c3fce8cebcd6567adf2f33eed3f18482fe951cb380e894f6f74745/netprop-final-m10.log @@ -0,0 +1,4 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4486 (domain 0.4175 / other 0.4798) macro 0.3789 + lam 1.00/1.00: Hit@1 0.8022 (+0.0308 [+0.0100, +0.0559]) macro +0.0148 [+0.0089, +0.0213] pools +83 -33 | no top 20 +0.0245 cap30 +0.0244 [+0.0102, +0.0396] | Hit@5 -0.0078 macro@5 +0.0077 cap30@5 +0.0117 diff --git a/shared/package-files/82/823ea3dd0c763a78028b9d589cf6dcb67cc99482031833e8302ea95bd139375b/fused-top70.log b/shared/package-files/82/823ea3dd0c763a78028b9d589cf6dcb67cc99482031833e8302ea95bd139375b/fused-top70.log new file mode 100644 index 0000000000000000000000000000000000000000..7c915e21b80ab3cb696d7b51d00b710c3aea72dc --- /dev/null +++ b/shared/package-files/82/823ea3dd0c763a78028b9d589cf6dcb67cc99482031833e8302ea95bd139375b/fused-top70.log @@ -0,0 +1,4 @@ +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 | diff=+0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] + pools +0 -0 | macro 0.8379 +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +forward 5Ms-top70-released.pkl all=0.7458 dom=0.9109 non=0.5800 h5=0.8748 h20=0.9306 | diff=-0.0023 [-0.0114,+0.0052] | ind 0.6013 +0.0001 [-0.0018,+0.0018] + pools +22 -16 | macro 0.8396 +0.0018 [-0.0018,+0.0053] | without top 20 -0.0026 [-0.0123,+0.0056] | weight min(n,30) -0.0012 [-0.0091,+0.0059] diff --git a/shared/package-files/82/8242c5c38965f0980e4678e71f924cfb7e688dae4b06742bd92d65e35a9366e4/report-agg1.json b/shared/package-files/82/8242c5c38965f0980e4678e71f924cfb7e688dae4b06742bd92d65e35a9366e4/report-agg1.json new file mode 100644 index 0000000000000000000000000000000000000000..bca0470bc80a1b0f93a80257e2776936c490d1bf --- /dev/null +++ b/shared/package-files/82/8242c5c38965f0980e4678e71f924cfb7e688dae4b06742bd92d65e35a9366e4/report-agg1.json @@ -0,0 +1,111 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.6068248494518503, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.2487973214077166, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.6068248494518503, + "hit_rate_at_20": 0.8504812393844253, + "hit_rate_at_5": 0.758505327088373 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.6770351211543697, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.38906480895081275, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.607653034913104, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.18421052631578946, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.812866927592955, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.7479259731971921, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.69, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.8060897435897436, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.41802411677596785, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6296296296296297, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.6072753817142162, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.5994408945686901, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.42176379577101597, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.7911444421614958, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.6068248494518503, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.5674299521458229, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.6468001705110402 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/82/829912809900a442acb8b6b2493456fdd1f06dac2180ee9e85de449dcf680081/label_support.py b/shared/package-files/82/829912809900a442acb8b6b2493456fdd1f06dac2180ee9e85de449dcf680081/label_support.py new file mode 100644 index 0000000000000000000000000000000000000000..0249b7be1f3045831bbbb880ecadc27d114d75b1 --- /dev/null +++ b/shared/package-files/82/829912809900a442acb8b6b2493456fdd1f06dac2180ee9e85de449dcf680081/label_support.py @@ -0,0 +1,67 @@ +"""Are the labels of missed pools structures the package cannot simulate? (lab, E66; analysis only) + +label_support.py --rankings evals/fullfold/NAME/rankings.jsonl + +For every validation pool: is the label "supported" by the package's canonical_support (the forward +members simulate it), where does it rank, and which property makes a candidate unsupported. +""" +import argparse +import hashlib +import json +import sys +from collections import Counter, defaultdict +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--rankings', required=True) + parser.add_argument('--data', default='/workspace/data') + parser.add_argument('--list', type=int, default=12) + args = parser.parse_args() + import infer + from rdkit import Chem, RDLogger + RDLogger.DisableLog('rdApp.*') + labels = {} + for line in open(Path(args.data) / 'validation.jsonl'): + row = json.loads(line) + labels[row['query_id']] = row + rank = {} + for line in open(args.rankings): + row = json.loads(line) + ids = row.get('ranking') or row.get('candidate_ids') or row.get('ranked_candidate_ids') + label = labels[row['query_id']] + answer = hashlib.sha256(label['target_smiles'].encode()).hexdigest() + rank[row['query_id']] = ids.index(answer) + 1 if answer in ids else len(ids) + 1 + pools = defaultdict(list) + for qid, row in labels.items(): + pools[row['target_smiles']].append(qid) + status, why = {}, {} + for smiles in pools: + status[smiles] = infer.canonical_support(smiles) is not None + if not status[smiles]: + mol = Chem.MolFromSmiles(smiles) + if mol is None: + why[smiles] = 'unparsable' + else: + charge = Chem.GetFormalCharge(mol) + parts = len(Chem.GetMolFrags(mol)) + elements = sorted({a.GetSymbol() for a in mol.GetAtoms()}) + why[smiles] = f'charge {charge:+d}; fragments {parts}; elements {"".join(elements)}; atoms {mol.GetNumHeavyAtoms()}' + for flag in (True, False): + chosen = [s for s in pools if status[s] == flag] + queries = [q for s in chosen for q in pools[s]] + hit = sum(rank[q] == 1 for q in queries) + print(f'label supported={flag}: pools {len(chosen)} queries {len(queries)} Hit@1 {hit / max(1, len(queries)):.4f} ' + f'pool-macro {sum(rank[pools[s][0]] == 1 for s in chosen) / max(1, len(chosen)):.4f} ' + f'share of all queries {len(queries) / len(labels):.4f}') + bad = sorted((s for s in pools if not status[s]), key=lambda s: -len(pools[s])) + print('reasons:', Counter(w.split(';')[0] for w in why.values()).most_common(8)) + for s in bad[:args.list]: + print(f' {len(pools[s]):4d} spectra | rank {rank[pools[s][0]]:3d} | {why[s]} | {s[:70]}') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/82/82a519ef285894a067bbf06f33098cfec77963954d334d45511cd33d1902c542/selfsim-train3b-simulate.log b/shared/package-files/82/82a519ef285894a067bbf06f33098cfec77963954d334d45511cd33d1902c542/selfsim-train3b-simulate.log new file mode 100644 index 0000000000000000000000000000000000000000..1081d34d914cdb722204fe5a700ca831c2e17b8d --- /dev/null +++ b/shared/package-files/82/82a519ef285894a067bbf06f33098cfec77963954d334d45511cd33d1902c542/selfsim-train3b-simulate.log @@ -0,0 +1,26 @@ +DGL backend not selected or invalid. Assuming PyTorch for now. +Setting the default backend to "pytorch". You can change it in the ~/.dgl/config.json file or export the DGLBACKEND environment variable. Valid options are: pytorch, mxnet, tensorflow (all lowercase) +{"event": "canonicalized", "unique_candidates": 435076, "unsupported": 121, "seconds": 24.416461019020062} +{"event": "planned", "queries": 4751, "groups": 4751, "molecules": 614245, "simulations": 1164077, "seconds": 27.323539877019357} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 1164077, "seconds": 47.47294535598485, "per_second": 1348.1362809929722} +{"event": "simulating", "finished": 128000, "total": 1164077, "seconds": 86.79878038400784, "per_second": 1474.6750983563732} +{"event": "simulating", "finished": 192000, "total": 1164077, "seconds": 136.96371251897654, "per_second": 1401.8311600118031} +{"event": "simulating", "finished": 256000, "total": 1164077, "seconds": 191.9293729600031, "per_second": 1333.823979372604} +{"event": "simulating", "finished": 320000, "total": 1164077, "seconds": 247.16461501899175, "per_second": 1294.6837069513842} +{"event": "simulating", "finished": 384000, "total": 1164077, "seconds": 311.51535093499115, "per_second": 1232.6840357865233} +{"event": "simulating", "finished": 448000, "total": 1164077, "seconds": 368.9636020809994, "per_second": 1214.2119099911909} +{"event": "simulating", "finished": 512000, "total": 1164077, "seconds": 428.1013514479855, "per_second": 1195.9784716124827} +{"event": "simulating", "finished": 576000, "total": 1164077, "seconds": 487.06378660100745, "per_second": 1182.5966451327395} +{"event": "simulating", "finished": 640000, "total": 1164077, "seconds": 547.078952893964, "per_second": 1169.849427791908} +{"event": "simulating", "finished": 704000, "total": 1164077, "seconds": 608.9438960069674, "per_second": 1156.0999373117043} +{"event": "simulating", "finished": 768000, "total": 1164077, "seconds": 683.4947869809694, "per_second": 1123.636953241874} +{"event": "simulating", "finished": 832000, "total": 1164077, "seconds": 749.0640469839564, "per_second": 1110.719441615144} +{"event": "simulating", "finished": 896000, "total": 1164077, "seconds": 813.0325801029685, "per_second": 1102.0468575644582} +{"event": "simulating", "finished": 960000, "total": 1164077, "seconds": 880.5754028829979, "per_second": 1090.1962476546205} +{"event": "simulating", "finished": 1024000, "total": 1164077, "seconds": 951.7913452899666, "per_second": 1075.8660551678317} +{"event": "simulating", "finished": 1088000, "total": 1164077, "seconds": 1035.5833272789605, "per_second": 1050.615601217496} +{"event": "simulating", "finished": 1152000, "total": 1164077, "seconds": 1131.7430038169841, "per_second": 1017.8989365206552} +{"event": "simulated", "finished": 1164077, "total": 1164077, "failed": 0, "seconds": 1163.3594796789694} +{"name": "train3b", "source": "synth", "conditions": "from-train 3 window 2000 seed 1 hash-range 0,1 (302 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1164077, "failed": 0, "rows": 1164077, "seconds": 1326.220425104024} diff --git a/shared/package-files/89/8916cfb53a1a742de91b82a604415e8827c1c26afa617fdc1d2d237d95ce04e3/library-reverse-small-znw_4.log b/shared/package-files/89/8916cfb53a1a742de91b82a604415e8827c1c26afa617fdc1d2d237d95ce04e3/library-reverse-small-znw_4.log new file mode 100644 index 0000000000000000000000000000000000000000..c529ceaac4695cca4e471c50972b48a21b892d92 --- /dev/null +++ b/shared/package-files/89/8916cfb53a1a742de91b82a604415e8827c1c26afa617fdc1d2d237d95ce04e3/library-reverse-small-znw_4.log @@ -0,0 +1,10 @@ +base (released rule without consensus): Hit@1 0.7685 domain 0.9301 other 0.6062 macro 0.8650 +znw_4 alone per spectrum 0.1915 (0.1653 / 0.2178) pool mean 0.2717 (0.1901 / 0.3536) macro 0.1999 + other w 0.05 (x0.05/sd): Hit@1 0.7546 (-0.0139 [-0.0334, -0.0003]) macro 0.8639 (-0.0012 [-0.0030, +0.0006]) pools +3 -7 | domain 0.9298 other 0.5786 Hit@5 0.8862 + other w 0.10 (x0.05/sd): Hit@1 0.7571 (-0.0114 [-0.0332, +0.0052]) macro 0.8641 (-0.0009 [-0.0032, +0.0015]) pools +7 -10 | domain 0.9298 other 0.5837 Hit@5 0.8881 + other w 0.20 (x0.05/sd): Hit@1 0.7550 (-0.0135 [-0.0348, +0.0040]) macro 0.8615 (-0.0035 [-0.0068, +0.0000]) pools +14 -26 | domain 0.9295 other 0.5798 Hit@5 0.8923 + other w 0.30 (x0.05/sd): Hit@1 0.7545 (-0.0140 [-0.0370, +0.0066]) macro 0.8609 (-0.0041 [-0.0083, +0.0003]) pools +21 -35 | domain 0.9295 other 0.5788 Hit@5 0.8920 + all w 0.05 (x0.05/sd): Hit@1 0.7551 (-0.0134 [-0.0334, +0.0006]) macro 0.8639 (-0.0012 [-0.0032, +0.0009]) pools +5 -9 | domain 0.9309 other 0.5786 Hit@5 0.8872 + all w 0.10 (x0.05/sd): Hit@1 0.7584 (-0.0101 [-0.0323, +0.0066]) macro 0.8653 (+0.0003 [-0.0030, +0.0032]) pools +14 -13 | domain 0.9322 other 0.5839 Hit@5 0.8890 + all w 0.20 (x0.05/sd): Hit@1 0.7526 (-0.0159 [-0.0375, +0.0029]) macro 0.8609 (-0.0041 [-0.0083, +0.0000]) pools +20 -34 | domain 0.9286 other 0.5760 Hit@5 0.8934 + all w 0.30 (x0.05/sd): Hit@1 0.7530 (-0.0154 [-0.0384, +0.0052]) macro 0.8597 (-0.0053 [-0.0103, -0.0003]) pools +31 -49 | domain 0.9290 other 0.5764 Hit@5 0.8917 diff --git a/shared/package-files/89/8924f88843ad8146ee28ea12b1f13e53b7f7eb38eccbfb794146c46c0dc5e46c/unexplained_peaks.py b/shared/package-files/89/8924f88843ad8146ee28ea12b1f13e53b7f7eb38eccbfb794146c46c0dc5e46c/unexplained_peaks.py new file mode 100644 index 0000000000000000000000000000000000000000..614fda208cdb26c9d5a4c482e0c3c6569e16b8c6 --- /dev/null +++ b/shared/package-files/89/8924f88843ad8146ee28ea12b1f13e53b7f7eb38eccbfb794146c46c0dc5e46c/unexplained_peaks.py @@ -0,0 +1,103 @@ +"""What are the fragment peaks that are no sub-composition of the molecule? (lab, E74; train labels, analysis only) + +unexplained_peaks.py [--fold train] [--limit N] [--instrument Orbitrap] [--energy no] + +For the spectra of one stratum: peaks below precursor - 0.5 Da are split into explained (a sub-composition of the +label formula under the adduct's ion shift, as in ``na_fragments.py``) and unexplained ones. Printed per adduct: +(1) the share of unexplained intensity (square roots) that lies +1.00335 Da above another peak of the spectrum + (a 13C isotope peak), and the same for a control offset (+1.0237); +(2) the most frequent differences unexplained - explained (bins of 2 mDa, |difference| < 60 Da), with the count of + the same bin among explained - explained pairs; +(3) the most frequent differences precursor - unexplained (bins of 2 mDa). +""" +import argparse +import json +import sys +from collections import Counter +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import inverse + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--fold', default='train') + p.add_argument('--limit', type=int, default=12000) + p.add_argument('--instrument', default='Orbitrap') + p.add_argument('--energy', default='no') + p.add_argument('--seed', type=int, default=0) + args = p.parse_args() + rows = {} + with open(f'/workspace/data/{args.fold}.jsonl') as stream: + for line in stream: + q = json.loads(line) + if q['adduct'] not in inverse.ION_SHIFT or (q.get('instrument_type') == 'Orbitrap') != (args.instrument == 'Orbitrap'): + continue + if (q.get('collision_energy') is None) != (args.energy == 'no'): + continue + rows.setdefault(q['adduct'], []).append(q) + rng = np.random.default_rng(args.seed) + for adduct, items in sorted(rows.items()): + if len(items) > args.limit: + items = [items[i] for i in sorted(rng.permutation(len(items))[:args.limit].tolist())] + tables = {} + ue, ee, loss = Counter(), Counter(), Counter() + iso = np.zeros(4) + spectra = 0 + for q in items: + formula = q['target_formula'] + if formula not in tables: + try: + tables[formula] = inverse.SubformulaTable(inverse.parse_formula(formula)) + except Exception: + tables[formula] = None + table = tables[formula] + if table is None: + continue + mz = np.asarray(q['mzs'], dtype=np.float64) + inten = np.asarray(q['intensities'], dtype=np.float64) + keep = (inten > 0) & (mz < float(q['precursor_mz']) - 0.5) + mz, inten = mz[keep], np.sqrt(inten[keep]) + if len(mz) < 2: + continue + tol = np.maximum(mz * 5e-6, 0.0015) if args.instrument == 'Orbitrap' else np.maximum(mz * 10e-6, 0.003) + native, _, _ = table.assign(mz - inverse.ION_SHIFT[adduct], tol) + rest = ~native + spectra += 1 + if not rest.any(): + continue + w = inten / inten.sum() + diff = mz[:, None] - mz[None, :] + for k, offset in enumerate((1.00335, 1.0237)): + hit = (np.abs(diff - offset) <= 0.003) & (inten[None, :] >= inten[:, None]) + iso[k] += w[rest & hit.any(1)].sum() + iso[2] += w[rest].sum() + iso[3] += 1 + d = diff[np.ix_(rest, native)] + ww = np.broadcast_to(w[rest][:, None], d.shape) + near = np.abs(d) < 60 + for b, x in zip(np.round(d[near] / 0.002).astype(int).tolist(), ww[near].tolist()): + ue[b] += x + d = diff[np.ix_(native, native)] + ww = np.broadcast_to(w[native][:, None], d.shape) + near = (np.abs(d) < 60) & (d != 0) + for b, x in zip(np.round(d[near] / 0.002).astype(int).tolist(), ww[near].tolist()): + ee[b] += x + for b, x in zip(np.round((float(q['precursor_mz']) - mz[rest]) / 0.002).astype(int).tolist(), w[rest].tolist()): + loss[b] += x + print(f'== {adduct} {args.instrument} energy={args.energy}: {spectra} spectra, with unexplained peaks {int(iso[3])}; ' + f'unexplained share {iso[2] / max(spectra, 1):.3f}; of it +1.00335 above a stronger peak {iso[0] / max(iso[2], 1e-9):.3f}, control +1.0237 {iso[1] / max(iso[2], 1e-9):.3f}') + total = sum(ue.values()) + print('unexplained - explained (Da: share of pair weight, explained-explained share of the same bin):') + te = sum(ee.values()) + print(' ' + '; '.join(f'{b * 0.002:+.3f}: {x / total:.4f} ({ee.get(b, 0) / max(te, 1e-9):.4f})' for b, x in ue.most_common(24))) + tl = sum(loss.values()) + print('precursor - unexplained (Da: share):') + print(' ' + '; '.join(f'{b * 0.002:.3f}: {x / tl:.4f}' for b, x in loss.most_common(24)), flush=True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/89/89352bc1948167f5890f13b2fedf3a72bf94b9d09f7596406bf3cf7994e1ed83/result.json b/shared/package-files/89/89352bc1948167f5890f13b2fedf3a72bf94b9d09f7596406bf3cf7994e1ed83/result.json new file mode 100644 index 0000000000000000000000000000000000000000..6ba4eb6760eac5defd2e1d27e565541eca72bcad --- /dev/null +++ b/shared/package-files/89/89352bc1948167f5890f13b2fedf3a72bf94b9d09f7596406bf3cf7994e1ed83/result.json @@ -0,0 +1,7 @@ +{ + "global_step": 30000, + "elapsed_seconds": 7921.792526577003, + "skipped_batches": 0, + "hardware": "NVIDIA H100 80GB HBM3", + "peak_cuda_allocated_bytes": 10946000384 +} diff --git a/shared/package-files/89/895bdeb0172978da1d758e2497b07ea43f098ffffe7ce3c6a84f276758c9ade1/smoke-xjj2vs5c.log b/shared/package-files/89/895bdeb0172978da1d758e2497b07ea43f098ffffe7ce3c6a84f276758c9ade1/smoke-xjj2vs5c.log new file mode 100644 index 0000000000000000000000000000000000000000..e65a97088a3d7d35679e19e10a17a8c33c7107a0 --- /dev/null +++ b/shared/package-files/89/895bdeb0172978da1d758e2497b07ea43f098ffffe7ce3c6a84f276758c9ade1/smoke-xjj2vs5c.log @@ -0,0 +1,8 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 2, "workers": 12} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.3257902150508016} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 1.353018315974623} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 82.02750956802629} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 1.0017683500191197, "total_seconds": 97.39321499108337} +exit 0 diff --git a/shared/package-files/89/8977598c8ea320534f6fe2c62ef13f773c8a5114f48a2bf0a199fc13b5de825b/replay-published-2neva96r.done b/shared/package-files/89/8977598c8ea320534f6fe2c62ef13f773c8a5114f48a2bf0a199fc13b5de825b/replay-published-2neva96r.done new file mode 100644 index 0000000000000000000000000000000000000000..a298a1d7cf2635ad2f1392c2c784cee730dbf84e --- /dev/null +++ b/shared/package-files/89/8977598c8ea320534f6fe2c62ef13f773c8a5114f48a2bf0a199fc13b5de825b/replay-published-2neva96r.done @@ -0,0 +1 @@ +11:18:37 diff --git a/shared/package-files/89/89e6b68ba5c6f11a4cfb07907c31274a0623e31007ff01122b6aee2467ec9b0e/metrics.jsonl b/shared/package-files/89/89e6b68ba5c6f11a4cfb07907c31274a0623e31007ff01122b6aee2467ec9b0e/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..c86abbebfc799335dcddf6ce305cc1a499222e1b --- /dev/null +++ b/shared/package-files/89/89e6b68ba5c6f11a4cfb07907c31274a0623e31007ff01122b6aee2467ec9b0e/metrics.jsonl @@ -0,0 +1,250 @@ +{"step": 200, "loss": 0.32982127465307715, "loss_real": 0.3283313108794391, "loss_synth": 0.3298300944454968, "lr": 5.999770185426209e-05, "elapsed": 17.914841082994826, "steps_per_second": 39.02727443984358, "loss_extra": 0.3300713306479156} +{"step": 400, "loss": 0.04816264465451241, "loss_real": 0.04352639090269804, "loss_synth": 0.048671434186398986, "lr": 0.0001199815230572914, "elapsed": 22.28447802294977, "steps_per_second": 42.130727679362124, "loss_extra": 0.04846146009862423} +{"step": 600, "loss": 0.04473243746906519, "loss_real": 0.03874723279848695, "loss_synth": 0.0452632936835289, "lr": 0.00017993754018322624, "elapsed": 26.57995751395356, "steps_per_second": 43.510614681614776, "loss_extra": 0.045243631862103936} +{"step": 800, "loss": 0.04270204497501254, "loss_real": 0.03522369640879333, "loss_synth": 0.04337038414552808, "lr": 0.0002398518371215969, "elapsed": 31.13926352094859, "steps_per_second": 43.599002558744026, "loss_extra": 0.04333574023097753} +{"step": 1000, "loss": 0.04181387662887573, "loss_real": 0.033883035192266105, "loss_synth": 0.04245934091508388, "lr": 0.0002997105087403322, "elapsed": 35.799905697931536, "steps_per_second": 43.459958858560945, "loss_extra": 0.04254896145313978} +{"step": 1200, "loss": 0.04086963377892971, "loss_real": 0.032949058329686524, "loss_synth": 0.04146067693829537, "lr": 0.00035949966454633923, "elapsed": 40.14591094793286, "steps_per_second": 43.86655792443867, "loss_extra": 0.04165712598711252} +{"step": 1400, "loss": 0.040101058948785066, "loss_real": 0.03223723927512765, "loss_synth": 0.040580696295946836, "lr": 0.0004192054323428467, "elapsed": 44.40514119993895, "steps_per_second": 44.28288733692805, "loss_extra": 0.040989624485373494} +{"step": 1600, "loss": 0.03939620232209563, "loss_real": 0.0316483938600868, "loss_synth": 0.03982745813205838, "lr": 0.0004788139618827038, "elapsed": 48.85308387095574, "steps_per_second": 44.36696948912881, "loss_extra": 0.040312790013849735} +{"step": 1800, "loss": 0.03880689753219485, "loss_real": 0.03117015295661986, "loss_synth": 0.03925162643194199, "lr": 0.000538311428516825, "elapsed": 53.36661980301142, "steps_per_second": 44.360761585239715, "loss_extra": 0.03969077417626977} +{"step": 2000, "loss": 0.03824831910431385, "loss_real": 0.030656861234456302, "loss_synth": 0.038672047164291144, "lr": 0.0005976840368369773, "elapsed": 57.22787155897822, "steps_per_second": 45.00687875672115, "loss_extra": 0.039145239852368834} +{"step": 2200, "loss": 0.03763380911201239, "loss_real": 0.030078395428135993, "loss_synth": 0.03798037623986602, "lr": 0.0005971982039200904, "elapsed": 61.11893861100543, "steps_per_second": 45.5215875051553, "loss_extra": 0.038601302225142714} +{"step": 2400, "loss": 0.03695874506607652, "loss_real": 0.029465458542108535, "loss_synth": 0.03726839506998658, "lr": 0.000596666387431128, "elapsed": 65.04666879400611, "steps_per_second": 45.92734490678483, "loss_extra": 0.03795220572501421} +{"step": 2600, "loss": 0.036328839361667635, "loss_real": 0.0290454313904047, "loss_synth": 0.03662527101114392, "lr": 0.0005960886713500785, "elapsed": 68.84203222894575, "steps_per_second": 46.38565455621727, "loss_extra": 0.03729900002479553} +{"step": 2800, "loss": 0.035749080143868926, "loss_real": 0.028636934403330087, "loss_synth": 0.03601063163951039, "lr": 0.0005954651469050082, "elapsed": 72.60219247092027, "steps_per_second": 46.813369887902944, "loss_extra": 0.03672422032803297} +{"step": 3000, "loss": 0.035274577494710684, "loss_real": 0.02819612219929695, "loss_synth": 0.03548415787518024, "lr": 0.0005947959125576553, "elapsed": 76.39182762196288, "steps_per_second": 47.16861890253745, "loss_extra": 0.03629561534151435} +{"step": 3200, "loss": 0.03477905243635178, "loss_real": 0.027905353363603353, "loss_synth": 0.03492156514897943, "lr": 0.000594081073987881, "elapsed": 80.18640819599386, "steps_per_second": 47.48043004947494, "loss_extra": 0.035831301957368854} +{"step": 3400, "loss": 0.03441316997632384, "loss_real": 0.027464530393481255, "loss_synth": 0.034597806353122, "lr": 0.0005933207440769824, "elapsed": 83.95002086192835, "steps_per_second": 47.77978517298059, "loss_extra": 0.03543649360537529} +{"step": 3600, "loss": 0.03392706997692585, "loss_real": 0.027315067062154412, "loss_synth": 0.03402458658441901, "lr": 0.0005925150428898661, "elapsed": 91.11942596302833, "steps_per_second": 45.95986843751654, "loss_extra": 0.034978660270571706} +{"step": 3800, "loss": 0.03356996839866042, "loss_real": 0.027298018597066404, "loss_synth": 0.033689932953566315, "lr": 0.0005916640976560898, "elapsed": 99.50981337099802, "steps_per_second": 43.81939349574801, "loss_extra": 0.03454012917354703} +{"step": 4000, "loss": 0.033203788567334414, "loss_real": 0.026429947279393674, "loss_synth": 0.033355769235640764, "lr": 0.0005907680427497705, "elapsed": 105.93622163194232, "steps_per_second": 42.943335421797926, "loss_extra": 0.034229262191802265} +{"step": 4200, "loss": 0.03288977300748229, "loss_real": 0.026775032700970768, "loss_synth": 0.03287967391312122, "lr": 0.000589827019668365, "elapsed": 111.22357677097898, "steps_per_second": 42.66846259208292, "loss_extra": 0.033962134718894955} +{"step": 4400, "loss": 0.03253180448897183, "loss_real": 0.0261050262209028, "loss_synth": 0.032543159015476705, "lr": 0.0005888411770103267, "elapsed": 116.06482577102724, "steps_per_second": 42.60485881821712, "loss_extra": 0.03363701354712248} +{"step": 4600, "loss": 0.032278176061809064, "loss_real": 0.025878415443003178, "loss_synth": 0.03236750053241849, "lr": 0.0005878106704516395, "elapsed": 120.44014539301861, "steps_per_second": 42.731102533198865, "loss_extra": 0.03330105151981115} +{"step": 4800, "loss": 0.03202379969879985, "loss_real": 0.026130902720615266, "loss_synth": 0.03201004848815501, "lr": 0.0005867356627212351, "elapsed": 124.91110820299946, "steps_per_second": 42.810934485109634, "loss_extra": 0.03306125738658011} +{"step": 5000, "loss": 0.03164100915193558, "loss_real": 0.025540462117642163, "loss_synth": 0.031582760969176886, "lr": 0.000585616323575296, "elapsed": 129.38664413196966, "steps_per_second": 42.8829617837082, "loss_extra": 0.03275885022245348} +{"step": 5200, "loss": 0.031474239211529496, "loss_real": 0.02531164053827524, "loss_synth": 0.03149248035624623, "lr": 0.000584452829770449, "elapsed": 134.76605154701974, "steps_per_second": 42.63139618557084, "loss_extra": 0.03252669521607458} +{"step": 5400, "loss": 0.031227640453726054, "loss_real": 0.02542349631898105, "loss_synth": 0.03123561689630151, "lr": 0.0005832453650358537, "elapsed": 139.145617165952, "steps_per_second": 42.73659945457861, "loss_extra": 0.03222804415039718} +{"step": 5600, "loss": 0.030959713887423277, "loss_real": 0.0250043657515198, "loss_synth": 0.03086342701688409, "lr": 0.0005819941200441891, "elapsed": 143.52600193000399, "steps_per_second": 42.83448584466739, "loss_extra": 0.03209020738489926} +{"step": 5800, "loss": 0.03074760374613106, "loss_real": 0.024943001037463546, "loss_synth": 0.03069867303594947, "lr": 0.0005806992923815441, "elapsed": 147.90880085993558, "steps_per_second": 42.92525831623701, "loss_extra": 0.031804752480238674} +{"step": 6000, "loss": 0.03055001809261739, "loss_real": 0.024590374613180758, "loss_synth": 0.030510068638250232, "lr": 0.0005793610865162167, "elapsed": 152.10439201793633, "steps_per_second": 43.06812375250428, "loss_extra": 0.03162515885196626} +{"step": 6200, "loss": 0.030261343494057655, "loss_real": 0.0245524931140244, "loss_synth": 0.030241048000752925, "lr": 0.0005779797137664262, "elapsed": 156.1438169949688, "steps_per_second": 43.24969955024944, "loss_extra": 0.03127334389835596} +{"step": 6400, "loss": 0.03016357932239771, "loss_real": 0.024832039251923562, "loss_synth": 0.030057784654200077, "lr": 0.0005765553922669433, "elapsed": 159.9288763179211, "steps_per_second": 43.49638739568148, "loss_extra": 0.031195166576653718} +{"step": 6600, "loss": 0.030000622142106293, "loss_real": 0.02452737999148667, "loss_synth": 0.030006455508992076, "lr": 0.0005750883469346437, "elapsed": 163.71236614498775, "steps_per_second": 43.73115649716707, "loss_extra": 0.030945672458037733} +{"step": 6800, "loss": 0.029708468466997148, "loss_real": 0.024346112282946707, "loss_synth": 0.029540843488648535, "lr": 0.000573578809432992, "elapsed": 167.4758687519934, "steps_per_second": 43.96012205756629, "loss_extra": 0.03080697781406343} +{"step": 7000, "loss": 0.029551018476486206, "loss_real": 0.02395124975591898, "loss_synth": 0.02942713621072471, "lr": 0.000572027018135459, "elapsed": 171.23750503198244, "steps_per_second": 44.178731102151495, "loss_extra": 0.03064721591770649} +{"step": 7200, "loss": 0.02949877142906189, "loss_real": 0.0240091909840703, "loss_synth": 0.029411909133195878, "lr": 0.0005704332180878793, "elapsed": 175.0558347949991, "steps_per_second": 44.371692728254395, "loss_extra": 0.030538962725549935} +{"step": 7400, "loss": 0.029248917801305653, "loss_real": 0.02384999729692936, "loss_synth": 0.029175860164687036, "lr": 0.0005687976609697565, "elapsed": 178.94888781395275, "steps_per_second": 44.535744627802224, "loss_extra": 0.030259613506495954} +{"step": 7600, "loss": 0.02916603349149227, "loss_real": 0.02381991916336119, "loss_synth": 0.0290239230543375, "lr": 0.0005671206050545193, "elapsed": 182.99231165100355, "steps_per_second": 44.65280022772231, "loss_extra": 0.03023631477728486} +{"step": 7800, "loss": 0.02896322339773178, "loss_real": 0.023717144206166267, "loss_synth": 0.028889235220849515, "lr": 0.000565402315168738, "elapsed": 187.04043997300323, "steps_per_second": 44.76321451668189, "loss_extra": 0.029948292337357997} +{"step": 8000, "loss": 0.028832387886941434, "loss_real": 0.023470034459605812, "loss_synth": 0.02871772598475218, "lr": 0.0005636430626503045, "elapsed": 197.73041473701596, "steps_per_second": 43.25722704912045, "loss_extra": 0.029878158224746584} +{"step": 8200, "loss": 0.02867142650298774, "loss_real": 0.023377982256934045, "loss_synth": 0.028437293665483594, "lr": 0.0005618431253055855, "elapsed": 206.86523474392015, "steps_per_second": 42.251703597096764, "loss_extra": 0.029824190102517606} +{"step": 8400, "loss": 0.028625582214444875, "loss_real": 0.02350252179428935, "loss_synth": 0.02844467282295227, "lr": 0.000560002787365553, "elapsed": 214.07278404501267, "steps_per_second": 41.73237775721564, "loss_extra": 0.029695747438818216} +{"step": 8600, "loss": 0.02837653148919344, "loss_real": 0.023111616987735034, "loss_synth": 0.028192219026386738, "lr": 0.0005581223394409018, "elapsed": 219.92136222298723, "steps_per_second": 41.519589480519485, "loss_extra": 0.02947472951374948} +{"step": 8800, "loss": 0.028275319058448076, "loss_real": 0.02284706794656813, "loss_synth": 0.02811099839396775, "lr": 0.0005562020784761579, "elapsed": 225.25203740794677, "steps_per_second": 41.41920702087559, "loss_extra": 0.02938198604620993} +{"step": 9000, "loss": 0.028178743571043014, "loss_real": 0.022722171749919653, "loss_synth": 0.027967581721022726, "lr": 0.0005542423077027882, "elapsed": 230.04841530998237, "steps_per_second": 41.42536477108339, "loss_extra": 0.02933697353117168} +{"step": 9200, "loss": 0.0279968557972461, "loss_real": 0.022880710465833544, "loss_synth": 0.027779183043166997, "lr": 0.0005522433365913161, "elapsed": 234.70583923591767, "steps_per_second": 41.457199007757595, "loss_extra": 0.029102426888421178} +{"step": 9400, "loss": 0.027976914849132298, "loss_real": 0.022785980431362988, "loss_synth": 0.02788017800077796, "lr": 0.0005502054808024529, "elapsed": 239.46322721801698, "steps_per_second": 41.46942820866746, "loss_extra": 0.028975055841729044} +{"step": 9600, "loss": 0.027869192762300373, "loss_real": 0.022723800176754592, "loss_synth": 0.027676332117989658, "lr": 0.0005481290621372514, "elapsed": 244.15255204297137, "steps_per_second": 41.493357690923816, "loss_extra": 0.028955138362944124} +{"step": 9800, "loss": 0.02771800845861435, "loss_real": 0.02265436609275639, "loss_synth": 0.027529834378510712, "lr": 0.000546014408486289, "elapsed": 248.78661310195457, "steps_per_second": 41.52605838582072, "loss_extra": 0.02878508487716317} +{"step": 10000, "loss": 0.027598665775731206, "loss_real": 0.0223962586466223, "loss_synth": 0.027422910714522006, "lr": 0.0005438618537778916, "elapsed": 253.5678715140093, "steps_per_second": 41.53209372056012, "loss_extra": 0.028677483163774012} +{"step": 10200, "loss": 0.0275070031452924, "loss_real": 0.022351650660857557, "loss_synth": 0.02724601622670889, "lr": 0.0005416717379254006, "elapsed": 271.08978847798426, "steps_per_second": 39.48903223617214, "loss_extra": 0.02866251653060317} +{"step": 10400, "loss": 0.027365456540137528, "loss_real": 0.02201762244105339, "loss_synth": 0.02725752688013017, "lr": 0.0005394444067734975, "elapsed": 275.33661778992973, "steps_per_second": 39.612045991486184, "loss_extra": 0.028402000963687897} +{"step": 10600, "loss": 0.02733171284198761, "loss_real": 0.022392682237550615, "loss_synth": 0.027108218353241682, "lr": 0.0005371802120435915, "elapsed": 279.2617696149973, "steps_per_second": 39.77910593199806, "loss_extra": 0.028412311105057597} +{"step": 10800, "loss": 0.02716232033446431, "loss_real": 0.022157934792339802, "loss_synth": 0.02692049731500447, "lr": 0.0005348795112782779, "elapsed": 283.03204750001896, "steps_per_second": 39.964205731581536, "loss_extra": 0.02827252374961972} +{"step": 11000, "loss": 0.027068632282316686, "loss_real": 0.022010474856942894, "loss_synth": 0.026824766816571356, "lr": 0.0005325426677848778, "elapsed": 286.8779861169169, "steps_per_second": 40.13313018627683, "loss_extra": 0.028190211271867157} +{"step": 11200, "loss": 0.026976129217073323, "loss_real": 0.02209160485304892, "loss_synth": 0.02666708704084158, "lr": 0.0005301700505780687, "elapsed": 290.64507935591973, "steps_per_second": 40.30881456068056, "loss_extra": 0.02813244368880987} +{"step": 11400, "loss": 0.02684749194420874, "loss_real": 0.02199634540826082, "loss_synth": 0.02657501781359315, "lr": 0.0005277620343216117, "elapsed": 294.46074191399384, "steps_per_second": 40.47281880894848, "loss_extra": 0.02796159449033439} +{"step": 11600, "loss": 0.026767120128497482, "loss_real": 0.021655835509300232, "loss_synth": 0.026581975547596812, "lr": 0.0005253189992691882, "elapsed": 298.1959711939562, "steps_per_second": 40.643890152884225, "loss_extra": 0.027839456852525472} +{"step": 11800, "loss": 0.026787489196285607, "loss_real": 0.021530125914141537, "loss_synth": 0.02666939347051084, "lr": 0.0005228413312043536, "elapsed": 301.95874721894506, "steps_per_second": 40.806653829095474, "loss_extra": 0.027818439062684774} +{"step": 12000, "loss": 0.02662861851975322, "loss_real": 0.021614247960969807, "loss_synth": 0.02638930480927229, "lr": 0.0005203294213796174, "elapsed": 305.68275263893884, "steps_per_second": 40.97065873513376, "loss_extra": 0.02773805775679648} +{"step": 12200, "loss": 0.02644808921031654, "loss_real": 0.02112540735863149, "loss_synth": 0.026279067769646645, "lr": 0.0005177836664546598, "elapsed": 309.4101775350282, "steps_per_second": 41.13007128283369, "loss_extra": 0.027541096806526184} +{"step": 12400, "loss": 0.026491467198356985, "loss_real": 0.02134616100229323, "loss_synth": 0.02623703086748719, "lr": 0.000515204468433695, "elapsed": 313.1610451110173, "steps_per_second": 41.282304944558916, "loss_extra": 0.027638712534680962} +{"step": 12600, "loss": 0.026334426067769527, "loss_real": 0.021378413327038288, "loss_synth": 0.026031085224822163, "lr": 0.0005125922346019892, "elapsed": 316.9028484260198, "steps_per_second": 41.432018346314656, "loss_extra": 0.0274974827747792} +{"step": 12800, "loss": 0.026297977371141316, "loss_real": 0.02126906406134367, "loss_synth": 0.026011662604287267, "lr": 0.0005099473774615467, "elapsed": 320.66188035998493, "steps_per_second": 41.57576564773319, "loss_extra": 0.02745674521662295} +{"step": 13000, "loss": 0.026237520612776278, "loss_real": 0.021281062066555022, "loss_synth": 0.025948447929695247, "lr": 0.00050727031466597, "elapsed": 324.3920847289264, "steps_per_second": 41.71990437357834, "loss_extra": 0.02738644708879292} +{"step": 13200, "loss": 0.02616981090977788, "loss_real": 0.020991271459497512, "loss_synth": 0.025913560297340155, "lr": 0.000504561468954508, "elapsed": 328.13249601691496, "steps_per_second": 41.859278006887074, "loss_extra": 0.02732463663443923} +{"step": 13400, "loss": 0.026019433131441474, "loss_real": 0.021093706227838994, "loss_synth": 0.025729833859950303, "lr": 0.0005018212680853004, "elapsed": 331.89860268495977, "steps_per_second": 41.99200245936237, "loss_extra": 0.02716354507021606} +{"step": 13600, "loss": 0.0259781726077199, "loss_real": 0.020904557965695857, "loss_synth": 0.02572231486439705, "lr": 0.0004990501447678302, "elapsed": 335.7204382449854, "steps_per_second": 42.114361600378736, "loss_extra": 0.027114378213882448} +{"step": 13800, "loss": 0.025995555287227034, "loss_real": 0.0207993573974818, "loss_synth": 0.025797327207401397, "lr": 0.0004962485365945929, "elapsed": 339.5489019770175, "steps_per_second": 42.23300178499248, "loss_extra": 0.027095671920105816} +{"step": 14000, "loss": 0.02578552272170782, "loss_real": 0.020814970061182977, "loss_synth": 0.025495852092280984, "lr": 0.0004934168859719962, "elapsed": 343.3556990119396, "steps_per_second": 42.35166968547618, "loss_extra": 0.026937493374571204} +{"step": 14200, "loss": 0.025878795813769104, "loss_real": 0.021017163656651974, "loss_synth": 0.025622699521481992, "lr": 0.0004905556400504991, "elapsed": 347.18831465695985, "steps_per_second": 42.46435676508457, "loss_extra": 0.02697841159068048} +{"step": 14400, "loss": 0.025712438207119704, "loss_real": 0.020979314553551377, "loss_synth": 0.02543373451568186, "lr": 0.0004876652506540011, "elapsed": 350.99698873702437, "steps_per_second": 42.577503823954814, "loss_extra": 0.026812240090221165} +{"step": 14600, "loss": 0.025680466843768953, "loss_real": 0.020800033789128064, "loss_synth": 0.02533405209891498, "lr": 0.00048474617420849446, "elapsed": 354.83315892796963, "steps_per_second": 42.68469928049139, "loss_extra": 0.026873285006731747} +{"step": 14800, "loss": 0.025610397467389703, "loss_real": 0.02098350693937391, "loss_synth": 0.025307909464463593, "lr": 0.000481798871669989, "elapsed": 358.6365094690118, "steps_per_second": 42.79357748071215, "loss_extra": 0.026715427255257964} +{"step": 15000, "loss": 0.025513448333367706, "loss_real": 0.02066679117269814, "loss_synth": 0.025249539706856013, "lr": 0.00047882380845172155, "elapsed": 362.46678030397743, "steps_per_second": 42.896784328548144, "loss_extra": 0.026618241528049112} +{"step": 15200, "loss": 0.025408046767115593, "loss_real": 0.02045284470077604, "loss_synth": 0.025069982884451746, "lr": 0.0004758214543506626, "elapsed": 367.04930334398523, "steps_per_second": 42.906450930880496, "loss_extra": 0.026605538493022322} +{"step": 15400, "loss": 0.02535082814283669, "loss_real": 0.020609491248615087, "loss_synth": 0.025053827641531825, "lr": 0.0004727922834733288, "elapsed": 370.8751619659597, "steps_per_second": 43.006555635351226, "loss_extra": 0.026470276322215797} +{"step": 15600, "loss": 0.025268678441643714, "loss_real": 0.020458988696336746, "loss_synth": 0.02495820731855929, "lr": 0.0004697367741609171, "elapsed": 374.6685141189955, "steps_per_second": 43.10841582899392, "loss_extra": 0.026413414655253292} +{"step": 15800, "loss": 0.0253218674659729, "loss_real": 0.020378533629700542, "loss_synth": 0.025028645517304538, "lr": 0.0004666554089137685, "elapsed": 378.4940249539213, "steps_per_second": 43.20436314701698, "loss_extra": 0.026472645727917552} +{"step": 16000, "loss": 0.025167792020365596, "loss_real": 0.020314993122592568, "loss_synth": 0.024853198966011406, "lr": 0.00046354867431517584, "elapsed": 382.3072343239328, "steps_per_second": 43.299765291806175, "loss_extra": 0.026324122240766884} +{"step": 16200, "loss": 0.025190108343958854, "loss_real": 0.02025540890172124, "loss_synth": 0.02494992859661579, "lr": 0.0004604170609545466, "elapsed": 386.11599361593835, "steps_per_second": 43.39373581049031, "loss_extra": 0.026286569088697434} +{"step": 16400, "loss": 0.02506754271686077, "loss_real": 0.02007014274597168, "loss_synth": 0.024754834594205022, "lr": 0.00045726106334993325, "elapsed": 389.93005515192635, "steps_per_second": 43.485196846658255, "loss_extra": 0.02624711734242737} +{"step": 16600, "loss": 0.02506132551468909, "loss_real": 0.020140582369640468, "loss_synth": 0.024757913378998637, "lr": 0.0004540811798699431, "elapsed": 393.736477628001, "steps_per_second": 43.57570042183593, "loss_extra": 0.026218325728550554} +{"step": 16800, "loss": 0.024917966555804014, "loss_real": 0.019882477461360393, "loss_synth": 0.024650128679350018, "lr": 0.00045087791265504006, "elapsed": 397.5667422879487, "steps_per_second": 43.66170756092289, "loss_extra": 0.026059478363022207} +{"step": 17000, "loss": 0.02492358336225152, "loss_real": 0.020143270012922584, "loss_synth": 0.024660178264603018, "lr": 0.0004476517675382507, "elapsed": 401.3663695889991, "steps_per_second": 43.749468404924315, "loss_extra": 0.026016349364072086} +{"step": 17200, "loss": 0.02482205885462463, "loss_real": 0.019967175647616388, "loss_synth": 0.02449500118382275, "lr": 0.00044440325396528766, "elapsed": 405.20749759301543, "steps_per_second": 43.8308936977975, "loss_extra": 0.025991162806749343} +{"step": 17400, "loss": 0.024844251722097397, "loss_real": 0.019807290215976537, "loss_synth": 0.024494623439386486, "lr": 0.00044113288491410207, "elapsed": 409.0074947630055, "steps_per_second": 43.91529877416807, "loss_extra": 0.026067462870851158} +{"step": 17600, "loss": 0.024678131062537433, "loss_real": 0.019867018717341124, "loss_synth": 0.024378391467034816, "lr": 0.00043784117681387844, "elapsed": 412.8443921559956, "steps_per_second": 43.99404185325942, "loss_extra": 0.025812428314238786} +{"step": 17800, "loss": 0.024747540298849343, "loss_real": 0.019669318324886262, "loss_synth": 0.024456420447677374, "lr": 0.00043452864946348456, "elapsed": 416.6439430270111, "steps_per_second": 44.07536436090045, "loss_extra": 0.025919659240171315} +{"step": 18000, "loss": 0.024645304940640926, "loss_real": 0.019556304928846656, "loss_synth": 0.0244140584487468, "lr": 0.00043119582594938896, "elapsed": 420.4560545569984, "steps_per_second": 44.15381046892628, "loss_extra": 0.02575967675074935} +{"step": 18200, "loss": 0.024539466379210353, "loss_real": 0.019442129018716513, "loss_synth": 0.02420630794018507, "lr": 0.0004278432325630599, "elapsed": 424.27275398396887, "steps_per_second": 44.2303098544268, "loss_extra": 0.025756766935810447} +{"step": 18400, "loss": 0.024607093082740904, "loss_real": 0.019686340484768153, "loss_synth": 0.02429623664356768, "lr": 0.00042447139871785766, "elapsed": 428.09176089800894, "steps_per_second": 44.305157047562474, "loss_extra": 0.025771508319303395} +{"step": 18600, "loss": 0.02445313739590347, "loss_real": 0.019535663039423525, "loss_synth": 0.02409809242002666, "lr": 0.0004210808568654337, "elapsed": 431.9294431039598, "steps_per_second": 44.37666286770054, "loss_extra": 0.025660983975976704} +{"step": 18800, "loss": 0.024481867179274558, "loss_real": 0.01952859906479716, "loss_synth": 0.024151709070429205, "lr": 0.00041767214241165117, "elapsed": 435.7466071039671, "steps_per_second": 44.449027306549986, "loss_extra": 0.025671150991693138} +{"step": 19000, "loss": 0.024412040924653412, "loss_real": 0.019381629270501435, "loss_synth": 0.024134708791971205, "lr": 0.00041424579363203725, "elapsed": 439.5779277909314, "steps_per_second": 44.51862048963156, "loss_extra": 0.025562124298885464} +{"step": 19200, "loss": 0.02440657843835652, "loss_real": 0.01943737983237952, "loss_synth": 0.02410306959412992, "lr": 0.00041080235158678376, "elapsed": 443.3832480349811, "steps_per_second": 44.5896676008045, "loss_extra": 0.025572093622758984} +{"step": 19400, "loss": 0.02430752626620233, "loss_real": 0.019331181403249503, "loss_synth": 0.023912392500787975, "lr": 0.00040734236003530744, "elapsed": 447.2192324619973, "steps_per_second": 44.65631766960421, "loss_extra": 0.02556551949121058} +{"step": 19600, "loss": 0.024164351588115095, "loss_real": 0.019225343302823602, "loss_synth": 0.02389567472971976, "lr": 0.0004038663653503835, "elapsed": 451.0330126999179, "steps_per_second": 44.724066930111356, "loss_extra": 0.02528993726707995} +{"step": 19800, "loss": 0.024166544722393154, "loss_real": 0.019083133349195123, "loss_synth": 0.023804815290495752, "lr": 0.000400374916431868, "elapsed": 454.88041440199595, "steps_per_second": 44.78724077575043, "loss_extra": 0.025409875540062785} +{"step": 20000, "loss": 0.024127374850213528, "loss_real": 0.01904701501596719, "loss_synth": 0.023873500265181063, "lr": 0.00039686856462001896, "elapsed": 458.6909871469252, "steps_per_second": 44.8530288082718, "loss_extra": 0.025262778010219335} +{"step": 20200, "loss": 0.02413226427510381, "loss_real": 0.019390741111710668, "loss_synth": 0.0238611164689064, "lr": 0.00039334786360843476, "elapsed": 474.7249527289532, "steps_per_second": 43.729121344625064, "loss_extra": 0.025226001450791954} +{"step": 20400, "loss": 0.024033824317157268, "loss_real": 0.019183786967769265, "loss_synth": 0.023694310588762164, "lr": 0.00038981336935661813, "elapsed": 478.5261548470007, "steps_per_second": 43.80164482563242, "loss_extra": 0.025214489866048097} +{"step": 20600, "loss": 0.023997240932658315, "loss_real": 0.01908953263889998, "loss_synth": 0.02371396489441395, "lr": 0.00038626564000218466, "elapsed": 482.3618912450038, "steps_per_second": 43.869767395016986, "loss_extra": 0.02513192598707974} +{"step": 20800, "loss": 0.0239509991183877, "loss_real": 0.018755790456198157, "loss_synth": 0.02362368430942297, "lr": 0.00038270523577272616, "elapsed": 486.1620797329815, "steps_per_second": 43.94008547377591, "loss_extra": 0.025179483573883773} +{"step": 21000, "loss": 0.02391418377868831, "loss_real": 0.01894564736634493, "loss_synth": 0.02362687561661005, "lr": 0.0003791327188973438, "elapsed": 490.0019914249424, "steps_per_second": 44.005620251587736, "loss_extra": 0.025063451481983065} +{"step": 21200, "loss": 0.02390619510784745, "loss_real": 0.018723585335537793, "loss_synth": 0.023619197057560087, "lr": 0.00037554865351786614, "elapsed": 493.80039350199513, "steps_per_second": 44.073911859201765, "loss_extra": 0.025092345140874387} +{"step": 21400, "loss": 0.023826257986947895, "loss_real": 0.018792345514521004, "loss_synth": 0.023484102049842477, "lr": 0.00037195360559976446, "elapsed": 497.63353463297244, "steps_per_second": 44.13797065229041, "loss_extra": 0.025041498737409712} +{"step": 21600, "loss": 0.02379256549291313, "loss_real": 0.018723223977722227, "loss_synth": 0.02346499533392489, "lr": 0.0003683481428427801, "elapsed": 501.4386826939881, "steps_per_second": 44.20355663566519, "loss_extra": 0.024999437360092996} +{"step": 21800, "loss": 0.02375273747369647, "loss_real": 0.019072893410921096, "loss_synth": 0.023433705540373922, "lr": 0.0003647328345912784, "elapsed": 505.25641351600643, "steps_per_second": 44.26699797216529, "loss_extra": 0.024883440136909483} +{"step": 22000, "loss": 0.023721021562814713, "loss_real": 0.018675161134451626, "loss_synth": 0.023364953035488724, "lr": 0.0003611082517443419, "elapsed": 509.0776356389979, "steps_per_second": 44.32915142499783, "loss_extra": 0.024952191915363072} +{"step": 22200, "loss": 0.02365470850840211, "loss_real": 0.018528067572042346, "loss_synth": 0.02341187734156847, "lr": 0.00035747496666562, "elapsed": 512.8897010770161, "steps_per_second": 44.391167815530856, "loss_extra": 0.024787155026569963} +{"step": 22400, "loss": 0.023706293487921356, "loss_real": 0.018558155382052063, "loss_synth": 0.023436334328725935, "lr": 0.00035383355309294483, "elapsed": 516.7275183289312, "steps_per_second": 44.449974380915926, "loss_extra": 0.024869487909600137} +{"step": 22600, "loss": 0.023678939137607814, "loss_real": 0.018504353929311036, "loss_synth": 0.02336362942121923, "lr": 0.00035018458604773206, "elapsed": 520.5447141319746, "steps_per_second": 44.509699577023255, "loss_extra": 0.024891886543482542} +{"step": 22800, "loss": 0.02349089571274817, "loss_real": 0.018451605183072387, "loss_synth": 0.0232373936008662, "lr": 0.0003465286417441785, "elapsed": 524.3769802399911, "steps_per_second": 44.5672205969292, "loss_extra": 0.024618792943656445} +{"step": 23000, "loss": 0.023447025064378978, "loss_real": 0.018411927218548955, "loss_synth": 0.023204165380448102, "lr": 0.0003428662974982705, "elapsed": 528.3344351670239, "steps_per_second": 44.613050280273775, "loss_extra": 0.02456359622068703} +{"step": 23200, "loss": 0.023498285636305807, "loss_real": 0.018534683431498708, "loss_synth": 0.02316662251017988, "lr": 0.00033919813163662, "elapsed": 532.2793360860087, "steps_per_second": 44.65926095956634, "loss_extra": 0.024690863341093064} +{"step": 23400, "loss": 0.02338487308472395, "loss_real": 0.018220252790488303, "loss_synth": 0.022981623401865364, "lr": 0.000335524723405139, "elapsed": 536.120225476916, "steps_per_second": 44.71366013082821, "loss_extra": 0.024683656683191658} +{"step": 23600, "loss": 0.023395230993628502, "loss_real": 0.018628379539586605, "loss_synth": 0.02305523119866848, "lr": 0.00033184665287757097, "elapsed": 539.9391146439593, "steps_per_second": 44.7691349428402, "loss_extra": 0.024561928864568473} +{"step": 23800, "loss": 0.02339377879165113, "loss_real": 0.018727881582453847, "loss_synth": 0.023052320275455715, "lr": 0.0003281645008638895, "elapsed": 543.7763218840118, "steps_per_second": 44.82226543491497, "loss_extra": 0.0245443903747946} +{"step": 24000, "loss": 0.023267285292968155, "loss_real": 0.01813503214623779, "loss_synth": 0.022986396159976722, "lr": 0.0003244788488185826, "elapsed": 549.0051606029738, "steps_per_second": 44.758170933034606, "loss_extra": 0.02443860367871821} +{"step": 24200, "loss": 0.02339738086797297, "loss_real": 0.018129702685400845, "loss_synth": 0.023092813882976772, "lr": 0.00032079027874883385, "elapsed": 553.0714004529873, "steps_per_second": 44.79149167748454, "loss_extra": 0.02461580398492515} +{"step": 24400, "loss": 0.02325182211585343, "loss_real": 0.018210287396796046, "loss_synth": 0.02291386648081243, "lr": 0.00031709937312261613, "elapsed": 556.8805623679655, "steps_per_second": 44.84549361296762, "loss_extra": 0.024464204935356976} +{"step": 24600, "loss": 0.023303262051194908, "loss_real": 0.018424209929071365, "loss_synth": 0.022995565254241228, "lr": 0.0003134067147767145, "elapsed": 560.6836421419866, "steps_per_second": 44.89924315273148, "loss_extra": 0.02445728614926338} +{"step": 24800, "loss": 0.02325046612881124, "loss_real": 0.017921740561723708, "loss_synth": 0.02296214662492275, "lr": 0.0003097128868246881, "elapsed": 564.4965907119913, "steps_per_second": 44.95144755424345, "loss_extra": 0.02446331615559757} +{"step": 25000, "loss": 0.023155423579737544, "loss_real": 0.018179688807576894, "loss_synth": 0.022847323222085835, "lr": 0.0003060184725647909, "elapsed": 568.308056363021, "steps_per_second": 45.00305542899582, "loss_extra": 0.02432664601132274} +{"step": 25200, "loss": 0.023116055000573395, "loss_real": 0.01808083747047931, "loss_synth": 0.022800907231867312, "lr": 0.0003023240553878617, "elapsed": 572.907190383994, "steps_per_second": 44.990602556879, "loss_extra": 0.02430462877266109} +{"step": 25400, "loss": 0.023061318108811974, "loss_real": 0.017937564481981097, "loss_synth": 0.02275092527270317, "lr": 0.0002986302186851996, "elapsed": 576.7289645759156, "steps_per_second": 45.040352743687045, "loss_extra": 0.024260538956150414} +{"step": 25600, "loss": 0.02302825393155217, "loss_real": 0.018294621892273426, "loss_synth": 0.022711587054654956, "lr": 0.00029493754575644036, "elapsed": 580.5424971899483, "steps_per_second": 45.09008773987143, "loss_extra": 0.02416594653390348} +{"step": 25800, "loss": 0.023000030340626837, "loss_real": 0.017752917534671724, "loss_synth": 0.022682610042393206, "lr": 0.0002912466197174462, "elapsed": 584.3588522300124, "steps_per_second": 45.13893616059212, "loss_extra": 0.024227679446339606} +{"step": 26000, "loss": 0.023005353473126888, "loss_real": 0.01782083950936794, "loss_synth": 0.02265807759948075, "lr": 0.00028755802340822527, "elapsed": 588.1659701999743, "steps_per_second": 45.18786199318062, "loss_extra": 0.02425185676664114} +{"step": 26200, "loss": 0.022916896864771844, "loss_real": 0.017731802384369076, "loss_synth": 0.022690222430974245, "lr": 0.0002838723393008943, "elapsed": 591.9830653469544, "steps_per_second": 45.23536538898617, "loss_extra": 0.02404341041110456} +{"step": 26400, "loss": 0.02286401093006134, "loss_real": 0.017544053262099624, "loss_synth": 0.022509852536022664, "lr": 0.00028019014940769974, "elapsed": 595.7770067469683, "steps_per_second": 45.2840451836633, "loss_extra": 0.0241408977471292} +{"step": 26600, "loss": 0.022909649163484574, "loss_real": 0.01780847574584186, "loss_synth": 0.02255386019125581, "lr": 0.000276512035189111, "elapsed": 599.595198326977, "steps_per_second": 45.330222105127255, "loss_extra": 0.024150150511413813} +{"step": 26800, "loss": 0.02280676589347422, "loss_real": 0.017628095815889536, "loss_synth": 0.02249188988469541, "lr": 0.00027283857746200125, "elapsed": 603.3882884079358, "steps_per_second": 45.377730531720154, "loss_extra": 0.02401999116875231} +{"step": 27000, "loss": 0.022853859215974808, "loss_real": 0.01785654332488775, "loss_synth": 0.02258290082216263, "lr": 0.0002691703563079296, "elapsed": 607.1975908509921, "steps_per_second": 45.42339363397745, "loss_extra": 0.02399184656329453} +{"step": 27200, "loss": 0.02279453651048243, "loss_real": 0.01749436281621456, "loss_synth": 0.022522430904209613, "lr": 0.0002655079509815397, "elapsed": 611.0226695139427, "steps_per_second": 45.46727615988837, "loss_extra": 0.02398628108203411} +{"step": 27400, "loss": 0.02268724693916738, "loss_real": 0.01780866500455886, "loss_synth": 0.02238398138433695, "lr": 0.00026185193981908867, "elapsed": 614.8310468179407, "steps_per_second": 45.51186358993369, "loss_extra": 0.0238367766328156} +{"step": 27600, "loss": 0.02273070354014635, "loss_real": 0.017385439262725413, "loss_synth": 0.02244024849496782, "lr": 0.0002582029001471206, "elapsed": 618.6513775259955, "steps_per_second": 45.55499168084685, "loss_extra": 0.023948553735390305} +{"step": 27800, "loss": 0.02278457968495786, "loss_real": 0.017512361416593195, "loss_synth": 0.022570682018995286, "lr": 0.00025456140819130085, "elapsed": 622.4543986759381, "steps_per_second": 45.598873881594464, "loss_extra": 0.023913506399840117} +{"step": 28000, "loss": 0.022623666375875474, "loss_real": 0.017571232710033656, "loss_synth": 0.02224246921017766, "lr": 0.0002509280389854229, "elapsed": 626.2527305609547, "steps_per_second": 45.64256090331536, "loss_extra": 0.02388100082986057} +{"step": 28200, "loss": 0.0226901775225997, "loss_real": 0.017316054692491888, "loss_synth": 0.022356067104265093, "lr": 0.00024730336628060344, "elapsed": 630.0534765019547, "steps_per_second": 45.6855315654742, "loss_extra": 0.023956511430442334} +{"step": 28400, "loss": 0.022589923152700066, "loss_real": 0.0173222176451236, "loss_synth": 0.02240921107120812, "lr": 0.00024368796245468133, "elapsed": 633.8612812529318, "steps_per_second": 45.72745658915039, "loss_extra": 0.023685020646080374} +{"step": 28600, "loss": 0.022597702788189053, "loss_real": 0.017387794656679036, "loss_synth": 0.022317634709179402, "lr": 0.00024008239842183163, "elapsed": 637.6656389120035, "steps_per_second": 45.76912314357117, "loss_extra": 0.02378169427625835} +{"step": 28800, "loss": 0.02252721555531025, "loss_real": 0.017457560016773642, "loss_synth": 0.022160438373684883, "lr": 0.00023648724354241227, "elapsed": 641.4718245839467, "steps_per_second": 45.81015221305748, "loss_extra": 0.02377318313345313} +{"step": 29000, "loss": 0.022532260343432427, "loss_real": 0.017390980492345987, "loss_synth": 0.022195860277861357, "lr": 0.00023290306553305494, "elapsed": 645.276494781021, "steps_per_second": 45.8507973321747, "loss_extra": 0.0237604224588722} +{"step": 29200, "loss": 0.022437954768538475, "loss_real": 0.01706510853022337, "loss_synth": 0.022129187006503345, "lr": 0.00022933043037701642, "elapsed": 649.08361525496, "steps_per_second": 45.89077966111418, "loss_extra": 0.023678831495344638} +{"step": 29400, "loss": 0.022414092179387807, "loss_real": 0.017286818008869886, "loss_synth": 0.022030779123306275, "lr": 0.00022576990223480343, "elapsed": 652.8909527019132, "steps_per_second": 45.9302707943366, "loss_extra": 0.023686535339802504} +{"step": 29600, "loss": 0.022426172960549592, "loss_real": 0.01718268610537052, "loss_synth": 0.02208179647102952, "lr": 0.00022222204335508425, "elapsed": 656.6971340100281, "steps_per_second": 45.969377489185874, "loss_extra": 0.02368003433570266} +{"step": 29800, "loss": 0.022435290357097983, "loss_real": 0.01734239867888391, "loss_synth": 0.022135998765006663, "lr": 0.00021868741398590414, "elapsed": 660.5000272529433, "steps_per_second": 46.00825811224314, "loss_extra": 0.02361809490248561} +{"step": 30000, "loss": 0.02234754454344511, "loss_real": 0.017222769288346172, "loss_synth": 0.022021448845043777, "lr": 0.00021516657228621528, "elapsed": 664.3025133379269, "steps_per_second": 46.04671363435508, "loss_extra": 0.023562579061836005} +{"step": 30200, "loss": 0.022335447892546652, "loss_real": 0.017304011094383894, "loss_synth": 0.022046476434916258, "lr": 0.00021166007423773693, "elapsed": 680.3199629979208, "steps_per_second": 45.241429777881955, "loss_extra": 0.023497299766168} +{"step": 30400, "loss": 0.0222716776560992, "loss_real": 0.01705624186899513, "loss_synth": 0.021902663595974446, "lr": 0.0002081684735571596, "elapsed": 684.1235537009779, "steps_per_second": 45.28301882531431, "loss_extra": 0.023545198896899818} +{"step": 30600, "loss": 0.022326392345130442, "loss_real": 0.017101518753916026, "loss_synth": 0.022041045762598514, "lr": 0.00020469232160870657, "elapsed": 687.9198108399287, "steps_per_second": 45.32463159630792, "loss_extra": 0.02351824030280113} +{"step": 30800, "loss": 0.022347661061212422, "loss_real": 0.01727459457702935, "loss_synth": 0.02196875278837979, "lr": 0.00020123216731706737, "elapsed": 691.7360209819162, "steps_per_second": 45.36444580341923, "loss_extra": 0.02360630069859326} +{"step": 31000, "loss": 0.02219405640847981, "loss_real": 0.017105007176287473, "loss_synth": 0.021845493968576192, "lr": 0.00019778855708071612, "elapsed": 695.5344951599836, "steps_per_second": 45.40499440626538, "loss_extra": 0.023425255594775082} +{"step": 31200, "loss": 0.022225232776254416, "loss_real": 0.016796832741238176, "loss_synth": 0.0218775082193315, "lr": 0.00019436203468562864, "elapsed": 699.334902032977, "steps_per_second": 45.44496637206645, "loss_extra": 0.023514552656561136} +{"step": 31400, "loss": 0.02209690707735717, "loss_real": 0.016929975054226817, "loss_synth": 0.021746584875509144, "lr": 0.00019095314121941266, "elapsed": 703.132880843943, "steps_per_second": 45.48465820570042, "loss_extra": 0.023343389136716724} +{"step": 31600, "loss": 0.022113860519602895, "loss_real": 0.016945809181779622, "loss_synth": 0.02180972931906581, "lr": 0.0001875624149858636, "elapsed": 706.9327155529754, "steps_per_second": 45.52379403047845, "loss_extra": 0.023314541652798653} +{"step": 31800, "loss": 0.022084817616268994, "loss_real": 0.016700059780851005, "loss_synth": 0.02177543076686561, "lr": 0.00018419039141996036, "elapsed": 710.7361200179439, "steps_per_second": 45.56227063027916, "loss_extra": 0.02332838044501841} +{"step": 32000, "loss": 0.02205783560872078, "loss_real": 0.016735983788967134, "loss_synth": 0.021719980472698807, "lr": 0.0001808376030033136, "elapsed": 714.5356690980261, "steps_per_second": 45.60058071500288, "loss_extra": 0.02331881762482226} +{"step": 32200, "loss": 0.02205460013821721, "loss_real": 0.016870398577302693, "loss_synth": 0.021762117594480514, "lr": 0.0001775045791800812, "elapsed": 718.3363311429275, "steps_per_second": 45.63840617142721, "loss_extra": 0.023246487658470868} +{"step": 32400, "loss": 0.02201575162820518, "loss_real": 0.016791878454387187, "loss_synth": 0.021744142463430764, "lr": 0.00017419184627336242, "elapsed": 722.277066495968, "steps_per_second": 45.666808552376224, "loss_extra": 0.023193746488541365} +{"step": 32600, "loss": 0.021971564842388033, "loss_real": 0.016742369132116436, "loss_synth": 0.021712850602343677, "lr": 0.00017089992740208575, "elapsed": 726.2156082119327, "steps_per_second": 45.695037671467055, "loss_extra": 0.023137644305825232} +{"step": 32800, "loss": 0.0220196133852005, "loss_real": 0.016862579714506866, "loss_synth": 0.02167218520306051, "lr": 0.00016762934239840198, "elapsed": 730.0880809839582, "steps_per_second": 45.72716827428406, "loss_extra": 0.023261494021862745} +{"step": 33000, "loss": 0.022011546511203052, "loss_real": 0.016652175476774573, "loss_synth": 0.02171804552897811, "lr": 0.000164380607725597, "elapsed": 734.0200849429239, "steps_per_second": 45.755176822950986, "loss_extra": 0.023234880100935697} +{"step": 33200, "loss": 0.022025136910378933, "loss_real": 0.016830641538836063, "loss_synth": 0.021634335424751044, "lr": 0.00016115423639653619, "elapsed": 738.0020097029628, "steps_per_second": 45.7797300808733, "loss_extra": 0.023316715378314257} +{"step": 33400, "loss": 0.021878620525822044, "loss_real": 0.01660292023792863, "loss_synth": 0.021550329625606535, "lr": 0.0001579507378926539, "elapsed": 741.921799337957, "steps_per_second": 45.8079185394927, "loss_extra": 0.02312206049449742} +{"step": 33600, "loss": 0.0219312244001776, "loss_real": 0.016895322357304395, "loss_synth": 0.021621887534856797, "lr": 0.00015477061808349973, "elapsed": 745.7173535849433, "steps_per_second": 45.843574943801556, "loss_extra": 0.023114131204783915} +{"step": 33800, "loss": 0.021926055615767836, "loss_real": 0.016610296252183618, "loss_synth": 0.02160650650970638, "lr": 0.0001516143791468568, "elapsed": 749.5165838549146, "steps_per_second": 45.87863506957477, "loss_extra": 0.02316775049082935} +{"step": 34000, "loss": 0.021936878701671957, "loss_real": 0.016626237560994923, "loss_synth": 0.021651883842423558, "lr": 0.00014848251948944142, "elapsed": 753.3104500080226, "steps_per_second": 45.91366801049295, "loss_extra": 0.023143276516348125} +{"step": 34200, "loss": 0.021878695776686073, "loss_real": 0.01645731708034873, "loss_synth": 0.02151201062835753, "lr": 0.00014537553366819925, "elapsed": 757.0956156329485, "steps_per_second": 45.94888092610576, "loss_extra": 0.023185676224529744} +{"step": 34400, "loss": 0.021822558362036944, "loss_real": 0.016543481331318617, "loss_synth": 0.02147325947880745, "lr": 0.0001422939123122089, "elapsed": 760.8811845330056, "steps_per_second": 45.98371270721965, "loss_extra": 0.023087504133582116} +{"step": 34600, "loss": 0.021803810689598323, "loss_real": 0.016376276188530027, "loss_synth": 0.02147457961924374, "lr": 0.00013923814204520548, "elapsed": 764.6696633889806, "steps_per_second": 46.018015648817574, "loss_extra": 0.02307456490583718} +{"step": 34800, "loss": 0.021700376318767665, "loss_real": 0.01645322745665908, "loss_synth": 0.02142985364422202, "lr": 0.00013620870540873793, "elapsed": 768.4638398030074, "steps_per_second": 46.05162742072183, "loss_extra": 0.022881333036348223} +{"step": 35000, "loss": 0.021723759230226278, "loss_real": 0.01625535739120096, "loss_synth": 0.021467934520915152, "lr": 0.00013320608078596944, "elapsed": 772.2559009169927, "steps_per_second": 46.085031703601956, "loss_extra": 0.022928518196567892} +{"step": 35200, "loss": 0.021669273683801293, "loss_real": 0.016286258324980735, "loss_synth": 0.021399445049464703, "lr": 0.00013023074232613552, "elapsed": 776.8600645019906, "steps_per_second": 46.06908680763812, "loss_extra": 0.022873143069446086} +{"step": 35400, "loss": 0.02174174184910953, "loss_real": 0.016696997457183897, "loss_synth": 0.021415337016806008, "lr": 0.0001272831598696703, "elapsed": 780.6485522639705, "steps_per_second": 46.10225415176101, "loss_extra": 0.02294318043626845} +{"step": 35600, "loss": 0.021676902789622546, "loss_real": 0.01631772628519684, "loss_synth": 0.021376336803659798, "lr": 0.00012436379887401295, "elapsed": 784.4395377439214, "steps_per_second": 46.134946501895094, "loss_extra": 0.022907237987965345} +{"step": 35800, "loss": 0.021690474841743707, "loss_real": 0.016215461306273937, "loss_synth": 0.02139683498069644, "lr": 0.00012147312034010696, "elapsed": 788.2362867189804, "steps_per_second": 46.16697606133818, "loss_extra": 0.022934037232771515} +{"step": 36000, "loss": 0.021590979704633355, "loss_real": 0.01613973843399435, "loss_synth": 0.021264449413865804, "lr": 0.00011861158073960271, "elapsed": 792.03038873896, "steps_per_second": 46.19885042258629, "loss_extra": 0.022863163007423283} +{"step": 36200, "loss": 0.021579336542636156, "loss_real": 0.015971676106564702, "loss_synth": 0.021201956514269114, "lr": 0.00011577963194277514, "elapsed": 795.8205634669866, "steps_per_second": 46.23064775847256, "loss_extra": 0.02292932879179716} +{"step": 36400, "loss": 0.021599332075566052, "loss_real": 0.01606262834277004, "loss_synth": 0.021228117449209095, "lr": 0.0001129777211471684, "elapsed": 799.607446364942, "steps_per_second": 46.26233231018934, "loss_extra": 0.022930858302861453} +{"step": 36600, "loss": 0.021627085180953146, "loss_real": 0.016243657260201872, "loss_synth": 0.021336088282987477, "lr": 0.00011020629080697766, "elapsed": 803.3951696249424, "steps_per_second": 46.29366410786204, "loss_extra": 0.022852105014026167} +{"step": 36800, "loss": 0.021632272908464076, "loss_real": 0.01633132128510624, "loss_synth": 0.021276504648849368, "lr": 0.00010746577856318116, "elapsed": 807.1937529250281, "steps_per_second": 46.324063874207056, "loss_extra": 0.02290746090002358} +{"step": 37000, "loss": 0.02155333139002323, "loss_real": 0.01632313184440136, "loss_synth": 0.021176179256290197, "lr": 0.00010475661717443124, "elapsed": 810.9873807659606, "steps_per_second": 46.354462051426864, "loss_extra": 0.02283752115443349} +{"step": 37200, "loss": 0.021590005243197083, "loss_real": 0.01599693895317614, "loss_synth": 0.02122201015241444, "lr": 0.00010207923444871681, "elapsed": 814.7823527179426, "steps_per_second": 46.38449490276698, "loss_extra": 0.022928116898983716} +{"step": 37400, "loss": 0.021525325207039713, "loss_real": 0.016221670261584224, "loss_synth": 0.021186128733679654, "lr": 9.94340531758075e-05, "elapsed": 818.5710488519398, "steps_per_second": 46.41460636145749, "loss_extra": 0.022784481532871725} +{"step": 37600, "loss": 0.021476033916696904, "loss_real": 0.016247351788915693, "loss_synth": 0.02117253165692091, "lr": 9.682149106049004e-05, "elapsed": 822.36056396598, "steps_per_second": 46.44438900477506, "loss_extra": 0.022686622049659492} +{"step": 37800, "loss": 0.02147771030664444, "loss_real": 0.016089025414548815, "loss_synth": 0.021183502534404396, "lr": 9.424196065660837e-05, "elapsed": 826.1473968139617, "steps_per_second": 46.474047400911665, "loss_extra": 0.022706840401515365} +{"step": 38000, "loss": 0.021474150512367486, "loss_real": 0.016008755383081733, "loss_synth": 0.021165587417781354, "lr": 9.169586930191606e-05, "elapsed": 829.9349315119907, "steps_per_second": 46.503390964142994, "loss_extra": 0.022730902023613452} +{"step": 38200, "loss": 0.02148974527604878, "loss_real": 0.016090698670595885, "loss_synth": 0.021116962656378746, "lr": 8.91836190537533e-05, "elapsed": 833.7226016429486, "steps_per_second": 46.53245608185285, "loss_extra": 0.022798917507752776} +{"step": 38400, "loss": 0.021473274445161224, "loss_real": 0.016135201901197434, "loss_synth": 0.02121574815362692, "lr": 8.670560662555727e-05, "elapsed": 837.5119928729255, "steps_per_second": 46.5611570459871, "loss_extra": 0.02265708622522652} +{"step": 38600, "loss": 0.021352992253378035, "loss_real": 0.016010820982046425, "loss_synth": 0.02100571838207543, "lr": 8.426222332421624e-05, "elapsed": 841.3007388259284, "steps_per_second": 46.58963176306078, "loss_extra": 0.02262688268907368} +{"step": 38800, "loss": 0.02141313741914928, "loss_real": 0.016125601301901042, "loss_synth": 0.02110915503464639, "lr": 8.185385498827815e-05, "elapsed": 845.0873846759787, "steps_per_second": 46.617964890024695, "loss_extra": 0.02263442853465676} +{"step": 39000, "loss": 0.02132974712178111, "loss_real": 0.015793872904032467, "loss_synth": 0.021039250316098334, "lr": 7.948088192702195e-05, "elapsed": 848.874459980987, "steps_per_second": 46.64601739330581, "loss_extra": 0.02258075342513621} +{"step": 39200, "loss": 0.021391098536551, "loss_real": 0.015981344720348716, "loss_synth": 0.02110151025466621, "lr": 7.714367886040248e-05, "elapsed": 852.6597735040123, "steps_per_second": 46.67391480253025, "loss_extra": 0.02261928898282349} +{"step": 39400, "loss": 0.02137486120685935, "loss_real": 0.015857298178598284, "loss_synth": 0.021049028895795345, "lr": 7.48426148598775e-05, "elapsed": 856.447239195928, "steps_per_second": 46.70144275205905, "loss_extra": 0.022657871516421436} +{"step": 39600, "loss": 0.02139968021772802, "loss_real": 0.01597230930812657, "loss_synth": 0.021044950978830457, "lr": 7.25780532901276e-05, "elapsed": 860.2479457589798, "steps_per_second": 46.72799454441439, "loss_extra": 0.02269579644314945} +{"step": 39800, "loss": 0.021326060211285948, "loss_real": 0.01580539791844785, "loss_synth": 0.021025627804920077, "lr": 7.035035175167622e-05, "elapsed": 864.0362154699396, "steps_per_second": 46.75499232929594, "loss_extra": 0.022584316963329912} +{"step": 40000, "loss": 0.021338269943371416, "loss_real": 0.015885817473754286, "loss_synth": 0.021068999487906696, "lr": 6.81598620244206e-05, "elapsed": 867.8242932339199, "steps_per_second": 46.78176139830149, "loss_extra": 0.0225536469463259} +{"step": 40200, "loss": 0.0212757580075413, "loss_real": 0.015712739992886783, "loss_synth": 0.020934975501149894, "lr": 6.600693001208181e-05, "elapsed": 883.7745612739818, "steps_per_second": 46.15467591837051, "loss_extra": 0.02258155248127878} +{"step": 40400, "loss": 0.02137035728432238, "loss_real": 0.015768583472818135, "loss_synth": 0.021051689954474567, "lr": 6.38918956875819e-05, "elapsed": 887.5704009049805, "steps_per_second": 46.18303075812992, "loss_extra": 0.02266086312942207} +{"step": 40600, "loss": 0.021274661542847753, "loss_real": 0.01601526346988976, "loss_synth": 0.020951049188151955, "lr": 6.181509303935915e-05, "elapsed": 891.3651641230099, "steps_per_second": 46.21119719429836, "loss_extra": 0.0225106109585613} +{"step": 40800, "loss": 0.0212647769972682, "loss_real": 0.015874963868409395, "loss_synth": 0.020882473988458515, "lr": 5.977685001862671e-05, "elapsed": 895.1541146449745, "steps_per_second": 46.23942598732192, "loss_extra": 0.02258182511664927} +{"step": 41000, "loss": 0.021324230367317797, "loss_real": 0.016098809433169662, "loss_synth": 0.02099602154456079, "lr": 5.7777488487585654e-05, "elapsed": 898.9369315169752, "steps_per_second": 46.26773361651222, "loss_extra": 0.02255885411053896} +{"step": 41200, "loss": 0.021262187706306578, "loss_real": 0.015581448446027935, "loss_synth": 0.020979012083262204, "lr": 5.581732416859908e-05, "elapsed": 902.7290618929546, "steps_per_second": 46.29531608724281, "loss_extra": 0.022531070914119482} +{"step": 41400, "loss": 0.02118838906288147, "loss_real": 0.01546993512660265, "loss_synth": 0.02088684732094407, "lr": 5.3896666594335835e-05, "elapsed": 906.5186302550137, "steps_per_second": 46.32279730190587, "loss_extra": 0.02248211210593581} +{"step": 41600, "loss": 0.021227899761870502, "loss_real": 0.015614962754771113, "loss_synth": 0.020944671826437115, "lr": 5.20158190588919e-05, "elapsed": 910.3120693319943, "steps_per_second": 46.3498465481274, "loss_extra": 0.02248505558818579} +{"step": 41800, "loss": 0.0212560017593205, "loss_real": 0.0159170950204134, "loss_synth": 0.021037250673398376, "lr": 5.017507856989665e-05, "elapsed": 914.1102339759236, "steps_per_second": 46.376424959884005, "loss_extra": 0.022401347141712904} +{"step": 42000, "loss": 0.021171702751889825, "loss_real": 0.015782184754498302, "loss_synth": 0.02086950874887407, "lr": 4.837473580161169e-05, "elapsed": 917.9018945390126, "steps_per_second": 46.403113750852285, "loss_extra": 0.022408930473029613} +{"step": 42200, "loss": 0.021202073721215128, "loss_real": 0.0157850584667176, "loss_synth": 0.02089367083273828, "lr": 4.6615075049030575e-05, "elapsed": 921.6939821469132, "steps_per_second": 46.429558064528734, "loss_extra": 0.022450260752812028} +{"step": 42400, "loss": 0.02115390496328473, "loss_real": 0.015645496007055046, "loss_synth": 0.020852152053266765, "lr": 4.489637418298455e-05, "elapsed": 925.4830478299409, "steps_per_second": 46.455936441445594, "loss_extra": 0.022411348009482027} +{"step": 42600, "loss": 0.02118510762229562, "loss_real": 0.015825846642255784, "loss_synth": 0.02086882042698562, "lr": 4.321890460626433e-05, "elapsed": 929.268078987021, "steps_per_second": 46.48230132625944, "loss_extra": 0.022431112173944712} +{"step": 42800, "loss": 0.021138708153739572, "loss_real": 0.015824256758205594, "loss_synth": 0.02084315334446728, "lr": 4.158293121076186e-05, "elapsed": 933.0548071059166, "steps_per_second": 46.508363551297876, "loss_extra": 0.022356283478438856} +{"step": 43000, "loss": 0.02119176565669477, "loss_real": 0.015586027018725872, "loss_synth": 0.020954094454646112, "lr": 3.99887123356411e-05, "elapsed": 936.8547781360103, "steps_per_second": 46.53354531806188, "loss_extra": 0.022402307568117976} +{"step": 43200, "loss": 0.021072260132059456, "loss_real": 0.015528170461766421, "loss_synth": 0.020730749629437925, "lr": 3.843649972654328e-05, "elapsed": 940.6459102799417, "steps_per_second": 46.558964335636716, "loss_extra": 0.02237549097277224} +{"step": 43400, "loss": 0.02117328020744026, "loss_real": 0.01570431615691632, "loss_synth": 0.02084290678612888, "lr": 3.69265384958331e-05, "elapsed": 944.4396228379337, "steps_per_second": 46.58404745456953, "loss_extra": 0.022452369686216115} +{"step": 43600, "loss": 0.02119528053328395, "loss_real": 0.015712960488162935, "loss_synth": 0.02088369715027511, "lr": 3.545906708389291e-05, "elapsed": 948.2326143470127, "steps_per_second": 46.608963048505366, "loss_extra": 0.022457980047911406} +{"step": 43800, "loss": 0.02109206813387573, "loss_real": 0.015562200522981583, "loss_synth": 0.020848485697060822, "lr": 3.403431722147019e-05, "elapsed": 952.0265441669617, "steps_per_second": 46.63363082402128, "loss_extra": 0.02229531521908939} +{"step": 44000, "loss": 0.021125713055953385, "loss_real": 0.01572064750827849, "loss_synth": 0.020827191602438688, "lr": 3.265251389308442e-05, "elapsed": 955.816662756959, "steps_per_second": 46.658288674549496, "loss_extra": 0.022361984485760333} +{"step": 44200, "loss": 0.021124069588258864, "loss_real": 0.015496464651077986, "loss_synth": 0.02082963949069381, "lr": 3.1313875301499545e-05, "elapsed": 959.6040801450144, "steps_per_second": 46.68288229968208, "loss_extra": 0.022394928531721234} +{"step": 44400, "loss": 0.021125102043151857, "loss_real": 0.01575612189248204, "loss_synth": 0.0207925049867481, "lr": 3.0018612833267117e-05, "elapsed": 963.3907954560127, "steps_per_second": 46.70731445529099, "loss_extra": 0.022389035541564226} +{"step": 44600, "loss": 0.021128877475857736, "loss_real": 0.015819835099391638, "loss_synth": 0.02086131541058421, "lr": 2.8766931025346027e-05, "elapsed": 967.1958708439488, "steps_per_second": 46.73065373673389, "loss_extra": 0.022317638816311956} +{"step": 44800, "loss": 0.021089565977454185, "loss_real": 0.015402738684788347, "loss_synth": 0.02084092712029815, "lr": 2.755902753280375e-05, "elapsed": 971.0434423119295, "steps_per_second": 46.75173425336288, "loss_extra": 0.022325116377323866} +{"step": 45000, "loss": 0.02107809916138649, "loss_real": 0.015491709974594415, "loss_synth": 0.020809451304376125, "lr": 2.639509309760422e-05, "elapsed": 975.0254605199443, "steps_per_second": 46.7661109162101, "loss_extra": 0.022316124755889177} +{"step": 45200, "loss": 0.021120551778003573, "loss_real": 0.015551258805207907, "loss_synth": 0.020821907464414834, "lr": 2.5275311518487436e-05, "elapsed": 979.6529041519389, "steps_per_second": 46.74914103590729, "loss_extra": 0.022385476836934686} +{"step": 45400, "loss": 0.02106191431172192, "loss_real": 0.01576831435319036, "loss_synth": 0.02075611841864884, "lr": 2.4199859621945708e-05, "elapsed": 983.468687186949, "steps_per_second": 46.77140940033332, "loss_extra": 0.0222860642708838} +{"step": 45600, "loss": 0.021027714097872376, "loss_real": 0.015325079010799526, "loss_synth": 0.020751854125410318, "lr": 2.316890723430054e-05, "elapsed": 987.422943873913, "steps_per_second": 46.786855052660776, "loss_extra": 0.02229311659000814} +{"step": 45800, "loss": 0.021044814623892308, "loss_real": 0.015391320316120982, "loss_synth": 0.02082334667444229, "lr": 2.218261715488513e-05, "elapsed": 991.4188963649794, "steps_per_second": 46.80018182761749, "loss_extra": 0.022247518310323358} +{"step": 46000, "loss": 0.02108687425032258, "loss_real": 0.015393350892700254, "loss_synth": 0.02080488171428442, "lr": 2.1241145130336496e-05, "elapsed": 995.2257276759483, "steps_per_second": 46.82241189449825, "loss_extra": 0.02235680030658841} +{"step": 46200, "loss": 0.0210551218688488, "loss_real": 0.015461524003185331, "loss_synth": 0.020767462207004428, "lr": 2.0344639830001105e-05, "elapsed": 999.0179848339176, "steps_per_second": 46.84516258549018, "loss_extra": 0.022313330844044684} +{"step": 46400, "loss": 0.021030524959787727, "loss_real": 0.015528104463592173, "loss_synth": 0.020693513602018355, "lr": 1.949324282245851e-05, "elapsed": 1002.8067192259477, "steps_per_second": 46.86790576622616, "loss_extra": 0.022322036791592836} +{"step": 46600, "loss": 0.02104046883992851, "loss_real": 0.015561840175651013, "loss_synth": 0.020754316318780185, "lr": 1.8687088553165976e-05, "elapsed": 1006.5918895360082, "steps_per_second": 46.890643646190156, "loss_extra": 0.022277203891426324} +{"step": 46800, "loss": 0.02115191688761115, "loss_real": 0.01541677227243781, "loss_synth": 0.02080696342512965, "lr": 1.7926304323227836e-05, "elapsed": 1010.3977996950271, "steps_per_second": 46.91223377161959, "loss_extra": 0.022491768021136522} +{"step": 47000, "loss": 0.021039902828633786, "loss_real": 0.015434314529411495, "loss_synth": 0.020758178886026143, "lr": 1.721101026929328e-05, "elapsed": 1014.1941258920124, "steps_per_second": 46.934108924800825, "loss_extra": 0.022294284459203482} +{"step": 47200, "loss": 0.02094830763526261, "loss_real": 0.015338373673148453, "loss_synth": 0.020676757749170063, "lr": 1.6541319344585365e-05, "elapsed": 1017.9823346559424, "steps_per_second": 46.956198027624495, "loss_extra": 0.022193313250318168} +{"step": 47400, "loss": 0.021067776568233967, "loss_real": 0.015695062391459944, "loss_synth": 0.020830663461238144, "lr": 1.5917337301064426e-05, "elapsed": 1021.7707578910049, "steps_per_second": 46.9781112820497, "loss_extra": 0.02223727953620255} +{"step": 47600, "loss": 0.021055896785110235, "loss_real": 0.015468670995905995, "loss_synth": 0.020753349037840964, "lr": 1.533916267272854e-05, "elapsed": 1025.5650693760253, "steps_per_second": 46.99958732529146, "loss_extra": 0.022327823573723437} +{"step": 47800, "loss": 0.020952915186062456, "loss_real": 0.015667229094542563, "loss_synth": 0.020630921795964242, "lr": 1.480688676005397e-05, "elapsed": 1029.3634258129168, "steps_per_second": 47.02071598766748, "loss_extra": 0.022191819604486226} +{"step": 48000, "loss": 0.021091246167197823, "loss_real": 0.015768076502718033, "loss_synth": 0.0207849823217839, "lr": 1.432059361557764e-05, "elapsed": 1033.1570758079179, "steps_per_second": 47.041904308606696, "loss_extra": 0.022320999288931487} +{"step": 48200, "loss": 0.02104981224052608, "loss_real": 0.015609717057086527, "loss_synth": 0.02081296936608851, "lr": 1.3880360030624374e-05, "elapsed": 1036.9543339529773, "steps_per_second": 47.06276985714375, "loss_extra": 0.02223075213842094} +{"step": 48400, "loss": 0.021016456661745907, "loss_real": 0.015775386239401997, "loss_synth": 0.020668387431651353, "lr": 1.3486255523180529e-05, "elapsed": 1040.7365688310238, "steps_per_second": 47.08416935409462, "loss_extra": 0.022273574946448205} +{"step": 48600, "loss": 0.020992363067343832, "loss_real": 0.015559203657321632, "loss_synth": 0.02074245672672987, "lr": 1.313834232691649e-05, "elapsed": 1044.5227455790155, "steps_per_second": 47.10523201851356, "loss_extra": 0.022185106026008726} +{"step": 48800, "loss": 0.021029189517721533, "loss_real": 0.01572366364300251, "loss_synth": 0.02071386083960533, "lr": 1.2836675381359077e-05, "elapsed": 1048.307940308936, "steps_per_second": 47.12618532452274, "loss_extra": 0.022264904025942087} +{"step": 49000, "loss": 0.02100670269690454, "loss_real": 0.01562307487707585, "loss_synth": 0.020634776428341866, "lr": 1.2581302323216026e-05, "elapsed": 1052.1027021110058, "steps_per_second": 47.146552000849326, "loss_extra": 0.022312343614175917} +{"step": 49200, "loss": 0.021009514750912787, "loss_real": 0.015510169239714742, "loss_synth": 0.020726337442174555, "lr": 1.2372263478853567e-05, "elapsed": 1055.8973099630093, "steps_per_second": 47.16677747023155, "loss_extra": 0.022246885988861324} +{"step": 49400, "loss": 0.020970329465344547, "loss_real": 0.015551587068475783, "loss_synth": 0.020591746903955935, "lr": 1.2209591857928498e-05, "elapsed": 1059.6908346390119, "steps_per_second": 47.18690514034538, "loss_extra": 0.022288698730990292} +{"step": 49600, "loss": 0.021029043486341836, "loss_real": 0.015317683974280953, "loss_synth": 0.020759445307776334, "lr": 1.2093313148175555e-05, "elapsed": 1063.4826397709548, "steps_per_second": 47.20696472170098, "loss_extra": 0.02228972624987364} +{"step": 49800, "loss": 0.021078291833400726, "loss_real": 0.01571546845138073, "loss_synth": 0.020780425732955337, "lr": 1.2023445711350887e-05, "elapsed": 1067.2748636340257, "steps_per_second": 47.226861292657354, "loss_extra": 0.022306572049856185} +{"step": 50000, "loss": 0.02099117126315832, "loss_real": 0.015561681441031396, "loss_synth": 0.020648777959868313, "lr": 1.2000000580332747e-05, "elapsed": 1071.066103184945, "steps_per_second": 47.24665918912805, "loss_extra": 0.022275371626019478} diff --git a/shared/package-files/89/89f03580d4b6c4f78d6287b6bd677571f88e201ee1b303d2610b46da6369ecef/netprop.py b/shared/package-files/89/89f03580d4b6c4f78d6287b6bd677571f88e201ee1b303d2610b46da6369ecef/netprop.py new file mode 100644 index 0000000000000000000000000000000000000000..33e45ec0402c81b989686da9f89b28c2043bf5eb --- /dev/null +++ b/shared/package-files/89/89f03580d4b6c4f78d6287b6bd677571f88e201ee1b303d2610b46da6369ecef/netprop.py @@ -0,0 +1,348 @@ +"""Cross-pool consensus ("network annotation propagation") inside one input fold (lab, E65) + +netprop.py search --out evals/netprop/neigh-val.npz +netprop.py evaluate --neigh evals/netprop/neigh-val.npz --pred evals/fullfold/NAME/pred [--shuffle SEED] + +Hypothesis: spectra of different pools of the same input set that resemble each other belong to +structurally related molecules, so the current best candidates of the most similar OTHER pools +are evidence for the candidates that resemble them - the library-neighbour branch (pkg/library.py) +with the fold's own spectra as the library and the package's own top candidates in place of +labels. No label is read by the term; validation labels only evaluate. + + similarity(q, B) = max over spectra t of pool B (B != pool of q) of + 0.5 * (fragment cosine(q, t) + neutral-loss cosine(q, t)) + vote_q(c) = sum_B s_B^p * sum_b P_B(b) Tanimoto(c, b) / sum_B s_B^p - prior(c) + distance_q(c) = released fused distance + lam * (-vote_q(c)), then the pool mean + +P_B: the first candidate of pool B under the released ranking ("top1"), or a softmax over B's first +m candidates. prior(c): the vote with all pools weighted equally (what a candidate gets from +"resembling the fold's current answers in general"). +""" +import argparse +import json +import pickle +import sys +import time +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import scorelab +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import infer +import library + +ROOT = Path('/workspace/research') +WIDTH = 0.01 + + +def load(subset=None): + """Validation input; ``subset`` = "FRACTION:SEED" keeps a random share of the pools (a shard of the fold).""" + root = ROOT / 'validation-input' + queries = list(infer.read_jsonl(root / 'queries.jsonl')) + pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(root / 'candidate_pools.jsonl')} + if subset: + fraction, seed = subset.split(':') + ids = sorted(pools) + keep = set(np.random.default_rng(int(seed)).permutation(ids)[:max(2, int(round(float(fraction) * len(ids))))].tolist()) + queries = [q for q in queries if q['candidate_pool_id'] in keep] + return queries, pools + + +def search(args): + queries, pools = load(args.pools) + pool_ids = list(dict.fromkeys(q['candidate_pool_id'] for q in queries)) + slot = {pid: n for n, pid in enumerate(pool_ids)} + qpool = np.array([slot[q['candidate_pool_id']] for q in queries]) + order = np.argsort(qpool, kind='stable') # library columns ordered by pool + starts = np.flatnonzero(np.diff(qpool[order], prepend=-1) != 0) + records = [(q['mzs'], q['intensities'], float(q['precursor_mz'])) for q in queries] + started = time.monotonic() + frag, loss = library.spectrum_vectors([records[i] for i in order], WIDTH, spread=False) + frag, loss = frag.T.tocsr(), loss.T.tocsr() + top = min(args.top, len(pool_ids) - 1) + mol = np.zeros((len(queries), top), np.int64) + val = np.zeros((len(queries), top), np.float32) + for low in range(0, len(queries), args.chunk): + high = min(len(queries), low + args.chunk) + qf, ql = library.spectrum_vectors(records[low:high], WIDTH, spread=True) + sim = 0.5 * (np.asarray((qf @ frag).todense(), dtype=np.float32) + np.asarray((ql @ loss).todense(), dtype=np.float32)) + per_pool = np.maximum.reduceat(sim, starts, axis=1) + per_pool[np.arange(high - low), qpool[low:high]] = -1.0 # never the query's own pool + rank = np.argsort(-per_pool, axis=1, kind='stable')[:, :top] + mol[low:high] = rank + val[low:high] = np.take_along_axis(per_pool, rank, axis=1) + np.savez(ROOT / args.out, pool=mol, sim=val, pool_ids=np.array(pool_ids), query_ids=np.array([q['query_id'] for q in queries])) + print(f'{len(queries)} queries, {len(pool_ids)} pools, {time.monotonic() - started:.0f} s; best similarity median {np.median(val[:, 0]):.3f}, ' + f'10th {np.median(val[:, 9]):.3f}; share with best >= 0.5: {np.mean(val[:, 0] >= 0.5):.3f}, >= 0.7: {np.mean(val[:, 0] >= 0.7):.3f}') + + +def released(queries, pools, pred, config): + """Per-query fused distance of the released rule from the saved branch outputs.""" + sizes = {} + for q in queries: + sizes[q['candidate_pool_id']] = sizes.get(q['candidate_pool_id'], 0) + 1 + inv, lib, ion = config['inverse'], config['library'], config['ion'] + out = [] + for q in queries: + qid = q['query_id'] + n = len(pools[q['candidate_pool_id']]) + domain = q['adduct'] == '[M+H]+' and q.get('collision_energy') is not None + size = sizes[q['candidate_pool_id']] + d = pred['distances'].get(qid) + for name, part, fill in (('inverse', inv, 1.0), ('library', lib, 0.0), ('ion', ion, None)): + extra = pred[name].get(qid) + if extra is None: + continue + weight = part['weight_domain'] if domain else max(part['weight_other'], part.get('weight_other_single', 0.0) / size) + if weight == 0: + continue + if fill is not None: + extra = np.where(np.isfinite(extra), extra, fill) + d = (d if d is not None else np.ones(n)) + weight * extra + out.append(d) + return out + + +def tanimoto(a, b): + import torch + if torch.cuda.is_available(): + a, b = torch.from_numpy(a).cuda(), torch.from_numpy(b).cuda() + inter = a @ b.T + return (inter / (a.sum(1)[:, None] + b.sum(1)[None, :] - inter).clamp_min(1.0)).double().cpu().numpy() + inter = a @ b.T + return inter / np.maximum(a.sum(1)[:, None] + b.sum(1)[None, :] - inter, 1.0) + + +def twin_flags(queries, pools, ev, members): + """Analysis only (labels): pools whose target shares its 2D InChIKey block with another pool's target.""" + cache = ROOT / 'evals/netprop/twin-flags.json' + if cache.exists(): + return json.load(open(cache)) + from collections import Counter + from rdkit import Chem, RDLogger + RDLogger.DisableLog('rdApp.*') + key = {pid: Chem.MolToInchiKey(Chem.MolFromSmiles(pools[pid][ev.target[rows[0]]]['smiles']))[:14] for pid, rows in members.items()} + count = Counter(key.values()) + flags = {pid: int(count[k] > 1) for pid, k in key.items()} + json.dump(flags, open(cache, 'w')) + return flags + + +def evaluate(args): + queries, pools = load(args.pools) + ev = scorelab.Evaluator(queries, pools) + pred = {name: pickle.load(open(ROOT / args.pred / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion')} + config = json.load(open(ROOT / args.config)) + base = released(queries, pools, pred, config) + base_rank = ev.ranks(base, 1.0) + neigh = np.load(ROOT / args.neigh, allow_pickle=True) + pool_ids = list(neigh['pool_ids']) + assert 'query_ids' not in neigh.files or list(neigh['query_ids']) == [q['query_id'] for q in queries] + npool, nsim = neigh['pool'], np.maximum(neigh['sim'].astype(np.float64), 0.0) + if args.shuffle is not None: + perm = np.random.default_rng(args.shuffle).permutation(len(queries)) + npool, nsim = npool[perm], nsim[perm] + slot = {pid: n for n, pid in enumerate(pool_ids)} + store = np.load(ROOT / 'inv/pools-validation-input.npz') + sslot = {pid: n for n, pid in enumerate(store['pool_id'])} + cstart, cfps = store['pool_cand_start'], store['cand_fps'] + alt = np.load(ROOT / 'inv/alt-multi8192/pools-validation-input.cand_fps.npy', mmap_mode='r') if args.fps != 'morgan' else None + + def bits(pid, rows=None): + low, high = cstart[sslot[pid]], cstart[sslot[pid] + 1] + parts = [] + for name in args.fps.split('+'): # morgan | multi | multi:BLOCK (AtomPair, torsion, feature-Morgan, RDKit path) + block = np.asarray((cfps if name == 'morgan' else alt)[low:high]) + if ':' in name: + b = int(name.split(':')[1]) + block = block[:, b * 256:(b + 1) * 256] + parts.append(np.unpackbits(block if rows is None else block[rows], axis=1)) + return np.concatenate(parts, axis=1).astype(np.float32) + + members = {} + for i, q in enumerate(queries): + members.setdefault(q['candidate_pool_id'], []).append(i) + plist = list(members) + domain = ev.domain + n_all = len(queries) + hit0 = base_rank == 0 + sizes = np.array([len(members[pid]) for pid in plist], dtype=float) + first_q = np.array([members[pid][0] for pid in plist]) + twin = np.array([twin_flags(queries, pools, ev, members)[pid] for pid in plist], dtype=bool) + big = np.zeros(len(plist), dtype=bool) + big[np.argsort(-sizes)[:max(1, round(20 * len(plist) / 3386))]] = True + capped = np.minimum(sizes, 30.0) + print(f'released rule from saved branches: Hit@1 {hit0.mean():.4f} pool-macro {hit0[first_q].mean():.4f} Hit@5 {np.mean(base_rank < 5):.4f} Hit@20 {np.mean(base_rank < 20):.4f}' + f' | twin pools {int(twin.sum())} (macro {hit0[first_q][twin].mean():.4f}), others macro {hit0[first_q][~twin].mean():.4f}') + m, tau = args.m, args.tau + kmax = max(int(spec.split(':')[0]) for spec in args.variants.split(',')) + if not args.no_ties: # package rule: pools tied with the k-th one vote as well + kmax = npool.shape[1] + + def kernel(t): + if args.kernel == 'plain': + return t + cap = float(args.kernel.split('=')[1]) + return np.minimum(t, cap) / cap + + def vote_table(current): + """Per pool: {neighbour pool: row}, [neighbour pools, candidates] votes of their pseudo answers minus the prior. + + Pseudo answers of a pool: the first m candidates of the pool-mean ranking of ``current``.""" + rng = np.random.default_rng(0) + answer_bits, answer_w = {}, {} + for pid, rows in members.items(): + vals = [current[i] for i in rows if current[i] is not None] + if not vals: + continue + mean = np.mean(vals, axis=0) + order = np.lexsort((ev.ids[pid], mean))[:m] + if args.control == 'random-candidate': + order = rng.permutation(len(mean))[:m] + w = np.exp(-(mean[order] - mean[order[0]]) / tau) if m > 1 else np.ones(1) + answer_bits[slot[pid]] = bits(pid, order) + answer_w[slot[pid]] = w / w.sum() + have = sorted(answer_bits) + all_bits = np.concatenate([answer_bits[n] for n in have]) + all_w = np.concatenate([answer_w[n] for n in have]) + first = np.cumsum([0] + [len(answer_w[n]) for n in have]) + position = {n: j for j, n in enumerate(have)} + votes = {} + for pid, rows in members.items(): + cand = bits(pid) + used = np.array([n for n in np.unique(npool[rows][:, :kmax]) if n in position]) + if not len(used): + continue + cols = np.concatenate([np.arange(first[position[n]], first[position[n] + 1]) for n in used]) + owner = np.concatenate([np.full(first[position[n] + 1] - first[position[n]], j) for j, n in enumerate(used)]) + t = kernel(tanimoto(cand, all_bits[cols])) * all_w[cols][None, :] + per_pool = np.zeros((len(used), len(cand))) + np.add.at(per_pool, owner, t.T) + prior = (kernel(tanimoto(cand, all_bits)) * all_w[None, :]).sum(1) / len(have) if args.debias == 'fold' else np.zeros(len(cand)) + votes[pid] = ({n: j for j, n in enumerate(used)}, per_pool - prior[None, :]) + confidence.clear() + confidence.update({n: float(answer_w[n].max()) for n in have}) + return votes + + confidence = {} + + def term_of(votes, k, power, norm): + term = [None] * n_all + for pid, rows in members.items(): + if pid not in votes: + continue + lookup, per_pool = votes[pid] + for i in rows: + last = min(k, npool.shape[1]) + if args.no_ties: + w = np.array([nsim[i, j] ** power if npool[i, j] in lookup else 0.0 for j in range(last)]) + else: + w = np.array([nsim[i, j] ** power if (npool[i, j] in lookup and nsim[i, j] >= nsim[i, last - 1]) else 0.0 for j in range(npool.shape[1])]) + if args.conf == 'top': # neighbours weighted by the peak of their own answer distribution + w = w * np.array([confidence.get(npool[i, j], 0.0) for j in range(len(w))]) + if w.sum() <= 0: + continue + idx = np.array([lookup.get(npool[i, j], 0) for j in range(len(w))]) + scale = w / (w.sum() if norm == 'norm' else 1.0 if norm == 'raw' else w.sum() + float(norm.split('=')[1]) ** power) + term[i] = -(per_pool[idx] * scale[:, None]).sum(0) + return term + + def fuse(term, lam_d, lam_o): + return [base[i] if (base[i] is None or term[i] is None or (lam_d if domain[i] else lam_o) == 0) else base[i] + (lam_d if domain[i] else lam_o) * term[i] + for i in range(n_all)] + + votes = vote_table(base) + lams = [tuple(float(x) for x in item.split('/')) for item in args.lams.split(',')] + boot = ev.boot + mz = np.array([float(q['precursor_mz']) for q in queries]) + saved = {} + for spec in args.variants.split(','): + k, power, norm = spec.split(':') + k, power = int(k), float(power) + term = term_of(votes, k, power, norm) + saved[spec] = term + alone = ev.ranks(term, 1.0) + print(f'\nk={k} p={power} {norm} | m={m} tau={tau} kernel={args.kernel} fps={args.fps} debias={args.debias} control={args.control} shuffle={args.shuffle}: ' + f'alone Hit@1 {np.mean(alone == 0):.4f} (domain {np.mean(alone[domain] == 0):.4f} / other {np.mean(alone[~domain] == 0):.4f}) macro {np.mean(alone[first_q] == 0):.4f}') + for lam_d, lam_o in lams: + fused = fuse(term, lam_d, lam_o) + for _ in range(args.rounds - 1): # further rounds: pseudo answers from the current fused ranking + fused = fuse(term_of(vote_table(fused), k, power, norm), lam_d, lam_o) + rank = ev.ranks(fused, 1.0) + hit = rank == 0 + d = (hit[first_q].astype(float) - hit0[first_q].astype(float)) + per_query = np.sum(d[boot] * sizes[boot], axis=1) / np.sum(sizes[boot], axis=1) + macro = d[boot].mean(axis=1) + trim = np.sum(d * sizes * ~big) / np.sum(sizes * ~big) + cap = np.sum(d * capped) / capped.sum() + cap_boot = np.sum(d[boot] * capped[boot], axis=1) / np.sum(capped[boot], axis=1) + d5 = (rank[first_q] < 5).astype(float) - (base_rank[first_q] < 5).astype(float) + print(f' lam {lam_d:.2f}/{lam_o:.2f}: Hit@1 {hit.mean():.4f} ({hit.mean() - hit0.mean():+.4f} [{np.percentile(per_query, 2.5):+.4f}, {np.percentile(per_query, 97.5):+.4f}])' + f' macro {d.mean():+.4f} [{np.percentile(macro, 2.5):+.4f}, {np.percentile(macro, 97.5):+.4f}] pools +{int((d > 0).sum())} -{int((d < 0).sum())}' + f' | no top 20 {trim:+.4f} cap30 {cap:+.4f} [{np.percentile(cap_boot, 2.5):+.4f}, {np.percentile(cap_boot, 97.5):+.4f}]' + f' | Hit@5 {np.mean(rank < 5) - np.mean(base_rank < 5):+.4f} macro@5 {d5.mean():+.4f} cap30@5 {np.sum(d5 * capped) / capped.sum():+.4f}' + + ('' if args.brief else f' | twin +{int((d[twin] > 0).sum())} -{int((d[twin] < 0).sum())} other +{int((d[~twin] > 0).sum())} -{int((d[~twin] < 0).sum())}' + f' | dom {hit[domain].mean() - hit0[domain].mean():+.4f} oth {hit[~domain].mean() - hit0[~domain].mean():+.4f}')) + if args.detail: + top = np.argsort(-sizes)[:args.detail] + print(' largest pools (size: rank before -> after): ' + ' '.join(f'{int(sizes[j])}: {base_rank[first_q[j]] + 1}->{rank[first_q[j]] + 1}' for j in top)) + moved = np.where(d != 0)[0] + lost = [j for j in moved if d[j] < 0] + print(' lost pools: size median %.0f, sum %d; gained pools: size median %.0f, sum %d' % ( + np.median(sizes[lost]), sizes[lost].sum(), np.median(sizes[[j for j in moved if d[j] > 0]]), sizes[[j for j in moved if d[j] > 0]].sum())) + if args.flips: # per-pool record of the last variant and weight (analysis of gains and losses) + records = [] + for j, pid in enumerate(plist): + rows = members[pid] + vals = [base[i] for i in rows if base[i] is not None] + mean = np.sort(np.mean(vals, axis=0)) if vals else np.zeros(2) + new = np.mean([fused[i] for i in rows if fused[i] is not None], axis=0) if vals else np.zeros(2) + best = np.lexsort((ev.ids[pid], new))[0] if vals else 0 + tvals = [term[i] for i in rows if term[i] is not None] + records.append({'pool': pid, 'size': len(rows), 'twin': bool(twin[j]), 'base_rank': int(base_rank[rows[0]]), 'rank': int(rank[rows[0]]), + 'best_sim': float(np.max(nsim[rows, 0])), 'mean_sim': float(np.mean(nsim[rows, 0])), + 'margin': float(mean[1] - mean[0]) if len(mean) > 1 else 0.0, 'spread': float(np.std(mean)) if len(mean) > 1 else 0.0, + 'term_spread': float(np.std(np.mean(tvals, axis=0))) if tvals else 0.0, + 'domain': float(domain[rows].mean()), 'mz': float(np.median(mz[rows])), 'cands': len(mean)}) + json.dump(records, open(ROOT / args.flips, 'w')) + if args.save: + pickle.dump({'term': saved, 'base_rank': base_rank}, open(ROOT / args.save, 'wb')) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + sub = p.add_subparsers(dest='cmd', required=True) + a = sub.add_parser('search') + a.add_argument('--out', required=True) + a.add_argument('--top', type=int, default=32) + a.add_argument('--chunk', type=int, default=400) + a.add_argument('--pools', help='FRACTION:SEED - random share of the pools') + b = sub.add_parser('evaluate') + b.add_argument('--neigh', required=True) + b.add_argument('--pred', required=True) + b.add_argument('--config', default='builds/5Ms-I9b+I13-L-ion/model_config.json') + b.add_argument('--variants', default='10:6:norm', help='k:power:norm|raw|half=c, comma separated') + b.add_argument('--lams', default='0/0.25,0/0.5,0.5/0.5,0/1') + b.add_argument('--m', type=int, default=1) + b.add_argument('--tau', type=float, default=1.0) + b.add_argument('--kernel', default='plain', help='plain | cap=THETA: min(T, THETA) / THETA') + b.add_argument('--debias', default='fold') + b.add_argument('--fps', default='morgan', help="fingerprint of the vote's Tanimoto: morgan | multi | multi:BLOCK | joined with '+'") + b.add_argument('--control', default='none', help='none | random-candidate') + b.add_argument('--detail', type=int, default=0) + b.add_argument('--rounds', type=int, default=1) + b.add_argument('--no-ties', action='store_true', help='exactly k neighbours (lab runs before the package rule)') + b.add_argument('--conf', default='none', help='none | top') + b.add_argument('--brief', action='store_true') + b.add_argument('--pools', help='FRACTION:SEED - random share of the pools (use the matching neighbour file)') + b.add_argument('--flips') + b.add_argument('--shuffle', type=int) + b.add_argument('--save') + args = p.parse_args() + {'search': search, 'evaluate': evaluate}[args.cmd](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/92/920e202f6e95f6f2d23a0b9b4a3756ecdded33387d6edf8696ebe3401149bbd1/anchorlab-B45a-51k.log b/shared/package-files/92/920e202f6e95f6f2d23a0b9b4a3756ecdded33387d6edf8696ebe3401149bbd1/anchorlab-B45a-51k.log new file mode 100644 index 0000000000000000000000000000000000000000..bce69468129b97f8a9fb1c2756e50d5368844919 --- /dev/null +++ b/shared/package-files/92/920e202f6e95f6f2d23a0b9b4a3756ecdded33387d6edf8696ebe3401149bbd1/anchorlab-B45a-51k.log @@ -0,0 +1,16 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 90.01499832699483} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 94.29400285099109} +ind noprec_pp0.75 all=0.4768 dom=0.7174 non=0.2353 h5=0.6300 h20=0.7103 | diff=+0.0000 [+0.0000,+0.0000] +agg noprec_pp0.75 all=0.6117 dom=0.8023 non=0.4203 h5=0.8144 h20=0.8791 | diff=+0.0000 [+0.0000,+0.0000] +ind a5 all=0.4844 dom=0.7232 non=0.2446 h5=0.6387 h20=0.7138 | diff=+0.0076 [+0.0037,+0.0111] +agg a5 all=0.6202 dom=0.8061 non=0.4335 h5=0.8268 h20=0.8899 | diff=+0.0085 [-0.0040,+0.0215] +ind a10 all=0.4878 dom=0.7201 non=0.2546 h5=0.6440 h20=0.7254 | diff=+0.0110 [+0.0071,+0.0149] +agg a10 all=0.6218 dom=0.8053 non=0.4375 h5=0.8184 h20=0.8931 | diff=+0.0101 [-0.0049,+0.0261] +ind p10f1 all=0.4840 dom=0.7279 non=0.2392 h5=0.6341 h20=0.7094 | diff=+0.0072 [+0.0032,+0.0112] +agg p10f1 all=0.6208 dom=0.8128 non=0.4280 h5=0.8226 h20=0.8961 | diff=+0.0091 [-0.0071,+0.0240] +ind p10f2 all=0.4854 dom=0.7290 non=0.2407 h5=0.6354 h20=0.7107 | diff=+0.0085 [+0.0046,+0.0123] +agg p10f2 all=0.6179 dom=0.8113 non=0.4237 h5=0.8193 h20=0.8954 | diff=+0.0062 [-0.0082,+0.0194] +ind p20f2 all=0.4868 dom=0.7241 non=0.2486 h5=0.6402 h20=0.7186 | diff=+0.0100 [+0.0059,+0.0136] +agg p20f2 all=0.6261 dom=0.8114 non=0.4401 h5=0.8205 h20=0.8951 | diff=+0.0144 [-0.0003,+0.0306] +ind p20f4 all=0.4873 dom=0.7236 non=0.2499 h5=0.6412 h20=0.7200 | diff=+0.0104 [+0.0065,+0.0142] +agg p20f4 all=0.6267 dom=0.8123 non=0.4404 h5=0.8213 h20=0.8935 | diff=+0.0150 [-0.0000,+0.0311] diff --git a/shared/package-files/92/9211aaff1b6b11b5d769037883c202aec3dad1e5e307e41c48f2c97151e1c019/swap-I16-w-0.75_0.05_0.5.log b/shared/package-files/92/9211aaff1b6b11b5d769037883c202aec3dad1e5e307e41c48f2c97151e1c019/swap-I16-w-0.75_0.05_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..5a3108518aa2bfbbf07e1f5ce34fd178ccc6124d --- /dev/null +++ b/shared/package-files/92/9211aaff1b6b11b5d769037883c202aec3dad1e5e307e41c48f2c97151e1c019/swap-I16-w-0.75_0.05_0.5.log @@ -0,0 +1,2 @@ +without consensus term: Hit@1 0.7658 (ref 0.7713; -0.0055 [-0.0132, +0.0017]) macro 0.8630 (+0.0038 [-0.0009, +0.0083]) pools +41 -28 cap30 -0.0059 | Hit@5 0.8799 (+0.0002) Hit@20 0.9409 (+0.0032) + domain 0.9289 (-0.0025) other 0.6021 (-0.0086) | Orbitrap no energy 0.5657 (-0.0107) | above 850 0.4159 (+0.0014) below 850 0.8455 (-0.0071) diff --git a/shared/package-files/92/921d5e8855a1b578a91a13cc721d61f422239c5f4947db1988edca42bc20fc9d/recur-msof-10.log b/shared/package-files/92/921d5e8855a1b578a91a13cc721d61f422239c5f4947db1988edca42bc20fc9d/recur-msof-10.log new file mode 100644 index 0000000000000000000000000000000000000000..b26529681dfcbe39895d34c20cff2fb44b891f2b --- /dev/null +++ b/shared/package-files/92/921d5e8855a1b578a91a13cc721d61f422239c5f4947db1988edca42bc20fc9d/recur-msof-10.log @@ -0,0 +1,2 @@ +msupport tol 10 mDa: 7962 of 19429 spectra in groups of >= 3; peaks 139302 -> 430744; energy set missing for 0; 0 s +wrote /workspace/research/inv/recur/msof-10.npz 163 s diff --git a/shared/package-files/92/92943d175f84d1584a2acfaccbc4d45dea5d02987066cbe327c73225fdf9b468/ion-fit-train.log b/shared/package-files/92/92943d175f84d1584a2acfaccbc4d45dea5d02987066cbe327c73225fdf9b468/ion-fit-train.log new file mode 100644 index 0000000000000000000000000000000000000000..ca9223f86a6e53406cad4d9e7b8d307362cab540 --- /dev/null +++ b/shared/package-files/92/92943d175f84d1584a2acfaccbc4d45dea5d02987066cbe327c73225fdf9b468/ion-fit-train.log @@ -0,0 +1,28 @@ +194119 train spectra +table domain|Orbitrap: {'spectra': 64738, 'present': 0.5068, 'median_ppm': 0.176, 'sigma_ppm': 1.093, 'beyond_3_sigma': 0.0763, 'ml_median_ppm': 0.358, 'ml_sigma_ppm': 1.51, 'ml_background': 0.0204, 'ml_mean_log_density': 6.2307} | by ion mass: [0,250) n 11823 sigma 0.94 ppm / 0.17 mDa; [250,400) n 16478 sigma 1.14 ppm / 0.36 mDa; [400,600) n 4291 sigma 1.45 ppm / 0.65 mDa; [600,2000) n 214 sigma 1.65 ppm / 1.15 mDa +table domain|QTOF: {'spectra': 34603, 'present': 0.5111, 'median_ppm': 0.045, 'sigma_ppm': 3.847, 'beyond_3_sigma': 0.0914, 'ml_median_ppm': 0.027, 'ml_sigma_ppm': 4.348, 'ml_background': 0.0869, 'ml_mean_log_density': 4.9233} | by ion mass: [0,250) n 6772 sigma 4.53 ppm / 0.79 mDa; [250,400) n 7480 sigma 3.08 ppm / 0.96 mDa; [400,600) n 2615 sigma 3.75 ppm / 1.76 mDa; [600,2000) n 820 sigma 4.62 ppm / 3.19 mDa +table domain|other: {'spectra': 36, 'present': 0.8611, 'median_ppm': 2.185, 'sigma_ppm': 4.203, 'beyond_3_sigma': 0.0, 'ml_median_ppm': 2.789, 'ml_sigma_ppm': 3.688, 'ml_background': 0.0, 'ml_mean_log_density': 5.6271} | by ion mass: +table H-no-energy|Orbitrap: {'spectra': 51704, 'present': 0.5479, 'median_ppm': -0.989, 'sigma_ppm': 2.647, 'beyond_3_sigma': 0.1156, 'ml_median_ppm': -0.943, 'ml_sigma_ppm': 2.937, 'ml_background': 0.1196, 'ml_mean_log_density': 5.0128} | by ion mass: [0,250) n 8353 sigma 2.23 ppm / 0.36 mDa; [250,400) n 10412 sigma 2.20 ppm / 0.70 mDa; [400,600) n 4737 sigma 2.72 ppm / 1.28 mDa; [600,2000) n 4828 sigma 5.25 ppm / 3.96 mDa +table H-no-energy|QTOF: {'spectra': 11931, 'present': 0.626, 'median_ppm': 0.801, 'sigma_ppm': 4.239, 'beyond_3_sigma': 0.0754, 'ml_median_ppm': 0.665, 'ml_sigma_ppm': 4.58, 'ml_background': 0.08, 'ml_mean_log_density': 4.7319} | by ion mass: [0,250) n 1454 sigma 4.20 ppm / 0.74 mDa; [250,400) n 3564 sigma 4.41 ppm / 1.38 mDa; [400,600) n 1956 sigma 3.97 ppm / 1.79 mDa; [600,2000) n 495 sigma 3.81 ppm / 2.70 mDa +table H-no-energy|other: {'spectra': 3467, 'present': 0.67, 'median_ppm': 0.61, 'sigma_ppm': 4.033, 'beyond_3_sigma': 0.0895, 'ml_median_ppm': 0.851, 'ml_sigma_ppm': 4.269, 'ml_background': 0.1021, 'ml_mean_log_density': 4.7426} | by ion mass: [0,250) n 480 sigma 3.07 ppm / 0.62 mDa; [250,400) n 1191 sigma 4.27 ppm / 1.34 mDa; [400,600) n 532 sigma 4.53 ppm / 2.21 mDa; [600,2000) n 120 sigma 3.58 ppm / 2.94 mDa +table Na|Orbitrap: {'spectra': 24454, 'present': 0.4954, 'median_ppm': -0.875, 'sigma_ppm': 2.797, 'beyond_3_sigma': 0.1574, 'ml_median_ppm': -0.872, 'ml_sigma_ppm': 2.935, 'ml_background': 0.1834, 'ml_mean_log_density': 4.589} | by ion mass: [0,250) n 1505 sigma 11.71 ppm / 1.69 mDa; [250,400) n 4493 sigma 3.02 ppm / 1.00 mDa; [400,600) n 4473 sigma 2.11 ppm / 0.96 mDa; [600,2000) n 1644 sigma 2.95 ppm / 2.10 mDa +table Na|QTOF: {'spectra': 2361, 'present': 0.8602, 'median_ppm': 1.126, 'sigma_ppm': 4.211, 'beyond_3_sigma': 0.0551, 'ml_median_ppm': 1.119, 'ml_sigma_ppm': 4.103, 'ml_background': 0.0798, 'ml_mean_log_density': 4.5016} | by ion mass: [250,400) n 405 sigma 4.80 ppm / 1.62 mDa; [400,600) n 1162 sigma 3.63 ppm / 1.72 mDa; [600,2000) n 431 sigma 4.67 ppm / 3.29 mDa +table Na|other: {'spectra': 825, 'present': 0.9309, 'median_ppm': 3.305, 'sigma_ppm': 3.261, 'beyond_3_sigma': 0.026, 'ml_median_ppm': 3.003, 'ml_sigma_ppm': 2.969, 'ml_background': 0.0319, 'ml_mean_log_density': 4.9698} | by ion mass: [250,400) n 178 sigma 2.80 ppm / 1.02 mDa; [400,600) n 400 sigma 3.42 ppm / 1.71 mDa; [600,2000) n 179 sigma 2.55 ppm / 1.66 mDa +all n=194119 | peak within 20 mDa 0.533 | error mDa 5/25/50/75/95 % -3.10 -0.54 -0.01 +0.48 +2.88 | ppm median -0.03, robust sigma 2.39 ppm / 0.75 mDa | within 0.05 mDa 0.092 | beyond 3 sigma 0.116 | reported precursor field within 0.05 mDa 0.496, IQR 0.20 mDa +domain Orbitrap n= 64738 | peak within 20 mDa 0.507 | error mDa 5/25/50/75/95 % -0.60 -0.12 +0.04 +0.29 +1.14 | ppm median +0.18, robust sigma 1.09 ppm / 0.29 mDa | within 0.05 mDa 0.173 | beyond 3 sigma 0.076 | reported precursor field within 0.05 mDa 0.959, IQR 0.02 mDa +domain Orbitrap, 3 decimals n= 228 | peak within 20 mDa 0.294 | error mDa 5/25/50/75/95 % -0.44 -0.18 +0.05 +0.30 +0.48 | ppm median +0.23, robust sigma 1.96 ppm / 0.37 mDa | within 0.05 mDa 0.149 | beyond 3 sigma 0.015 | reported precursor field within 0.05 mDa 0.987, IQR 0.01 mDa +domain Orbitrap, 4 decimals n= 35436 | peak within 20 mDa 0.461 | error mDa 5/25/50/75/95 % -0.41 -0.10 +0.01 +0.12 +0.48 | ppm median +0.05, robust sigma 0.69 ppm / 0.16 mDa | within 0.05 mDa 0.261 | beyond 3 sigma 0.076 | reported precursor field within 0.05 mDa 0.955, IQR 0.05 mDa +domain Orbitrap, 5 decimals n= 1684 | peak within 20 mDa 0.802 | error mDa 5/25/50/75/95 % -0.71 -0.27 -0.02 +0.12 +0.49 | ppm median -0.10, robust sigma 1.32 ppm / 0.27 mDa | within 0.05 mDa 0.190 | beyond 3 sigma 0.074 | reported precursor field within 0.05 mDa 0.606, IQR 0.17 mDa +domain QTOF n= 34603 | peak within 20 mDa 0.511 | error mDa 5/25/50/75/95 % -3.38 -0.65 +0.01 +0.61 +3.44 | ppm median +0.04, robust sigma 3.85 ppm / 0.94 mDa | within 0.05 mDa 0.079 | beyond 3 sigma 0.091 | reported precursor field within 0.05 mDa 0.821, IQR 0.03 mDa +domain QTOF, 3 decimals n= 330 | peak within 20 mDa 0.558 | error mDa 5/25/50/75/95 % -5.31 -2.75 -0.60 +0.39 +3.12 | ppm median -2.06, robust sigma 8.69 ppm / 2.37 mDa | within 0.05 mDa 0.022 | beyond 3 sigma 0.049 | reported precursor field within 0.05 mDa 0.221, IQR 0.18 mDa +domain QTOF, 4 decimals n= 22558 | peak within 20 mDa 0.454 | error mDa 5/25/50/75/95 % -2.92 -0.80 -0.09 +0.51 +2.40 | ppm median -0.30, robust sigma 3.70 ppm / 0.92 mDa | within 0.05 mDa 0.052 | beyond 3 sigma 0.063 | reported precursor field within 0.05 mDa 0.776, IQR 0.06 mDa +domain QTOF, 5 decimals n= 10563 | peak within 20 mDa 0.627 | error mDa 5/25/50/75/95 % -4.34 -0.44 +0.30 +1.23 +5.21 | ppm median +1.14, robust sigma 4.13 ppm / 1.21 mDa | within 0.05 mDa 0.038 | beyond 3 sigma 0.127 | reported precursor field within 0.05 mDa 0.918, IQR 0.00 mDa +[M+H]+ no energy Orbitrap n= 51704 | peak within 20 mDa 0.548 | error mDa 5/25/50/75/95 % -5.10 -0.88 -0.26 +0.26 +4.14 | ppm median -0.99, robust sigma 2.65 ppm / 0.86 mDa | within 0.05 mDa 0.053 | beyond 3 sigma 0.116 | reported precursor field within 0.05 mDa 0.049, IQR 0.95 mDa +[M+H]+ no energy Orbitrap, 4 decimals n= 307 | peak within 20 mDa 0.339 | error mDa 5/25/50/75/95 % -0.78 -0.43 -0.25 -0.14 +0.03 | ppm median -1.39, robust sigma 0.96 ppm / 0.25 mDa | within 0.05 mDa 0.096 | beyond 3 sigma 0.019 | reported precursor field within 0.05 mDa 0.993, IQR 0.05 mDa +[M+H]+ no energy QTOF n= 11931 | peak within 20 mDa 0.626 | error mDa 5/25/50/75/95 % -3.84 -0.68 +0.26 +1.17 +3.84 | ppm median +0.80, robust sigma 4.24 ppm / 1.38 mDa | within 0.05 mDa 0.036 | beyond 3 sigma 0.075 | reported precursor field within 0.05 mDa 0.059, IQR 0.81 mDa +[M+H]+ no energy other n= 3467 | peak within 20 mDa 0.670 | error mDa 5/25/50/75/95 % -3.73 -0.55 +0.19 +1.29 +4.54 | ppm median +0.61, robust sigma 4.03 ppm / 1.33 mDa | within 0.05 mDa 0.042 | beyond 3 sigma 0.090 | reported precursor field within 0.05 mDa 0.073, IQR 0.73 mDa +[M+Na]+ Orbitrap n= 24454 | peak within 20 mDa 0.495 | error mDa 5/25/50/75/95 % -4.16 -1.01 -0.33 +0.58 +3.65 | ppm median -0.88, robust sigma 2.80 ppm / 1.19 mDa | within 0.05 mDa 0.040 | beyond 3 sigma 0.157 | reported precursor field within 0.05 mDa 0.072, IQR 3.44 mDa +[M+Na]+ Orbitrap, 4 decimals n= 365 | peak within 20 mDa 0.427 | error mDa 5/25/50/75/95 % -0.08 -0.03 -0.00 +0.03 +0.14 | ppm median -0.00, robust sigma 0.10 ppm / 0.04 mDa | within 0.05 mDa 0.795 | beyond 3 sigma 0.128 | reported precursor field within 0.05 mDa 0.592, IQR 0.57 mDa +[M+Na]+ QTOF n= 2361 | peak within 20 mDa 0.860 | error mDa 5/25/50/75/95 % -4.95 -0.81 +0.56 +1.79 +4.42 | ppm median +1.13, robust sigma 4.21 ppm / 1.94 mDa | within 0.05 mDa 0.022 | beyond 3 sigma 0.055 | reported precursor field within 0.05 mDa 0.198, IQR 0.57 mDa +[M+Na]+ QTOF, 4 decimals n= 826 | peak within 20 mDa 0.757 | error mDa 5/25/50/75/95 % -8.17 -2.47 -0.35 +1.26 +5.92 | ppm median -0.69, robust sigma 5.80 ppm / 2.75 mDa | within 0.05 mDa 0.016 | beyond 3 sigma 0.061 | reported precursor field within 0.05 mDa 0.363, IQR 1.05 mDa +[M+Na]+ other n= 825 | peak within 20 mDa 0.931 | error mDa 5/25/50/75/95 % -1.37 +0.24 +1.49 +2.78 +4.43 | ppm median +3.30, robust sigma 3.26 ppm / 1.87 mDa | within 0.05 mDa 0.030 | beyond 3 sigma 0.026 | reported precursor field within 0.05 mDa 0.076, IQR 0.57 mDa diff --git a/shared/package-files/92/92aa982e5dcbd507359625d1abf918d5f0e0f9cbb100ab9c2159999772b22d6a/replay-5Ms-I9b-L-val-sub.log b/shared/package-files/92/92aa982e5dcbd507359625d1abf918d5f0e0f9cbb100ab9c2159999772b22d6a/replay-5Ms-I9b-L-val-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..491548c99a2dabc2dc50aa4a577b46c08f57e814 --- /dev/null +++ b/shared/package-files/92/92aa982e5dcbd507359625d1abf918d5f0e0f9cbb100ab9c2159999772b22d6a/replay-5Ms-I9b-L-val-sub.log @@ -0,0 +1,17 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 5, "inverse_members": 1, "library": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 5.453034895006567} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 5.77637015102664} +{"event": "candidate_store", "pools": 413, "pairs": 119929, "seconds": 7.891097965009976} +{"event": "library", "scored": 2147, "search_seconds": 8.989161417994183, "seconds": 12.48268008796731} +{"event": "inverse_annotated", "pools": 413, "pairs": 119929, "formulae": 19543, "unsupported_candidates": 938, "seconds": 0.00011364399688318372} +{"event": "inverse", "scored": 2147, "seconds": 4.008346333983354} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 567.4433152429992, "per_second": 112.78659608950181} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 1162.9025104250177, "per_second": 110.06941583883807} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 1386.7080919459695, "per_second": 138.4574021851752} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 1521.365806317015, "per_second": 168.2698526133799} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 1666.2943771620048} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 2.4481904190033674, "total_seconds": 1712.2096859469893} +{"event": "measured", "exit_code": 0, "wall_seconds": 1714.0, "user_seconds": 2664.2, "system_seconds": 36.7, "max_rss_gib": 3.42} +{"event": "replay_checked", "exit_code": 0, "package_files": 268, "package_unchanged": true, "processes_left": 0, "rankings": 2147} diff --git a/shared/package-files/94/941fd7acc6dfe9d2d850b97bae66a27fde8086cd384828448ac5414d1f554e76/inv-mass-route.log b/shared/package-files/94/941fd7acc6dfe9d2d850b97bae66a27fde8086cd384828448ac5414d1f554e76/inv-mass-route.log new file mode 100644 index 0000000000000000000000000000000000000000..4f578b4e85ed2c14c8893681e3d2785b56d2cd8f --- /dev/null +++ b/shared/package-files/94/941fd7acc6dfe9d2d850b97bae66a27fde8086cd384828448ac5414d1f554e76/inv-mass-route.log @@ -0,0 +1,26 @@ +I9b everywhere (release) all=0.7591 dom=0.9227 non=0.5947 h5=0.8761 h20=0.9364 | diff=+0.0000 [+0.0000,+0.0000] | ind 0.6158 +0.0000 [+0.0000,+0.0000] + pools +0 -0 | macro 0.8535 +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +old>=600 all=0.7586 dom=0.9232 non=0.5934 h5=0.8763 h20=0.9321 | diff=-0.0005 [-0.0070,+0.0060] | ind 0.6159 +0.0001 [-0.0026,+0.0029] + pools +9 -20 | macro 0.8503 -0.0032 [-0.0065,-0.0003] | without top 20 -0.0005 [-0.0078,+0.0068] | weight min(n,30) -0.0005 [-0.0080,+0.0070] +both>=600 all=0.7599 dom=0.9220 non=0.5971 h5=0.8765 h20=0.9332 | diff=+0.0008 [-0.0024,+0.0050] | ind 0.6158 +0.0000 [-0.0012,+0.0013] + pools +3 -8 | macro 0.8520 -0.0015 [-0.0035,+0.0003] | without top 20 +0.0009 [-0.0026,+0.0055] | weight min(n,30) +0.0010 [-0.0027,+0.0056] +old>=700 all=0.7597 dom=0.9235 non=0.5953 h5=0.8765 h20=0.9330 | diff=+0.0006 [-0.0059,+0.0069] | ind 0.6170 +0.0011 [-0.0010,+0.0038] + pools +9 -13 | macro 0.8523 -0.0012 [-0.0038,+0.0015] | without top 20 +0.0007 [-0.0066,+0.0079] | weight min(n,30) +0.0007 [-0.0068,+0.0082] +both>=700 all=0.7592 dom=0.9220 non=0.5958 h5=0.8765 h20=0.9338 | diff=+0.0002 [-0.0028,+0.0041] | ind 0.6162 +0.0004 [-0.0007,+0.0015] + pools +2 -6 | macro 0.8523 -0.0012 [-0.0030,+0.0003] | without top 20 +0.0002 [-0.0029,+0.0044] | weight min(n,30) +0.0002 [-0.0029,+0.0046] +old>=850 all=0.7593 dom=0.9205 non=0.5975 h5=0.8750 h20=0.9363 | diff=+0.0003 [-0.0047,+0.0051] | ind 0.6165 +0.0007 [-0.0011,+0.0032] + pools +4 -4 | macro 0.8535 +0.0000 [-0.0018,+0.0018] | without top 20 +0.0003 [-0.0052,+0.0061] | weight min(n,30) +0.0003 [-0.0053,+0.0062] +both>=850 all=0.7604 dom=0.9227 non=0.5974 h5=0.8765 h20=0.9349 | diff=+0.0013 [-0.0006,+0.0047] | ind 0.6163 +0.0005 [-0.0003,+0.0015] + pools +1 -1 | macro 0.8535 +0.0000 [-0.0009,+0.0009] | without top 20 +0.0015 [-0.0007,+0.0053] | weight min(n,30) +0.0015 [-0.0007,+0.0054] +w*0.0>=700 all=0.7363 dom=0.9084 non=0.5635 h5=0.8718 h20=0.9348 | diff=-0.0228 [-0.0362,-0.0105] | ind 0.6001 -0.0157 [-0.0200,-0.0118] + pools +9 -44 | macro 0.8432 -0.0103 [-0.0145,-0.0062] | without top 20 -0.0257 [-0.0414,-0.0120] | weight min(n,30) -0.0239 [-0.0373,-0.0120] +w*0.5>=700 all=0.7530 dom=0.9230 non=0.5824 h5=0.8763 h20=0.9404 | diff=-0.0061 [-0.0130,-0.0001] | ind 0.6088 -0.0071 [-0.0096,-0.0045] + pools +5 -21 | macro 0.8488 -0.0047 [-0.0077,-0.0018] | without top 20 -0.0068 [-0.0148,+0.0001] | weight min(n,30) -0.0066 [-0.0141,+0.0002] +w*2.0>=700 all=0.7590 dom=0.9235 non=0.5938 h5=0.8740 h20=0.9330 | diff=-0.0001 [-0.0055,+0.0045] | ind 0.6300 +0.0142 [+0.0093,+0.0191] + pools +12 -18 | macro 0.8517 -0.0018 [-0.0050,+0.0012] | without top 20 -0.0001 [-0.0061,+0.0053] | weight min(n,30) +0.0000 [-0.0059,+0.0055] +w*0.0>=850 all=0.7444 dom=0.9107 non=0.5774 h5=0.8716 h20=0.9365 | diff=-0.0147 [-0.0247,-0.0068] | ind 0.6071 -0.0087 [-0.0123,-0.0057] + pools +2 -21 | macro 0.8479 -0.0056 [-0.0086,-0.0030] | without top 20 -0.0165 [-0.0275,-0.0073] | weight min(n,30) -0.0148 [-0.0241,-0.0069] +w*0.5>=850 all=0.7572 dom=0.9218 non=0.5920 h5=0.8717 h20=0.9394 | diff=-0.0019 [-0.0045,-0.0001] | ind 0.6111 -0.0047 [-0.0069,-0.0027] + pools +1 -5 | macro 0.8523 -0.0012 [-0.0027,+0.0003] | without top 20 -0.0021 [-0.0051,-0.0001] | weight min(n,30) -0.0021 [-0.0052,-0.0001] +w*2.0>=850 all=0.7608 dom=0.9227 non=0.5982 h5=0.8757 h20=0.9341 | diff=+0.0017 [-0.0011,+0.0053] | ind 0.6256 +0.0098 [+0.0060,+0.0139] + pools +7 -7 | macro 0.8535 +0.0000 [-0.0021,+0.0021] | without top 20 +0.0020 [-0.0013,+0.0060] | weight min(n,30) +0.0020 [-0.0013,+0.0062] diff --git a/shared/package-files/94/943a7321a35e337a537f9f7609c7c9bc5cc1988552b93b446ca01d96704752ac/validation.jsonl b/shared/package-files/94/943a7321a35e337a537f9f7609c7c9bc5cc1988552b93b446ca01d96704752ac/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..d29ff0998f0e8984a4f638057223e784ec38b10f --- /dev/null +++ b/shared/package-files/94/943a7321a35e337a537f9f7609c7c9bc5cc1988552b93b446ca01d96704752ac/validation.jsonl @@ -0,0 +1,4 @@ +{"step": 37500, "elapsed_seconds": 11359.873801814043, "validation_loss": 0.5803505964577198, "validation_loss_ema": 0.5706611545756459} +{"step": 40000, "elapsed_seconds": 13108.830896281055, "validation_loss": 0.5801039915531874, "validation_loss_ema": 0.5671867122873664} +{"step": 42500, "elapsed_seconds": 14707.310217396123, "validation_loss": 0.5794179178774357, "validation_loss_ema": 0.5685662860050797} +{"step": 45000, "elapsed_seconds": 17942.007455065148, "validation_loss": 0.5805243328213692, "validation_loss_ema": 0.5672206301242113} diff --git a/shared/package-files/94/944f267f84cdd3713fda4eb02f7f1cd7d0c0417efe67bc6fba0f35ac5825ce22/model_config.json b/shared/package-files/94/944f267f84cdd3713fda4eb02f7f1cd7d0c0417efe67bc6fba0f35ac5825ce22/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..d70fae4d064f23b2160adff34d0ca3348404cca2 --- /dev/null +++ b/shared/package-files/94/944f267f84cdd3713fda4eb02f7f1cd7d0c0417efe67bc6fba0f35ac5825ce22/model_config.json @@ -0,0 +1,223 @@ +{ + "sparse_k": 100, + "inference_batch_size": 128, + "workers": 14, + "num_bins": 150000, + "upper_limit": 1500, + "max_observed_peaks": 50, + "observed_intensity_threshold": 0.001, + "ensemble": "prediction", + "pool_aggregation": 1.0, + "autocast": false, + "model": { + "pe_embed_k": 14, + "embed_elem_group": true, + "multi_hop_max_dist": 10 + }, + "checkpoint": "model.pt", + "views": [ + { + "precursor_window": 0.5, + "pred_power": 0.75, + "match_ppm": 20, + "match_floor_mda": 4, + "match_by_instrument": { + "Orbitrap": [ + 10, + 1 + ] + } + } + ], + "inverse": { + "pooled": true, + "weight_domain": 0.75, + "weight_other": 0.05, + "weight_other_single": 0.5, + "batch": 2048 + }, + "inverse_members": [ + { + "source": "runs/I1-ff512x6/step-0050000-ema.pt", + "sha256": "c131cac451c9d360d13a7576304a4f3ce59c4e542d10ec5e8e4b943838ba385b", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I1-ff512x6", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.2, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I3-ff512x6-real08/step-0030000-ema.pt", + "sha256": "27125fd05eb958236b7f815eb97d8ae9b148aedd5c552067361a7bc116dffbae", + "step": 30000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I3-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I3-ff512x6-real08/step-0100000-ema.pt", + "sha256": "d3a914a9bf011751408a2739cb18b0312df430fd31447b9115b0010861ab08e3", + "step": 100000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I3-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + } + ], + "method": "native-glacier-all-conditions-forward-simulation+formula-transformer-inverse-fusion", + "inference_runtime": "/opt/glacier/bin/python", + "members": [ + { + "source": "runs/B-all-b32/checkpoints/step-0020000-ema.ckpt", + "sha256": "80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 5136.2172065590275, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e" + }, + { + "source": "runs/B-all-b32/checkpoints/step-0030000-ema.ckpt", + "sha256": "0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8314.79353913304, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e" + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0020000-ema.ckpt", + "sha256": "ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 6945.18486677701, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e" + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0030000-ema.ckpt", + "sha256": "f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 9298.063542745003, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e" + } + ] +} diff --git a/shared/package-files/94/948a6b29488074fa52509ac5f3d6f9b5404c3dd6b399ec5ccd0a32aaf5bb0a52/README.md b/shared/package-files/94/948a6b29488074fa52509ac5f3d6f9b5404c3dd6b399ec5ccd0a32aaf5bb0a52/README.md new file mode 100644 index 0000000000000000000000000000000000000000..97ffdb24364131bd79a4b1f9658247489de6c822 --- /dev/null +++ b/shared/package-files/94/948a6b29488074fa52509ac5f3d6f9b5404c3dd6b399ec5ccd0a32aaf5bb0a52/README.md @@ -0,0 +1,253 @@ +# MassSpecGym v1.5 retrieval package: four scratch-trained GLACIER simulators (tolerance-matched distance) + formula-transformer inverse branch + pool aggregation + +Interim release (the research loop continues; see `EXPERIMENTS.md` at the package root). + +## What it does + +`bash infer.sh INPUT_ROOT OUTPUT_ROOT` reads `queries.jsonl` and `candidate_pools.jsonl` and +writes `OUTPUT_ROOT/rankings.jsonl` with one complete ranking per query. Two independent +models score every candidate and their distances are added. + +1. **Forward branch (spectrum simulation).** Every supported candidate SMILES is simulated + with a GLACIER forward model (ms-pred commit `ed8311f2`, vendored under `vendor/ms_pred`) + under the query's adduct, instrument and rounded collision energy (missing energy -> the + model's "no energy" embedding; missing instrument -> `Unknown`). Simulations are + deduplicated across queries. Each observed spectrum (top-50 peaks, square-root + intensities) is compared with each simulated candidate spectrum (top-100 predicted + fragments) by a Jensen-Shannon distance, with three global, label-free choices selected + on validation (`views` in `model_config.json`): + - **fragment-only view**: observed and predicted peaks at or above `precursor_mz - 0.5` + are left out before normalization; a spectrum with no fragment peak falls back to the + binned full-spectrum distance; + - predicted intensities are raised to the power 0.75 before normalization; + - **new in this release - tolerance-matched comparison** instead of fixed 0.01 Da bins: + every predicted peak is assigned to the nearest observed peak if it lies within + `max(ppm x m/z, floor)` of it; the divergence is taken over the observed peaks and the + predicted intensity that matches no observed peak counts as its own outcome. The + tolerance depends only on the query's `instrument_type`: max(10 ppm, 1 mDa) for + `Orbitrap`, max(20 ppm, 4 mDa) for every other or missing instrument + (`match_ppm`, `match_floor_mda`, `match_by_instrument`). + Unsupported candidates get distance 1. **New in this release:** the package holds four + simulators from two independently initialized training runs (see Model); the forward + distance is the plain mean of the four members' distances. +2. **Inverse branch (fingerprint prediction;** `inverse.py`, `invrun.py`**).** For every pool and every *distinct molecular formula among its + candidates* (computed from the candidate SMILES), each spectrum of the pool is annotated + under that formula: the 50 strongest peaks are matched to heavy-atom sub-compositions of + the candidate formula (adduct-shifted, tolerance `max(20 ppm, 0.004 Da)`, RDBE >= 0) and + the 24 strongest explained peaks are kept. A 25.0 M-parameter transformer + (`FormulaFormer`: root-formula token with adduct / instrument / collision-energy context, + peak tokens with sub-formula, neutral loss and intensity, pairwise formula-difference + attention biases) predicts a 4096-bit Morgan fingerprint (radius 2). The predicted bit + probabilities are averaged over all spectra of the pool (`"pooled": true`), and the + inverse distance of a candidate is the cosine distance between that averaged prediction + **under the candidate's own formula** and the candidate's fingerprint. The package holds + three such networks (see Model) and the inverse distance is the plain mean of their + three distances (unchanged from the previous release). The hypothesized + formula is always the formula of the candidate being scored; no label, no true formula + and no precursor-m/z error enters the branch (the precursor m/z is not an input of the + network or of the annotation). Candidates with elements outside the supported list or + with more than 4 M heavy-atom sub-compositions get inverse distance 1. +3. **Fusion.** `distance = forward + w * inverse` with a fixed rule on acquisition metadata + and pool structure (`inverse` in `model_config.json`): `w = 0.75` for `[M+H]+` spectra + with a recorded collision energy; otherwise `w = max(0.05, 0.5 / n)`, where `n` is the + number of query spectra that name the same `candidate_pool_id`. Three global constants, + selected on validation; nothing is fitted per query. +4. **Pool aggregation (multi-spectrum evidence).** Queries that name the same + `candidate_pool_id` are spectra of the same unknown, so the final distance of a candidate + is the mean of its fused distances over all scored spectra of that pool + (`pool_aggregation: 1.0`). This uses only the supplied inputs: no labels, no formulae, no + candidate positions. With weight 1 all spectra of a pool receive the same ranking. +5. Candidates are sorted by distance, ties by candidate id. + +## Model + +- **Forward members**: four GLACIER networks (15.1 M parameters each) from TWO training + runs with the same recipe and different seeds, both **randomly initialized** and trained + only on the MassSpecGym v1.5 train fold under all acquisition conditions (194,119 train + spectra), batch 32, stock cosine intensity loss; EMA weights at 20,000 and 30,000 steps of + each run. Source checkpoint sha256: + - run B, seed 1 (`research/runs/B-all-b32`): step 20,000 + `80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c`, step 30,000 + `0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798` (the pair of the + previous release); + - run B2, seed 2 (`research/runs/B2-all-b32-seed2`): step 20,000 + `ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c`, step 30,000 + `f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1`. +- **Inverse members**: three `FormulaFormer` networks (dim 512, 6 layers, 8 heads, + 24,997,832 parameters each) from TWO training runs, both **randomly initialized**, seed 1, + binary cross-entropy on Morgan bits, batch 512, EMA weights: + - run I1 (`research/runs/I1-ff512x6`), 20 % of every batch from the train fold, step 50,000 + (sha256 `c131cac451c9d360d13a7576304a4f3ce59c4e542d10ec5e8e4b943838ba385b`); + - run I3 (`research/runs/I3-ff512x6-real08`), 8 % of every batch from the train fold, steps + 30,000 (sha256 `27125fd05eb958236b7f815eb97d8ae9b148aedd5c552067361a7bc116dffbae`) and + 100,000 (sha256 `d3a914a9bf011751408a2739cb18b0312df430fd31447b9115b0010861ab08e3`). + Training data of both runs: + - the MassSpecGym v1.5 train fold (194,119 spectra annotated under their label formula, + sampled with weight `spectra_of_molecule ** -0.5`), and + - the task-supplied `synthetic_augmentation` corpus (2,333,477 ICEBERG-simulated spectra of + 435,076 structures; the rest of every batch). The task documents describe this corpus as + held-out-clean optional training data available to every method; our check found 0 + structures (2D InChIKey block) shared with validation labels. + **Provenance note:** `model_manifest.json` keeps the contract's literal + `training_provenance.data` value ("MassSpecGym v1.5 train fold") because the contract fixes + the manifest fields; the additional supplied synthetic training corpus is declared here and + in `model_config.json` (`inverse_members[].training_data`). It is training *data* supplied + with the task, not a pretrained asset: no pretrained weights, no published GLACIER / MIST / + ICEBERG weights and no external model are used at any point. +- Validation never contributed a gradient. Validation labels selected: the checkpoint steps + and the member combinations, the matching tolerance per instrument class (two of eleven + tolerance settings tried), pooled scoring, and the three fusion constants (unchanged + since release `1yfse16j`; not re-tuned for this release). +- `model.pt` (517 MB, sha256 + `dcd6427a4b330af2accd3697855cc3ea5c8d8630f69304665f2b5c2077d303b7`) is a single PyTorch + file holding the forward member list and the inverse member list. + +## Validation (selection evidence; not comparable to the test reference) + +Full validation fold, 19,429 queries / 3,386 pools, query-set sha256 +`7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6`. Official scorer +(`/workspace/evaluation/score.py`), report `research/logs/fullfold-4M-I1+I3x2.report.json`. + +| ranking | Hit@1 | Hit@5 | Hit@20 | 95 % CI Hit@1 (molecule-group bootstrap) | +|---|---|---|---|---| +| **released** (four forward members, matched distance; inverse and fusion as before) | **0.7316** | 0.8563 | 0.9152 | 0.6760 - 0.7796 | +| previous release `meqq___h` (forward pair of run B, 0.01 Da bins) | 0.7384 | 0.8418 | 0.9104 | 0.7015 - 0.7736 | +| release `1yfse16j` (same forward pair, inverse I1 50k only) | 0.7265 | 0.8372 | 0.9033 | 0.6895 - 0.7628 | +| release `xjj2vs5c` (forward pair only) | 0.6539 | 0.8177 | 0.8925 | 0.6164 - 0.6942 | + +**Read this before the first row: the official validation Hit@1 of this release is 0.0068 +LOWER than that of the previous release** (paired pool bootstrap -0.0068 [-0.0683, ++0.0407]). It was released anyway, for the following reason, which a reader may weigh +differently. + +The official Hit@1 gives every query the same weight, all spectra of a molecule share one +candidate pool, and the pool-mean rule gives all spectra of a pool the same ranking, so one +decision counts as many times as the pool has spectra. The largest validation pool has 542 +spectra (2.8 % of all queries; no domain spectrum, all Orbitrap, 79 % `[M+Na]+`); the five +largest pools hold 5.8 %, the twenty largest 11.2 %. That 542-spectrum pool is a hit for the +previous release (labelled candidate at rank 0) and a miss for every member set that +contains a seed-2 simulator (rank 1 to 20; rank 4 in this release); it was also a miss for a +later snapshot of run B itself (E28). It alone is worth -0.0279; without it this release is ++0.0217 on the remaining 18,887 queries. Measures that are not decided by single pools +(E40 in `EXPERIMENTS.md`, `research/logs/big-pools-4member-ci.log`, +`research/logs/anchor-mix-4member.log`; paired bootstrap over pools): + +| measure | previous release | this release | paired difference [95 %] | +|---|---|---|---| +| official Hit@1 (query-weighted) | 0.7384 | 0.7316 | -0.0068 [-0.0683, +0.0407] | +| pool-macro Hit@1 (every pool counts once) | 0.8210 | 0.8290 | **+0.0080 [+0.0012, +0.0148]** | +| pools gained / lost | - | 80 / 53 | - | +| query-weighted Hit@1 without the 5 largest pools | 0.7408 | 0.7534 | +0.0126 | +| query-weighted Hit@1 without the 20 largest pools | 0.7535 | 0.7669 | +0.0134 [-0.0024, +0.0301] | +| query-weighted Hit@1 without the 50 largest pools | 0.7659 | 0.7806 | +0.0147 | +| Hit@1 with pool weight min(n, 30) | - | - | +0.0134 [-0.0013, +0.0295] | +| fused Hit@1 per spectrum (no pool mean) | 0.5743 | 0.5882 | **+0.0139 [+0.0071, +0.0205]** | +| Hit@5 (official) | 0.8418 | 0.8563 | +0.0146 [-0.0046, +0.0369] | +| Hit@20 (official) | 0.9104 | 0.9152 | +0.0048 | + +Pools gained / lost by pool size: 1 spectrum 15 / 6, 2-3 spectra 31 / 20, 4-9 14 / 16, +10-29 15 / 7, >= 30 spectra 5 / 4; all-domain pools 25 / 14, mixed 6 / 6, no domain spectrum +49 / 33. Among the twelve largest pools exactly two change sides: the 542-spectrum pool is +lost and the second largest (179 spectra) is gained. Strata of the official report (this / +previous release): `[M+H]+` 0.806 / 0.808, `[M+Na]+` 0.499 / 0.522 (the 542-spectrum pool +holds about 430 `[M+Na]+` spectra); recorded energy 0.80-0.92 / 0.79-0.92, missing energy 0.552 / +0.572; Orbitrap 0.726 / 0.737, QTOF 0.775 / 0.758, no instrument 0.693 / 0.698; stock +GLACIER domain (`[M+H]+` with energy) 0.907 / 0.901, other 0.556 / 0.576. + +Our reading: the improvement is real per spectrum and per pool, and the official validation +number moved down by the luck of one molecule whose pool flips with the simulator seed (the +previous release's 0.7384 contains the same luck with the opposite sign). Because the test +score is also query-weighted, it carries the same kind of single-pool variance; we chose the +configuration with the better expected value. **This is a judgment under noise, not a +demonstrated gain on the official metric.** The alternative that is non-negative on every +measure including the official one - the previous forward pair with the matched distance - +scores 0.7420 (+0.0036 [-0.0110, +0.0182]), pool-macro 0.8234 (+0.0024 [-0.0024, +0.0074]), +per spectrum 0.5820, at half the inference time; its robust gains are about a third of this +release's. + +What each change contributes (same inverse branch and fusion constants): + +| forward members | distance | official Hit@1 | without the 20 largest pools | pool-macro | fused per spectrum | +|---|---|---|---|---|---| +| B 20k + 30k | 0.01 Da bins (previous release) | 0.7384 | 0.7535 | 0.8210 | 0.5743 | +| B 20k + 30k | matched | 0.7420 | 0.7575 | 0.8234 | 0.5820 | +| four members | 0.01 Da bins | 0.7123 | 0.7452 | 0.8204 | 0.5807 | +| **four members** | **matched** | **0.7316** | **0.7669** | **0.8290** | **0.5882** | +| B2 20k + 30k | matched | 0.7037 | 0.7549 | 0.8201 | 0.5823 | + +More members help only together with the matched distance. The matched distance alone +improves the forward branch of each of the four members (per spectrum +0.008 to +0.012, +pool mean +0.011 to +0.022, E39 / E40); the instrument split follows the per-class table in +E40 (the tight tolerance gains on Orbitrap and loses on QTOF). + +How these numbers were produced: the packaged `infer.py` of this exact build ran the complete +inverse branch (annotation + three networks), the matched scoring of all four members and +the fusion on the full fold, taking the forward simulations of the four members from their +saved full-fold prediction files (`--load-predictions`; 310 s; +`research/logs/fullfold-4M-I1+I3x2-saved-simulations.log`), and the official scorer produced +the released row; it equals the analysis-script value (0.7316) that the tables above are +built on. This build was replayed end to end (forward simulation included) from a +read-only copy outside the workspace with an `env -i` environment on the 180-query subset +`val-tiny` (40 complete pools): exit status 0, 0 unscored queries, top-5 identical to the +full-fold run for all 180 queries, file hashes of the copy unchanged afterwards, no process +left behind (`research/logs/replay-4M-I1+I3x2-val-tiny.log`); and on an edge-case input (24 +hand-built queries: single candidate, 256 candidates, duplicate, unparsable, charged and +unsupported candidates, missing metadata, one-peak spectra, added to 180 validation +queries): 204 / 204 complete rankings (`research/logs/replay-4M-I1+I3x2-edge.log`). **Not +run:** an end-to-end replay of this build on the full fold with the simulations recomputed. + +The fusion constants (domain weight 0.75, non-domain floor 0.05, size constant 0.5) were not +re-tuned; their sensitivity table is in the README of release `meqq___h` (E34): the domain +weight and the size constant sit on plateaus, the non-domain floor decides whole large pools. + +## Limits + +- Non-domain conditions (`[M+Na]+`, missing collision energy; half of the validation queries) + remain much weaker than the stock GLACIER domain (0.576 vs 0.901). 19 of the 26 lost points + sit there, about 11 of them in Orbitrap pools of 16-63 `[M+H]+` / `[M+Na]+` spectra without + a recorded energy and with 6-9 peaks per spectrum, where both branches fail together (E33). +- The validation estimate depends on a few very large pools (47 % of validation queries sit + in pools with >= 16 spectra and are hit or missed as a whole; one pool is 2.8 % of the + fold); the molecule-group interval is wide (0.676 - 0.780), the official validation Hit@1 + of this release is below the previous one, and the member set and the non-domain fusion + constant were chosen inside that noise (see Validation). +- The inverse networks are trained mostly on simulated spectra. Run I1 (20 % real spectra per + batch) overfits the 25k real training structures after about 50k steps; run I3 (8 %) is + flat from 30k to 100k steps. The three members are not independent (two are snapshots of + one run), so the ensemble gain is small. +- Candidates that RDKit cannot parse, contain unsupported elements or have more than 100 + heavy atoms get forward distance 1; elements outside + `C N P O S Si I H Cl F Br B Se Fe Co As Na K` get inverse distance 1. +- The precursor m/z is used only by the forward scoring view to separate fragment peaks from + the precursor region (the matching tolerance applies to fragment peaks only). An explicit precursor-mass-error term was evaluated (E21) and + deliberately **not** enabled, and the inverse branch does not read the precursor m/z. +- The same fixed weights handle every query; acquisition metadata (adduct, presence of a + collision energy) and the number of spectra per pool select the fusion weight; candidate + order, labels and popularity are never read. + +## Runtime + +`/opt/glacier/bin/python` (override with `MASSSPECGYM_GLACIER_PYTHON`), one GPU, <= 14 CPU +workers, no network, no writes inside the package. Forward branch: every candidate is +featurized once and simulated by all four members; the simulation is GPU-bound and linear +in the number of members. Measured per member on the full validation fold with a free H100 +and 12 workers: 2.54 M simulations in 1,363 s (`research/logs/eval-B2-30k-full.log`; the +other three members 1,340-1,530 s, the slower ones on a shared GPU). Everything else on the full fold with the four members' +simulations loaded from disk (canonicalization, planning, inverse annotation and networks, +matched scoring, ranking) on 7 workers while the GPU was shared with a training job: 310 s, +of which scoring 38 s. End to end on `val-tiny` (180 queries, 29,258 simulations x 4 +members) with 7 workers and the GPU shared with a training job: 117 s. **Expected total for +a fold of the size of validation or test on a free H100: about 5,800-6,300 s (four +simulators), inside the 18,000 s limit; not measured end to end on a full fold.** +Host memory, measured on the full validation fold (four members' simulations and the +inverse store in memory): 9.3 GiB peak resident in the largest process; the annotation +workers are forks of about 1.7 GiB each (mostly shared pages). + +## Files + +`infer.sh`, `infer.py`, `fastfeat.py` (compact featurization, tensor-equal to the stock one), +`inverse.py` (formula annotation, `FormulaFormer`), `invrun.py` (inference-side store and +pooled scoring), `model.pt`, `model_config.json`, `model_manifest.json`, `vendor/ms_pred` +(+ `LICENSE.ms-pred`), `training/` (training, preparation, publication and analysis source +used for this release; `training/inv/` holds the inverse-branch preparation and training +code). Experiment records: `EXPERIMENTS.md` and `research/` at the package root. diff --git a/shared/package-files/94/94919fa9e95969c19782016bd77f18f81cba8d21676bb9a5d95a4884f4fec5a0/swap-N5-recur-hyb-s10-f5-p48-w0.75_0.15_0.5.log b/shared/package-files/94/94919fa9e95969c19782016bd77f18f81cba8d21676bb9a5d95a4884f4fec5a0/swap-N5-recur-hyb-s10-f5-p48-w0.75_0.15_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..7732a11a06d21751f608815ac73f1c1963281804 --- /dev/null +++ b/shared/package-files/94/94919fa9e95969c19782016bd77f18f81cba8d21676bb9a5d95a4884f4fec5a0/swap-N5-recur-hyb-s10-f5-p48-w0.75_0.15_0.5.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7735 pool-macro 0.8686 Hit@5 0.8783 Hit@20 0.9348 | twin pools 354 (macro 0.7514), others macro 0.8823 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4580 (domain 0.4190 / other 0.4972) macro 0.3825 + lam 1.00/1.00: Hit@1 0.8110 (+0.0375 [+0.0192, +0.0603]) macro +0.0157 [+0.0095, +0.0219] pools +89 -36 | no top 20 +0.0294 cap30 +0.0304 [+0.0169, +0.0443] | Hit@5 -0.0029 macro@5 +0.0059 cap30@5 +0.0149 +without consensus term: Hit@1 0.7735 (ref 0.7685; +0.0050 [-0.0028, +0.0136]) macro 0.8686 (+0.0035 [+0.0000, +0.0074]) pools +25 -13 cap30 +0.0059 | Hit@5 0.8783 (-0.0009) Hit@20 0.9348 (-0.0010) + domain 0.9326 (+0.0025) other 0.6137 (+0.0075) | Orbitrap no energy 0.5788 (+0.0090) | above 850 0.4514 (+0.0297) below 850 0.8468 (-0.0006) +full rule : Hit@1 0.8110 (ref 0.8063; +0.0047 [-0.0077, +0.0177]) macro 0.8842 (+0.0030 [-0.0006, +0.0065]) pools +23 -13 cap30 +0.0045 | Hit@5 0.8754 (-0.0005) Hit@20 0.9025 (-0.0144) + domain 0.9447 (+0.0038) other 0.6766 (+0.0056) | Orbitrap no energy 0.6478 (+0.0053) | above 850 0.5305 (-0.0133) below 850 0.8748 (+0.0088) diff --git a/shared/package-files/94/949b76d7966e5558f823bb204c6d2d9da386e613fcfd3b15a4e4b51d2de71220/netprop-margin.log b/shared/package-files/94/949b76d7966e5558f823bb204c6d2d9da386e613fcfd3b15a4e4b51d2de71220/netprop-margin.log new file mode 100644 index 0000000000000000000000000000000000000000..76a572c7f5658425b38ca8fe115e28875078adad --- /dev/null +++ b/shared/package-files/94/949b76d7966e5558f823bb204c6d2d9da386e613fcfd3b15a4e4b51d2de71220/netprop-margin.log @@ -0,0 +1,29 @@ +gain pools 83 queries 882 margin q10/25/50/75/90 0.0003 0.0013 0.0049 0.0129 0.0416 term range q10/50/90 0.059 0.349 0.749 +loss pools 33 queries 283 margin q10/25/50/75/90 0.0007 0.0017 0.0062 0.0128 0.0354 term range q10/50/90 0.050 0.429 0.723 +stay in pools 2876 queries 14703 margin q10/25/50/75/90 0.0391 0.1435 0.3443 0.5398 0.6682 term range q10/50/90 0.024 0.053 0.451 +stay out pools 394 queries 3561 margin q10/25/50/75/90 0.0003 0.0011 0.0065 0.0222 0.0536 term range q10/50/90 0.023 0.072 0.599 +gain best similarity q10/25/50/75/90 0.391 0.427 0.541 0.787 0.919 10th q10/50/90 0.144 0.241 0.338 +loss best similarity q10/25/50/75/90 0.368 0.448 0.613 0.793 0.916 10th q10/50/90 0.162 0.242 0.344 +stay in best similarity q10/25/50/75/90 0.291 0.342 0.411 0.504 0.697 10th q10/50/90 0.163 0.231 0.348 +stay out best similarity q10/25/50/75/90 0.282 0.344 0.417 0.530 0.773 10th q10/50/90 0.125 0.215 0.321 +best similarity [0.0, 0.3): pools 401 base macro 0.858 gain 5 loss 1 queries gained 33 lost 3 +best similarity [0.3, 0.4): pools 1098 base macro 0.885 gain 7 loss 4 queries gained 148 lost 96 +best similarity [0.4, 0.5): pools 953 base macro 0.870 gain 22 loss 7 queries gained 388 lost 62 +best similarity [0.5, 0.6): pools 379 base macro 0.850 gain 12 loss 3 queries gained 112 lost 8 +best similarity [0.6, 0.7): pools 175 base macro 0.829 gain 8 loss 4 queries gained 84 lost 60 +best similarity [0.7, 0.8): pools 117 base macro 0.752 gain 11 loss 6 queries gained 42 lost 15 +best similarity [0.8, 0.9): pools 107 base macro 0.748 gain 8 loss 4 queries gained 54 lost 29 +best similarity [0.9, 1.0): pools 131 base macro 0.817 gain 9 loss 4 queries gained 20 lost 10 +no gate Hit@1 0.8022 macro 0.8739 (+0.0148) pools +83 -33 Hit@5 0.8719 Hit@20 0.9169 macro@5 +0.0077 +exp(-margin/0.01) Hit@1 0.8006 macro 0.8698 (+0.0106) pools +57 -21 Hit@5 0.8702 Hit@20 0.9163 macro@5 +0.0050 +exp(-margin/0.02) Hit@1 0.8040 macro 0.8706 (+0.0115) pools +64 -25 Hit@5 0.8713 Hit@20 0.9167 macro@5 +0.0059 +exp(-margin/0.05) Hit@1 0.8018 macro 0.8727 (+0.0136) pools +74 -28 Hit@5 0.8717 Hit@20 0.9168 macro@5 +0.0071 +exp(-margin/0.1) Hit@1 0.8021 macro 0.8736 (+0.0145) pools +80 -31 Hit@5 0.8721 Hit@20 0.9168 macro@5 +0.0080 +exp(-margin/0.2) Hit@1 0.8021 macro 0.8736 (+0.0145) pools +81 -32 Hit@5 0.8719 Hit@20 0.9168 macro@5 +0.0077 +1/(1+margin/0.02) Hit@1 0.8033 macro 0.8718 (+0.0127) pools +69 -26 Hit@5 0.8718 Hit@20 0.9168 macro@5 +0.0071 +1/(1+margin/0.05) Hit@1 0.8019 macro 0.8730 (+0.0139) pools +78 -31 Hit@5 0.8714 Hit@20 0.9168 macro@5 +0.0068 +1/(1+margin/0.1) Hit@1 0.8020 macro 0.8733 (+0.0142) pools +80 -32 Hit@5 0.8719 Hit@20 0.9168 macro@5 +0.0077 +1/(1+margin/0.2) Hit@1 0.8021 macro 0.8736 (+0.0145) pools +81 -32 Hit@5 0.8719 Hit@20 0.9169 macro@5 +0.0077 +margin<0.02 Hit@1 0.8029 macro 0.8724 (+0.0133) pools +71 -26 Hit@5 0.8715 Hit@20 0.9164 macro@5 +0.0053 +margin<0.05 Hit@1 0.8008 macro 0.8721 (+0.0130) pools +76 -32 Hit@5 0.8719 Hit@20 0.9169 macro@5 +0.0071 +margin<0.1 Hit@1 0.8022 macro 0.8739 (+0.0148) pools +83 -33 Hit@5 0.8721 Hit@20 0.9169 macro@5 +0.0080 diff --git a/shared/package-files/94/949d88bfe92cb6ae006c04faadb2ab993588a78df1956563007f916266f44261/netprop.py b/shared/package-files/94/949d88bfe92cb6ae006c04faadb2ab993588a78df1956563007f916266f44261/netprop.py new file mode 100644 index 0000000000000000000000000000000000000000..cf26bb6471b5965f2d44c3504df6b312e7dafbc3 --- /dev/null +++ b/shared/package-files/94/949d88bfe92cb6ae006c04faadb2ab993588a78df1956563007f916266f44261/netprop.py @@ -0,0 +1,339 @@ +"""Cross-pool consensus ("network annotation propagation") inside one input fold (lab, E65) + +netprop.py search --out evals/netprop/neigh-val.npz +netprop.py evaluate --neigh evals/netprop/neigh-val.npz --pred evals/fullfold/NAME/pred [--shuffle SEED] + +Hypothesis: spectra of different pools of the same input set that resemble each other belong to +structurally related molecules, so the current best candidates of the most similar OTHER pools +are evidence for the candidates that resemble them - the library-neighbour branch (pkg/library.py) +with the fold's own spectra as the library and the package's own top candidates in place of +labels. No label is read by the term; validation labels only evaluate. + + similarity(q, B) = max over spectra t of pool B (B != pool of q) of + 0.5 * (fragment cosine(q, t) + neutral-loss cosine(q, t)) + vote_q(c) = sum_B s_B^p * sum_b P_B(b) Tanimoto(c, b) / sum_B s_B^p - prior(c) + distance_q(c) = released fused distance + lam * (-vote_q(c)), then the pool mean + +P_B: the first candidate of pool B under the released ranking ("top1"), or a softmax over B's first +m candidates. prior(c): the vote with all pools weighted equally (what a candidate gets from +"resembling the fold's current answers in general"). +""" +import argparse +import json +import pickle +import sys +import time +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import scorelab +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import infer +import library + +ROOT = Path('/workspace/research') +WIDTH = 0.01 + + +def load(subset=None): + """Validation input; ``subset`` = "FRACTION:SEED" keeps a random share of the pools (a shard of the fold).""" + root = ROOT / 'validation-input' + queries = list(infer.read_jsonl(root / 'queries.jsonl')) + pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(root / 'candidate_pools.jsonl')} + if subset: + fraction, seed = subset.split(':') + ids = sorted(pools) + keep = set(np.random.default_rng(int(seed)).permutation(ids)[:max(2, int(round(float(fraction) * len(ids))))].tolist()) + queries = [q for q in queries if q['candidate_pool_id'] in keep] + return queries, pools + + +def search(args): + queries, pools = load(args.pools) + pool_ids = list(dict.fromkeys(q['candidate_pool_id'] for q in queries)) + slot = {pid: n for n, pid in enumerate(pool_ids)} + qpool = np.array([slot[q['candidate_pool_id']] for q in queries]) + order = np.argsort(qpool, kind='stable') # library columns ordered by pool + starts = np.flatnonzero(np.diff(qpool[order], prepend=-1) != 0) + records = [(q['mzs'], q['intensities'], float(q['precursor_mz'])) for q in queries] + started = time.monotonic() + frag, loss = library.spectrum_vectors([records[i] for i in order], WIDTH, spread=False) + frag, loss = frag.T.tocsr(), loss.T.tocsr() + top = min(args.top, len(pool_ids) - 1) + mol = np.zeros((len(queries), top), np.int64) + val = np.zeros((len(queries), top), np.float32) + for low in range(0, len(queries), args.chunk): + high = min(len(queries), low + args.chunk) + qf, ql = library.spectrum_vectors(records[low:high], WIDTH, spread=True) + sim = 0.5 * (np.asarray((qf @ frag).todense(), dtype=np.float32) + np.asarray((ql @ loss).todense(), dtype=np.float32)) + per_pool = np.maximum.reduceat(sim, starts, axis=1) + per_pool[np.arange(high - low), qpool[low:high]] = -1.0 # never the query's own pool + rank = np.argsort(-per_pool, axis=1, kind='stable')[:, :top] + mol[low:high] = rank + val[low:high] = np.take_along_axis(per_pool, rank, axis=1) + np.savez(ROOT / args.out, pool=mol, sim=val, pool_ids=np.array(pool_ids), query_ids=np.array([q['query_id'] for q in queries])) + print(f'{len(queries)} queries, {len(pool_ids)} pools, {time.monotonic() - started:.0f} s; best similarity median {np.median(val[:, 0]):.3f}, ' + f'10th {np.median(val[:, 9]):.3f}; share with best >= 0.5: {np.mean(val[:, 0] >= 0.5):.3f}, >= 0.7: {np.mean(val[:, 0] >= 0.7):.3f}') + + +def released(queries, pools, pred, config): + """Per-query fused distance of the released rule from the saved branch outputs.""" + sizes = {} + for q in queries: + sizes[q['candidate_pool_id']] = sizes.get(q['candidate_pool_id'], 0) + 1 + inv, lib, ion = config['inverse'], config['library'], config['ion'] + out = [] + for q in queries: + qid = q['query_id'] + n = len(pools[q['candidate_pool_id']]) + domain = q['adduct'] == '[M+H]+' and q.get('collision_energy') is not None + size = sizes[q['candidate_pool_id']] + d = pred['distances'].get(qid) + for name, part, fill in (('inverse', inv, 1.0), ('library', lib, 0.0), ('ion', ion, None)): + extra = pred[name].get(qid) + if extra is None: + continue + weight = part['weight_domain'] if domain else max(part['weight_other'], part.get('weight_other_single', 0.0) / size) + if weight == 0: + continue + if fill is not None: + extra = np.where(np.isfinite(extra), extra, fill) + d = (d if d is not None else np.ones(n)) + weight * extra + out.append(d) + return out + + +def tanimoto(a, b): + import torch + if torch.cuda.is_available(): + a, b = torch.from_numpy(a).cuda(), torch.from_numpy(b).cuda() + inter = a @ b.T + return (inter / (a.sum(1)[:, None] + b.sum(1)[None, :] - inter).clamp_min(1.0)).double().cpu().numpy() + inter = a @ b.T + return inter / np.maximum(a.sum(1)[:, None] + b.sum(1)[None, :] - inter, 1.0) + + +def twin_flags(queries, pools, ev, members): + """Analysis only (labels): pools whose target shares its 2D InChIKey block with another pool's target.""" + cache = ROOT / 'evals/netprop/twin-flags.json' + if cache.exists(): + return json.load(open(cache)) + from collections import Counter + from rdkit import Chem, RDLogger + RDLogger.DisableLog('rdApp.*') + key = {pid: Chem.MolToInchiKey(Chem.MolFromSmiles(pools[pid][ev.target[rows[0]]]['smiles']))[:14] for pid, rows in members.items()} + count = Counter(key.values()) + flags = {pid: int(count[k] > 1) for pid, k in key.items()} + json.dump(flags, open(cache, 'w')) + return flags + + +def evaluate(args): + queries, pools = load(args.pools) + ev = scorelab.Evaluator(queries, pools) + pred = {name: pickle.load(open(ROOT / args.pred / f'{name}.pkl', 'rb')) for name in ('distances', 'inverse', 'library', 'ion')} + config = json.load(open(ROOT / args.config)) + base = released(queries, pools, pred, config) + base_rank = ev.ranks(base, 1.0) + neigh = np.load(ROOT / args.neigh, allow_pickle=True) + pool_ids = list(neigh['pool_ids']) + assert 'query_ids' not in neigh.files or list(neigh['query_ids']) == [q['query_id'] for q in queries] + npool, nsim = neigh['pool'], np.maximum(neigh['sim'].astype(np.float64), 0.0) + if args.shuffle is not None: + perm = np.random.default_rng(args.shuffle).permutation(len(queries)) + npool, nsim = npool[perm], nsim[perm] + slot = {pid: n for n, pid in enumerate(pool_ids)} + store = np.load(ROOT / 'inv/pools-validation-input.npz') + sslot = {pid: n for n, pid in enumerate(store['pool_id'])} + cstart, cfps = store['pool_cand_start'], store['cand_fps'] + + def bits(pid, rows=None): + block = cfps[cstart[sslot[pid]]:cstart[sslot[pid] + 1]] + return np.unpackbits(block if rows is None else block[rows], axis=1).astype(np.float32) + + members = {} + for i, q in enumerate(queries): + members.setdefault(q['candidate_pool_id'], []).append(i) + plist = list(members) + domain = ev.domain + n_all = len(queries) + hit0 = base_rank == 0 + sizes = np.array([len(members[pid]) for pid in plist], dtype=float) + first_q = np.array([members[pid][0] for pid in plist]) + twin = np.array([twin_flags(queries, pools, ev, members)[pid] for pid in plist], dtype=bool) + big = np.zeros(len(plist), dtype=bool) + big[np.argsort(-sizes)[:max(1, round(20 * len(plist) / 3386))]] = True + capped = np.minimum(sizes, 30.0) + print(f'released rule from saved branches: Hit@1 {hit0.mean():.4f} pool-macro {hit0[first_q].mean():.4f} Hit@5 {np.mean(base_rank < 5):.4f} Hit@20 {np.mean(base_rank < 20):.4f}' + f' | twin pools {int(twin.sum())} (macro {hit0[first_q][twin].mean():.4f}), others macro {hit0[first_q][~twin].mean():.4f}') + m, tau = args.m, args.tau + kmax = max(int(spec.split(':')[0]) for spec in args.variants.split(',')) + if not args.no_ties: # package rule: pools tied with the k-th one vote as well + kmax = npool.shape[1] + + def kernel(t): + if args.kernel == 'plain': + return t + cap = float(args.kernel.split('=')[1]) + return np.minimum(t, cap) / cap + + def vote_table(current): + """Per pool: {neighbour pool: row}, [neighbour pools, candidates] votes of their pseudo answers minus the prior. + + Pseudo answers of a pool: the first m candidates of the pool-mean ranking of ``current``.""" + rng = np.random.default_rng(0) + answer_bits, answer_w = {}, {} + for pid, rows in members.items(): + vals = [current[i] for i in rows if current[i] is not None] + if not vals: + continue + mean = np.mean(vals, axis=0) + order = np.lexsort((ev.ids[pid], mean))[:m] + if args.control == 'random-candidate': + order = rng.permutation(len(mean))[:m] + w = np.exp(-(mean[order] - mean[order[0]]) / tau) if m > 1 else np.ones(1) + answer_bits[slot[pid]] = bits(pid, order) + answer_w[slot[pid]] = w / w.sum() + have = sorted(answer_bits) + all_bits = np.concatenate([answer_bits[n] for n in have]) + all_w = np.concatenate([answer_w[n] for n in have]) + first = np.cumsum([0] + [len(answer_w[n]) for n in have]) + position = {n: j for j, n in enumerate(have)} + votes = {} + for pid, rows in members.items(): + cand = bits(pid) + used = np.array([n for n in np.unique(npool[rows][:, :kmax]) if n in position]) + if not len(used): + continue + cols = np.concatenate([np.arange(first[position[n]], first[position[n] + 1]) for n in used]) + owner = np.concatenate([np.full(first[position[n] + 1] - first[position[n]], j) for j, n in enumerate(used)]) + t = kernel(tanimoto(cand, all_bits[cols])) * all_w[cols][None, :] + per_pool = np.zeros((len(used), len(cand))) + np.add.at(per_pool, owner, t.T) + prior = (kernel(tanimoto(cand, all_bits)) * all_w[None, :]).sum(1) / len(have) if args.debias == 'fold' else np.zeros(len(cand)) + votes[pid] = ({n: j for j, n in enumerate(used)}, per_pool - prior[None, :]) + confidence.clear() + confidence.update({n: float(answer_w[n].max()) for n in have}) + return votes + + confidence = {} + + def term_of(votes, k, power, norm): + term = [None] * n_all + for pid, rows in members.items(): + if pid not in votes: + continue + lookup, per_pool = votes[pid] + for i in rows: + last = min(k, npool.shape[1]) + if args.no_ties: + w = np.array([nsim[i, j] ** power if npool[i, j] in lookup else 0.0 for j in range(last)]) + else: + w = np.array([nsim[i, j] ** power if (npool[i, j] in lookup and nsim[i, j] >= nsim[i, last - 1]) else 0.0 for j in range(npool.shape[1])]) + if args.conf == 'top': # neighbours weighted by the peak of their own answer distribution + w = w * np.array([confidence.get(npool[i, j], 0.0) for j in range(len(w))]) + if w.sum() <= 0: + continue + idx = np.array([lookup.get(npool[i, j], 0) for j in range(len(w))]) + scale = w / (w.sum() if norm == 'norm' else 1.0 if norm == 'raw' else w.sum() + float(norm.split('=')[1]) ** power) + term[i] = -(per_pool[idx] * scale[:, None]).sum(0) + return term + + def fuse(term, lam_d, lam_o): + return [base[i] if (base[i] is None or term[i] is None or (lam_d if domain[i] else lam_o) == 0) else base[i] + (lam_d if domain[i] else lam_o) * term[i] + for i in range(n_all)] + + votes = vote_table(base) + lams = [tuple(float(x) for x in item.split('/')) for item in args.lams.split(',')] + boot = ev.boot + mz = np.array([float(q['precursor_mz']) for q in queries]) + saved = {} + for spec in args.variants.split(','): + k, power, norm = spec.split(':') + k, power = int(k), float(power) + term = term_of(votes, k, power, norm) + saved[spec] = term + alone = ev.ranks(term, 1.0) + print(f'\nk={k} p={power} {norm} | m={m} tau={tau} kernel={args.kernel} debias={args.debias} control={args.control} shuffle={args.shuffle}: ' + f'alone Hit@1 {np.mean(alone == 0):.4f} (domain {np.mean(alone[domain] == 0):.4f} / other {np.mean(alone[~domain] == 0):.4f}) macro {np.mean(alone[first_q] == 0):.4f}') + for lam_d, lam_o in lams: + fused = fuse(term, lam_d, lam_o) + for _ in range(args.rounds - 1): # further rounds: pseudo answers from the current fused ranking + fused = fuse(term_of(vote_table(fused), k, power, norm), lam_d, lam_o) + rank = ev.ranks(fused, 1.0) + hit = rank == 0 + d = (hit[first_q].astype(float) - hit0[first_q].astype(float)) + per_query = np.sum(d[boot] * sizes[boot], axis=1) / np.sum(sizes[boot], axis=1) + macro = d[boot].mean(axis=1) + trim = np.sum(d * sizes * ~big) / np.sum(sizes * ~big) + cap = np.sum(d * capped) / capped.sum() + cap_boot = np.sum(d[boot] * capped[boot], axis=1) / np.sum(capped[boot], axis=1) + d5 = (rank[first_q] < 5).astype(float) - (base_rank[first_q] < 5).astype(float) + print(f' lam {lam_d:.2f}/{lam_o:.2f}: Hit@1 {hit.mean():.4f} ({hit.mean() - hit0.mean():+.4f} [{np.percentile(per_query, 2.5):+.4f}, {np.percentile(per_query, 97.5):+.4f}])' + f' macro {d.mean():+.4f} [{np.percentile(macro, 2.5):+.4f}, {np.percentile(macro, 97.5):+.4f}] pools +{int((d > 0).sum())} -{int((d < 0).sum())}' + f' | no top 20 {trim:+.4f} cap30 {cap:+.4f} [{np.percentile(cap_boot, 2.5):+.4f}, {np.percentile(cap_boot, 97.5):+.4f}]' + f' | Hit@5 {np.mean(rank < 5) - np.mean(base_rank < 5):+.4f} macro@5 {d5.mean():+.4f} cap30@5 {np.sum(d5 * capped) / capped.sum():+.4f}' + + ('' if args.brief else f' | twin +{int((d[twin] > 0).sum())} -{int((d[twin] < 0).sum())} other +{int((d[~twin] > 0).sum())} -{int((d[~twin] < 0).sum())}' + f' | dom {hit[domain].mean() - hit0[domain].mean():+.4f} oth {hit[~domain].mean() - hit0[~domain].mean():+.4f}')) + if args.detail: + top = np.argsort(-sizes)[:args.detail] + print(' largest pools (size: rank before -> after): ' + ' '.join(f'{int(sizes[j])}: {base_rank[first_q[j]] + 1}->{rank[first_q[j]] + 1}' for j in top)) + moved = np.where(d != 0)[0] + lost = [j for j in moved if d[j] < 0] + print(' lost pools: size median %.0f, sum %d; gained pools: size median %.0f, sum %d' % ( + np.median(sizes[lost]), sizes[lost].sum(), np.median(sizes[[j for j in moved if d[j] > 0]]), sizes[[j for j in moved if d[j] > 0]].sum())) + if args.flips: # per-pool record of the last variant and weight (analysis of gains and losses) + records = [] + for j, pid in enumerate(plist): + rows = members[pid] + vals = [base[i] for i in rows if base[i] is not None] + mean = np.sort(np.mean(vals, axis=0)) if vals else np.zeros(2) + new = np.mean([fused[i] for i in rows if fused[i] is not None], axis=0) if vals else np.zeros(2) + best = np.lexsort((ev.ids[pid], new))[0] if vals else 0 + tvals = [term[i] for i in rows if term[i] is not None] + records.append({'pool': pid, 'size': len(rows), 'twin': bool(twin[j]), 'base_rank': int(base_rank[rows[0]]), 'rank': int(rank[rows[0]]), + 'best_sim': float(np.max(nsim[rows, 0])), 'mean_sim': float(np.mean(nsim[rows, 0])), + 'margin': float(mean[1] - mean[0]) if len(mean) > 1 else 0.0, 'spread': float(np.std(mean)) if len(mean) > 1 else 0.0, + 'term_spread': float(np.std(np.mean(tvals, axis=0))) if tvals else 0.0, + 'domain': float(domain[rows].mean()), 'mz': float(np.median(mz[rows])), 'cands': len(mean)}) + json.dump(records, open(ROOT / args.flips, 'w')) + if args.save: + pickle.dump({'term': saved, 'base_rank': base_rank}, open(ROOT / args.save, 'wb')) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + sub = p.add_subparsers(dest='cmd', required=True) + a = sub.add_parser('search') + a.add_argument('--out', required=True) + a.add_argument('--top', type=int, default=32) + a.add_argument('--chunk', type=int, default=400) + a.add_argument('--pools', help='FRACTION:SEED - random share of the pools') + b = sub.add_parser('evaluate') + b.add_argument('--neigh', required=True) + b.add_argument('--pred', required=True) + b.add_argument('--config', default='builds/5Ms-I9b+I13-L-ion/model_config.json') + b.add_argument('--variants', default='10:6:norm', help='k:power:norm|raw|half=c, comma separated') + b.add_argument('--lams', default='0/0.25,0/0.5,0.5/0.5,0/1') + b.add_argument('--m', type=int, default=1) + b.add_argument('--tau', type=float, default=1.0) + b.add_argument('--kernel', default='plain', help='plain | cap=THETA: min(T, THETA) / THETA') + b.add_argument('--debias', default='fold') + b.add_argument('--control', default='none', help='none | random-candidate') + b.add_argument('--detail', type=int, default=0) + b.add_argument('--rounds', type=int, default=1) + b.add_argument('--no-ties', action='store_true', help='exactly k neighbours (lab runs before the package rule)') + b.add_argument('--conf', default='none', help='none | top') + b.add_argument('--brief', action='store_true') + b.add_argument('--pools', help='FRACTION:SEED - random share of the pools (use the matching neighbour file)') + b.add_argument('--flips') + b.add_argument('--shuffle', type=int) + b.add_argument('--save') + args = p.parse_args() + {'search': search, 'evaluate': evaluate}[args.cmd](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/94/94cf72983327952df4c3dbda124c63d162a73fedc25f0730ac80cf4619d17578/fused-idf.log b/shared/package-files/94/94cf72983327952df4c3dbda124c63d162a73fedc25f0730ac80cf4619d17578/fused-idf.log new file mode 100644 index 0000000000000000000000000000000000000000..3350f30357ba94d9f1a1b1d3ba6b11173a05238d --- /dev/null +++ b/shared/package-files/94/94cf72983327952df4c3dbda124c63d162a73fedc25f0730ac80cf4619d17578/fused-idf.log @@ -0,0 +1,24 @@ +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 | diff=+0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] + pools +0 -0 | macro 0.8379 +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +r3 all=0.7525 dom=0.9136 non=0.5907 h5=0.8728 h20=0.9292 | diff=+0.0044 [-0.0020,+0.0114] | ind 0.6053 +0.0041 [+0.0025,+0.0058] + pools +23 -11 | macro 0.8414 +0.0035 [+0.0003,+0.0071] | without top 20 +0.0049 [-0.0018,+0.0127] | weight min(n,30) +0.0046 [-0.0020,+0.0121] +r3-idf all=0.7494 dom=0.9113 non=0.5868 h5=0.8719 h20=0.9302 | diff=+0.0013 [-0.0069,+0.0094] | ind 0.6154 +0.0142 [+0.0107,+0.0177] + pools +33 -27 | macro 0.8396 +0.0018 [-0.0027,+0.0062] | without top 20 +0.0014 [-0.0072,+0.0107] | weight min(n,30) +0.0018 [-0.0063,+0.0103] +r3-p5idf all=0.7508 dom=0.9123 non=0.5888 h5=0.8761 h20=0.9341 | diff=+0.0027 [-0.0070,+0.0115] | ind 0.6141 +0.0129 [+0.0096,+0.0162] + pools +41 -31 | macro 0.8408 +0.0030 [-0.0021,+0.0077] | without top 20 +0.0031 [-0.0075,+0.0131] | weight min(n,30) +0.0035 [-0.0060,+0.0130] +I8 all=0.7582 dom=0.9207 non=0.5952 h5=0.8789 h20=0.9382 | diff=+0.0101 [+0.0033,+0.0181] | ind 0.6122 +0.0110 [+0.0070,+0.0157] + pools +68 -36 | macro 0.8473 +0.0095 [+0.0035,+0.0154] | without top 20 +0.0114 [+0.0038,+0.0205] | weight min(n,30) +0.0112 [+0.0036,+0.0198] +I8-idf all=0.7532 dom=0.9207 non=0.5849 h5=0.8781 h20=0.9350 | diff=+0.0050 [-0.0038,+0.0136] | ind 0.6219 +0.0206 [+0.0154,+0.0265] + pools +75 -43 | macro 0.8473 +0.0095 [+0.0030,+0.0159] | without top 20 +0.0057 [-0.0041,+0.0154] | weight min(n,30) +0.0062 [-0.0026,+0.0153] +I8-p5idf all=0.7547 dom=0.9219 non=0.5869 h5=0.8787 h20=0.9368 | diff=+0.0066 [-0.0011,+0.0149] | ind 0.6187 +0.0175 [+0.0127,+0.0232] + pools +78 -39 | macro 0.8494 +0.0115 [+0.0056,+0.0177] | without top 20 +0.0075 [-0.0012,+0.0168] | weight min(n,30) +0.0073 [-0.0013,+0.0164] +I9a all=0.7582 dom=0.9240 non=0.5919 h5=0.8765 h20=0.9315 | diff=+0.0101 [+0.0010,+0.0196] | ind 0.6134 +0.0121 [+0.0086,+0.0159] + pools +77 -34 | macro 0.8506 +0.0127 [+0.0068,+0.0189] | without top 20 +0.0114 [+0.0011,+0.0218] | weight min(n,30) +0.0119 [+0.0028,+0.0214] +I9a-idf all=0.7589 dom=0.9250 non=0.5921 h5=0.8786 h20=0.9304 | diff=+0.0108 [+0.0016,+0.0205] | ind 0.6241 +0.0229 [+0.0183,+0.0275] + pools +86 -37 | macro 0.8523 +0.0145 [+0.0080,+0.0207] | without top 20 +0.0121 [+0.0020,+0.0228] | weight min(n,30) +0.0127 [+0.0033,+0.0226] +I9a-p5idf all=0.7559 dom=0.9228 non=0.5883 h5=0.8808 h20=0.9341 | diff=+0.0078 [-0.0021,+0.0178] | ind 0.6209 +0.0197 [+0.0152,+0.0246] + pools +87 -39 | macro 0.8520 +0.0142 [+0.0080,+0.0210] | without top 20 +0.0088 [-0.0016,+0.0196] | weight min(n,30) +0.0094 [-0.0004,+0.0195] +I9b-p5idf all=0.7643 dom=0.9294 non=0.5986 h5=0.8800 h20=0.9373 | diff=+0.0162 [+0.0067,+0.0253] | ind 0.6238 +0.0226 [+0.0180,+0.0276] + pools +91 -24 | macro 0.8576 +0.0198 [+0.0136,+0.0257] | without top 20 +0.0183 [+0.0078,+0.0285] | weight min(n,30) +0.0190 [+0.0096,+0.0289] +I9ab-idf all=0.7633 dom=0.9303 non=0.5956 h5=0.8786 h20=0.9362 | diff=+0.0152 [+0.0064,+0.0236] | ind 0.6268 +0.0256 [+0.0211,+0.0304] + pools +94 -25 | macro 0.8582 +0.0204 [+0.0142,+0.0266] | without top 20 +0.0171 [+0.0072,+0.0270] | weight min(n,30) +0.0178 [+0.0087,+0.0271] diff --git a/shared/package-files/96/961f527c23b54320d08716db25eba9d2e134b7a8daddcb836c4f858e2bb6870c/after-s2.log b/shared/package-files/96/961f527c23b54320d08716db25eba9d2e134b7a8daddcb836c4f858e2bb6870c/after-s2.log new file mode 100644 index 0000000000000000000000000000000000000000..452d266f51a5102209fc21aa2590ef1bae145bde --- /dev/null +++ b/shared/package-files/96/961f527c23b54320d08716db25eba9d2e134b7a8daddcb836c4f858e2bb6870c/after-s2.log @@ -0,0 +1,9 @@ +S2 finished at Tue Nov 10 22:13:52 UTC 2026 +simulated S2 25k+30k and the run-B weight average at Tue Nov 10 23:18:44 UTC 2026 +evals/S2-25k-full/pred: members 1, tasks 2540748, done 2540748 +scored S2-25k-full at Tue Nov 10 23:22:58 UTC 2026 +evals/S2-30k-full/pred: members 1, tasks 2540748, done 2540748 +scored S2-30k-full at Tue Nov 10 23:27:10 UTC 2026 +evals/soupB3-full/pred: members 1, tasks 2540748, done 2540748 +scored soupB3-full at Tue Nov 10 23:31:13 UTC 2026 +finished at Tue Nov 10 23:31:13 UTC 2026 diff --git a/shared/package-files/96/9654d632c04f351ee8c3e3360754349580c5f1c55ba1df7ff541c4dd4560b6de/evalchain-30k.log b/shared/package-files/96/9654d632c04f351ee8c3e3360754349580c5f1c55ba1df7ff541c4dd4560b6de/evalchain-30k.log new file mode 100644 index 0000000000000000000000000000000000000000..93aaf9a2401a9118027ba395766f4bb9ad92315e --- /dev/null +++ b/shared/package-files/96/9654d632c04f351ee8c3e3360754349580c5f1c55ba1df7ff541c4dd4560b6de/evalchain-30k.log @@ -0,0 +1 @@ +chain-done diff --git a/shared/package-files/96/9654d632c04f351ee8c3e3360754349580c5f1c55ba1df7ff541c4dd4560b6de/evalchain-C1-37k.log b/shared/package-files/96/9654d632c04f351ee8c3e3360754349580c5f1c55ba1df7ff541c4dd4560b6de/evalchain-C1-37k.log new file mode 100644 index 0000000000000000000000000000000000000000..93aaf9a2401a9118027ba395766f4bb9ad92315e --- /dev/null +++ b/shared/package-files/96/9654d632c04f351ee8c3e3360754349580c5f1c55ba1df7ff541c4dd4560b6de/evalchain-C1-37k.log @@ -0,0 +1 @@ +chain-done diff --git a/shared/package-files/96/966db191032ddb22cfb0dc036637ffcfcedc4b66651b33cc7aa763c74f82036f/knn-evaluate-shuffled-debias.log b/shared/package-files/96/966db191032ddb22cfb0dc036637ffcfcedc4b66651b33cc7aa763c74f82036f/knn-evaluate-shuffled-debias.log new file mode 100644 index 0000000000000000000000000000000000000000..f22a07d5a14d5f5f8171d46bc075db99576307d6 --- /dev/null +++ b/shared/package-files/96/966db191032ddb22cfb0dc036637ffcfcedc4b66651b33cc7aa763c74f82036f/knn-evaluate-shuffled-debias.log @@ -0,0 +1,20 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.095, to the average candidate 0.092 + domain: label 0.094, candidate 0.095, best similarity median 0.445 + other: label 0.096, candidate 0.089, best similarity median 0.441 +--- neighbour branch alone (per spectrum / pool mean) +frag k=20 p=6 norm ind all=0.0113 dom=0.0040 non=0.0187 | pool all=0.0127 dom=0.0030 non=0.0224 +frag k=20 p=6 debias ind all=0.0113 dom=0.0057 non=0.0170 | pool all=0.0381 dom=0.0097 non=0.0667 +loss k=20 p=6 norm ind all=0.0091 dom=0.0053 non=0.0129 | pool all=0.0091 dom=0.0048 non=0.0133 +loss k=20 p=6 debias ind all=0.0094 dom=0.0049 non=0.0139 | pool all=0.0240 dom=0.0048 non=0.0433 +sum k=20 p=6 norm ind all=0.0108 dom=0.0051 non=0.0165 | pool all=0.0057 dom=0.0054 non=0.0059 +sum k=20 p=6 debias ind all=0.0098 dom=0.0047 non=0.0150 | pool all=0.0202 dom=0.0063 non=0.0342 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7327 dom=0.9072 non=0.5575 h5=0.8565 h20=0.9156 macro=0.8317 | +0.0000 [+0.0000,+0.0000] | ind 0.5908 +0.0000 [+0.0000,+0.0000] +sum k=20 p=6 norm u=0/0.25 all=0.7364 dom=0.9072 non=0.5648 h5=0.8619 h20=0.9185 macro=0.8320 | +0.0037 [-0.0031,+0.0115] | ind 0.5903 -0.0006 [-0.0029,+0.0018] + pools +9 -8 | macro +0.0003 [-0.0021,+0.0027] | without top 20 +0.0041 [-0.0037,+0.0126] | weight min(n,30) +0.0037 [-0.0036,+0.0113] +sum k=20 p=6 norm u=0/0.5 all=0.7211 dom=0.9064 non=0.5350 h5=0.8637 h20=0.9174 macro=0.8293 | -0.0116 [-0.0338,+0.0041] | ind 0.5850 -0.0058 [-0.0094,-0.0024] + pools +10 -18 | macro -0.0024 [-0.0056,+0.0006] | without top 20 -0.0027 [-0.0120,+0.0066] | weight min(n,30) -0.0050 [-0.0145,+0.0038] +sum k=20 p=6 debias u=0/0.25 all=0.7344 dom=0.9072 non=0.5609 h5=0.8613 h20=0.9199 macro=0.8323 | +0.0017 [-0.0001,+0.0044] | ind 0.5895 -0.0013 [-0.0034,+0.0009] + pools +3 -1 | macro +0.0006 [-0.0006,+0.0018] | without top 20 +0.0019 [-0.0001,+0.0050] | weight min(n,30) +0.0020 [-0.0001,+0.0052] +sum k=20 p=6 debias u=0/0.5 all=0.7354 dom=0.9072 non=0.5630 h5=0.8631 h20=0.9226 macro=0.8317 | +0.0027 [-0.0071,+0.0130] | ind 0.5857 -0.0051 [-0.0085,-0.0020] + pools +7 -7 | macro +0.0000 [-0.0021,+0.0021] | without top 20 -0.0009 [-0.0099,+0.0076] | weight min(n,30) +0.0005 [-0.0082,+0.0091] diff --git a/shared/package-files/96/9683bd1a1fb73e250be9c0bddfe8ba925f51488d90aaab250f8dee48e53ec8d1/inverse.py b/shared/package-files/96/9683bd1a1fb73e250be9c0bddfe8ba925f51488d90aaab250f8dee48e53ec8d1/inverse.py new file mode 100644 index 0000000000000000000000000000000000000000..4d96189d0c2180b30e42ec2856dd848fb252822e --- /dev/null +++ b/shared/package-files/96/9683bd1a1fb73e250be9c0bddfe8ba925f51488d90aaab250f8dee48e53ec8d1/inverse.py @@ -0,0 +1,379 @@ +"""Inverse branch: spectrum + hypothesized precursor formula -> molecular fingerprint. + +A formula transformer in the spirit of MIST (Goldman et al. 2023), written for this task: + +* every observed peak is annotated with the sub-formula of a *hypothesized* precursor formula + that explains its m/z best (``assign``; mass only, RDBE >= 0 as in MIST's enumeration); +* tokens = [root formula + acquisition context] + annotated peaks (sub-formula, neutral loss, + intensity); a transformer with pairwise formula-difference attention biases; +* the root token predicts a 4096-bit Morgan fingerprint (radius 2). + +At inference the hypothesized formula is the formula **of the candidate being scored** (never +a label): a spectrum is encoded once per distinct candidate formula of its pool and a +candidate is compared with the fingerprint predicted under its own formula. No precursor-m/z +mass error is used anywhere; the supplied precursor m/z is not an input of this branch. +""" +import math +import re + +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F + +ELEMENTS = ['C', 'N', 'P', 'O', 'S', 'Si', 'I', 'H', 'Cl', 'F', 'Br', 'B', 'Se', 'Fe', 'Co', 'As', 'Na', 'K'] +MONO = np.array([12.0, 14.00307400443, 30.97376199842, 15.99491461957, 31.9720711744, 27.97692653465, + 126.9044719, 1.00782503223, 34.968852682, 18.99840316273, 78.9183376, 11.00930536, + 79.9165218, 55.93493633, 58.93319429, 74.92159457, 22.989769282, 38.9637064864]) +INDEX = {e: i for i, e in enumerate(ELEMENTS)} +H = INDEX['H'] +HEAVY = [i for i in range(len(ELEMENTS)) if i != H] +ELECTRON = 0.000548579909 +ION_SHIFT = {'[M+H]+': MONO[H] - ELECTRON, '[M+Na]+': MONO[INDEX['Na']] - ELECTRON} +ADDUCTS = ('[M+H]+', '[M+Na]+') +INSTRUMENTS = ('Orbitrap', 'QTOF') # anything else -> index 2 ("unknown") +RDBE_SIGN = np.zeros(len(ELEMENTS)) +RDBE_SIGN[[INDEX['C']]] = 2 +RDBE_SIGN[[INDEX['N'], INDEX['P']]] = 1 +RDBE_SIGN[[INDEX['Cl'], INDEX['Br'], INDEX['I'], INDEX['F']]] = -1 +FORMULA_TOKEN = re.compile(r'([A-Z][a-z]*)([0-9]*)') +FP_BITS = 4096 +MAX_PEAKS = 24 # annotated peaks stored per spectrum (strongest first) + + +def parse_formula(text): + """Element-count vector of a formula string; None if it has an element outside ELEMENTS.""" + out = np.zeros(len(ELEMENTS), dtype=np.int32) + for symbol, count in FORMULA_TOKEN.findall(text): + index = INDEX.get(symbol) + if index is None: + return None + out[index] += int(count) if count else 1 + return out + + +def mol_formula(mol): + """Element-count vector of an RDKit molecule (implicit hydrogens included) or None.""" + out = np.zeros(len(ELEMENTS), dtype=np.int32) + for atom in mol.GetAtoms(): + index = INDEX.get(atom.GetSymbol()) + if index is None: + return None + out[index] += 1 + out[H] += atom.GetTotalNumHs() + return out + + +def fingerprint(mol): + """Packed 4096-bit Morgan fingerprint (radius 2), uint8[512].""" + from rdkit.Chem import rdFingerprintGenerator + global _GENERATOR + try: + generator = _GENERATOR + except NameError: + generator = _GENERATOR = rdFingerprintGenerator.GetMorganGenerator(radius=2, fpSize=FP_BITS) + return np.packbits(generator.GetFingerprintAsNumPy(mol).astype(bool)) + + +class SubformulaTable: + """All heavy-atom sub-compositions of a formula, indexed by mass modulo the hydrogen mass.""" + + def __init__(self, root): + root = np.asarray(root, dtype=np.int64) + self.root = root + present = [i for i in HEAVY if root[i] > 0] + grids = np.meshgrid(*[np.arange(root[i] + 1) for i in present], indexing='ij') if present else [] + combos = np.zeros((int(np.prod([root[i] + 1 for i in present])) if present else 1, len(ELEMENTS)), dtype=np.int16) + for i, grid in zip(present, grids): + combos[:, i] = grid.reshape(-1) + mass = combos.astype(np.float64) @ MONO + # RDBE = 1 + (2C + N + P - H - halogens) / 2 >= 0 -> H <= 2 + 2C + N + P - halogens + hmax = np.minimum(2 + combos.astype(np.int64) @ RDBE_SIGN.astype(np.int64), root[H]) + keep = hmax >= 0 + combos, mass, hmax = combos[keep], mass[keep], hmax[keep] + residue = np.mod(mass, MONO[H]) + order = np.argsort(residue, kind='stable') + self.combos, self.mass, self.hmax = combos[order], mass[order], hmax[order] + residue = residue[order] + # periodic copies so that a window never wraps + self.residue = np.concatenate([residue - MONO[H], residue, residue + MONO[H]]) + self.count = len(residue) + + def assign(self, neutral, tolerance): + """Best sub-formula of every neutral fragment mass. + + Returns (found[P] bool, counts[P, E] int16, error[P] float): the sub-formula with the + smallest absolute mass error within ``tolerance[P]``. + """ + neutral = np.asarray(neutral, dtype=np.float64) + tolerance = np.broadcast_to(np.asarray(tolerance, dtype=np.float64), neutral.shape) + peaks = len(neutral) + found = np.zeros(peaks, dtype=bool) + counts = np.zeros((peaks, len(ELEMENTS)), dtype=np.int16) + error = np.full(peaks, np.inf) + if peaks == 0 or self.count == 0: + return found, counts, error + target = np.mod(neutral, MONO[H]) + low = np.searchsorted(self.residue, target - tolerance, side='left') + high = np.searchsorted(self.residue, target + tolerance, side='right') + size = high - low + total = int(size.sum()) + if total == 0: + return found, counts, error + peak = np.repeat(np.arange(peaks), size) + slot = (np.arange(total) - np.repeat(np.cumsum(size) - size, size) + np.repeat(low, size)) % self.count + gap = neutral[peak] - self.mass[slot] + hydrogens = np.rint(gap / MONO[H]).astype(np.int64) + err = np.abs(gap - hydrogens * MONO[H]) + ok = (hydrogens >= 0) & (hydrogens <= self.hmax[slot]) & (err <= tolerance[peak]) + if not ok.any(): + return found, counts, error + peak, slot, hydrogens, err = peak[ok], slot[ok], hydrogens[ok], err[ok] + order = np.lexsort((err, peak)) + peak, slot, hydrogens, err = peak[order], slot[order], hydrogens[order], err[order] + first = np.concatenate([[True], peak[1:] != peak[:-1]]) + peak, slot, hydrogens, err = peak[first], slot[first], hydrogens[first], err[first] + found[peak] = True + counts[peak] = self.combos[slot] + counts[peak, H] = hydrogens + error[peak] = err + return found, counts, error + + +def tolerance_of(mz, ppm, floor): + return np.maximum(np.asarray(mz, dtype=np.float64) * ppm * 1e-6, floor) + + +def select_peaks(mzs, intensities, max_candidates=50): + """Strongest positive peaks, square-root of max-normalized intensity (GLACIER convention).""" + mz = np.asarray(mzs, dtype=np.float64) + inten = np.asarray(intensities, dtype=np.float64) + keep = (inten > 0) & np.isfinite(inten) & np.isfinite(mz) & (mz > 0) + mz, inten = mz[keep], inten[keep] + if len(mz) == 0: + return mz, inten + inten = np.sqrt(inten / inten.max()) + order = np.argsort(-inten, kind='stable')[:max_candidates] + return mz[order], inten[order] + + +def annotate(table, mz, inten, adduct, ppm, floor, max_peaks=MAX_PEAKS): + """Annotated peaks of one spectrum under one formula: (counts[K, E] uint8, inten[K] float32). + + ``mz``/``inten`` come from ``select_peaks`` (strongest first), so the result is too. + """ + found, counts, _ = table.assign(mz - ION_SHIFT[adduct], tolerance_of(mz, ppm, floor)) + index = np.flatnonzero(found)[:max_peaks] + return np.minimum(counts[index], 255).astype(np.uint8), inten[index].astype(np.float32) + + +# -------------------------------------------------------------------------- +# model +# -------------------------------------------------------------------------- + +class CountEmbedding(nn.Module): + """Sinusoidal features of element counts (periods 2..512) plus the scaled raw count.""" + + def __init__(self, periods=(2, 4, 8, 16, 32, 64, 128, 256, 512)): + super().__init__() + self.register_buffer('omega', 2 * math.pi / torch.tensor(periods, dtype=torch.float32), persistent=False) + self.dim = len(ELEMENTS) * (2 * len(periods) + 1) + + def forward(self, counts): + x = counts.float().unsqueeze(-1) + angle = x * self.omega + return torch.cat([torch.sin(angle), torch.cos(angle), x / 32.0], dim=-1).flatten(-2) + + +class Block(nn.Module): + def __init__(self, dim, heads, dropout): + super().__init__() + self.heads = heads + self.norm1 = nn.LayerNorm(dim) + self.qkv = nn.Linear(dim, 3 * dim) + self.proj = nn.Linear(dim, dim) + self.norm2 = nn.LayerNorm(dim) + self.mlp = nn.Sequential(nn.Linear(dim, 4 * dim), nn.GELU(), nn.Dropout(dropout), nn.Linear(4 * dim, dim)) + self.drop = nn.Dropout(dropout) + + def forward(self, x, bias): + b, t, d = x.shape + q, k, v = self.qkv(self.norm1(x)).view(b, t, 3, self.heads, d // self.heads).permute(2, 0, 3, 1, 4) + out = F.scaled_dot_product_attention(q, k, v, attn_mask=bias) + x = x + self.drop(self.proj(out.transpose(1, 2).reshape(b, t, d))) + return x + self.drop(self.mlp(self.norm2(x))) + + +class FormulaFormer(nn.Module): + def __init__(self, dim=512, layers=6, heads=8, dropout=0.1, pair_dim=64, fp_bits=FP_BITS, max_energy=200.0): + super().__init__() + self.config = dict(dim=dim, layers=layers, heads=heads, dropout=dropout, pair_dim=pair_dim, fp_bits=fp_bits, + max_energy=max_energy) + self.embed = CountEmbedding() + self.peak_in = nn.Sequential(nn.Linear(2 * self.embed.dim + 2, dim), nn.GELU(), nn.Linear(dim, dim)) + self.root_in = nn.Sequential(nn.Linear(self.embed.dim, dim), nn.GELU(), nn.Linear(dim, dim)) + self.adduct = nn.Embedding(len(ADDUCTS), dim) + self.instrument = nn.Embedding(len(INSTRUMENTS) + 1, dim) + self.energy = nn.Sequential(nn.Linear(34, dim), nn.GELU(), nn.Linear(dim, dim)) + self.no_energy = nn.Parameter(torch.zeros(dim)) + self.pair = nn.Sequential(nn.Linear(self.embed.dim, pair_dim), nn.GELU(), nn.Linear(pair_dim, heads)) + self.blocks = nn.ModuleList([Block(dim, heads, dropout) for _ in range(layers)]) + self.norm = nn.LayerNorm(dim) + self.head = nn.Sequential(nn.Linear(dim, 2 * dim), nn.GELU(), nn.Linear(2 * dim, fp_bits)) + self.max_energy = max_energy + + def energy_features(self, energy): + x = (energy.clamp(0, self.max_energy) / self.max_energy).unsqueeze(-1) + k = torch.arange(1, 17, device=energy.device, dtype=torch.float32) + return torch.cat([torch.sin(math.pi * x * k), torch.cos(math.pi * x * k), x, x * x], dim=-1) + + def forward(self, root, peaks, inten, mask, adduct, instrument, energy): + """root [B,E] counts; peaks [B,K,E] counts; inten [B,K]; mask [B,K] bool (True = real peak); + adduct, instrument [B] long; energy [B] float (NaN = not recorded). Returns logits [B, bits].""" + root_f = root.float() + loss = (root_f.unsqueeze(1) - peaks.float()).clamp(min=0) + feats = torch.cat([self.embed(peaks), self.embed(loss), inten.unsqueeze(-1), + torch.log10(inten.clamp(min=1e-4)).unsqueeze(-1) / 4 + 1], dim=-1) + tokens = self.peak_in(feats) + missing = torch.isnan(energy) + context = self.energy(self.energy_features(torch.nan_to_num(energy, nan=0.0))) + context = torch.where(missing.unsqueeze(-1), self.no_energy.expand_as(context), context) + cls = self.root_in(self.embed(root)) + self.adduct(adduct) + self.instrument(instrument) + context + x = torch.cat([cls.unsqueeze(1), tokens], dim=1) + forms = torch.cat([root_f.unsqueeze(1), peaks.float()], dim=1) + diff = (forms.unsqueeze(2) - forms.unsqueeze(1)).abs() + bias = self.pair(self.embed(diff)).permute(0, 3, 1, 2) + valid = torch.cat([torch.ones_like(mask[:, :1]), mask], dim=1) + bias = bias.masked_fill(~valid[:, None, None, :], float('-inf')).to(x.dtype) + for block in self.blocks: + x = block(x, bias) + return self.head(self.norm(x[:, 0])) + + +# -------------------------------------------------------------------------- +# scoring +# -------------------------------------------------------------------------- + +def unpack_bits(packed): + """uint8 [..., bits/8] (``np.packbits`` order) -> float [..., bits] on the same device.""" + shifts = torch.arange(7, -1, -1, device=packed.device, dtype=torch.uint8) + return ((packed.unsqueeze(-1) >> shifts) & 1).flatten(-2).float() + + +def pool_distances(logits, cand_formula, cand_bits, chunk=64): + """Distances of one pool's candidates for each of its queries. + + logits [Q, F, bits]: the fingerprint predicted for query q under formula hypothesis f; + cand_formula [C] long: formula index of every candidate (-1 = unsupported); + cand_bits [C, bits] float 0/1. Candidate c is compared with the prediction made under ITS OWN + formula. Returns (cosine distance [Q, C], mean bit cross-entropy [Q, C]); unsupported + candidates get distance 1 / the pool's largest cross-entropy. + """ + supported = cand_formula >= 0 + index = cand_formula.clamp(min=0) + norm = cand_bits.norm(dim=-1).clamp(min=1e-6) + cos, nll = [], [] + for start in range(0, logits.shape[0], chunk): + part = logits[start:start + chunk].float()[:, index] # [q, C, bits] + prob = torch.sigmoid(part) + dot = (prob * cand_bits).sum(-1) + cos.append(1 - dot / (prob.norm(dim=-1).clamp(min=1e-6) * norm)) + nll.append((F.softplus(part) - part * cand_bits).mean(-1)) + cos, nll = torch.cat(cos), torch.cat(nll) + cos = torch.where(supported, cos, torch.ones_like(cos)) + if supported.any(): + nll = torch.where(supported, nll, nll[:, supported].max().expand_as(nll)) + return cos, nll + + +# -------------------------------------------------------------------------- +# set model: all spectra that share a candidate pool are merged into one annotated peak list +# -------------------------------------------------------------------------- + +SET_PEAKS = 32 # merged peaks given to the set model +_HASH = torch.tensor([0x1B873593A2C4D6E7, 0x2545F4914F6CDD1D, 0x1F83D9ABFB41BD6B, 0x5BE0CD19137E2179, + 0x3C6EF372FE94F82B, 0x510E527FADE682D1, 0x6A09E667F3BCC909, 0x0B67AE8584CAA73B, + 0x243F6A8885A308D3, 0x13198A2E03707345, 0x24093822299F31D1, 0x082EFA98EC4E6C89, + 0x452821E638D01377, 0x3E5466CF34E90C6D, 0x40AC29B7C97C50DD, 0x3F84D5B5B5470917, + 0x1216D5D98979FB1B, 0x4D2D08BA6C6E4F6B], dtype=torch.int64) + + +def merge_sets(peaks, inten, channel, valid, spectra, top=SET_PEAKS): + """Merge the annotated peaks of several spectra of one precursor (GPU, batched). + + peaks [B, T, E] long sub-formula counts; inten [B, T] float; channel [B, T] long (adduct index + of the source spectrum); valid [B, T] bool; spectra [B, 2] float = number of merged spectra + per adduct. Peaks with the same sub-formula are combined; channel c of a merged peak is its + mean intensity over the spectra of adduct c (absent = 0). The ``top`` peaks with the largest + mean intensity over all spectra are returned: (peaks [B, top, E], inten [B, top, 2], mask). + """ + b, t, e = peaks.shape + device = peaks.device + code = (peaks * _HASH.to(device)).sum(-1) + code = torch.where(valid, code, torch.full_like(code, torch.iinfo(torch.int64).max)) + code, order = torch.sort(code, dim=1) + peaks = peaks.gather(1, order.unsqueeze(-1).expand(-1, -1, e)) + inten = inten.gather(1, order) + channel = channel.gather(1, order) + valid = valid.gather(1, order) + first = torch.ones_like(valid) + first[:, 1:] = code[:, 1:] != code[:, :-1] + segment = first.long().cumsum(1) - 1 + value = F.one_hot(channel, 2).to(inten.dtype) * (inten * valid).unsqueeze(-1) + sums = torch.zeros(b, t, 2, device=device, dtype=inten.dtype).scatter_add_(1, segment.unsqueeze(-1).expand(-1, -1, 2), value) + live = torch.zeros(b, t, device=device, dtype=torch.bool).scatter_(1, segment, valid) # sorted: the padding is one last segment + live &= torch.zeros(b, t, device=device, dtype=torch.bool).scatter_(1, segment, torch.ones_like(valid)) + merged = torch.zeros_like(peaks).scatter_(1, segment.unsqueeze(-1).expand(-1, -1, e), peaks) + overall = sums.sum(-1) / spectra.sum(-1, keepdim=True).clamp(min=1) + overall = torch.where(live, overall, torch.full_like(overall, -1.0)) + top = min(top, t) + _, pick = torch.topk(overall, top, dim=1) + mask = live.gather(1, pick) + out = (sums / spectra.clamp(min=1).unsqueeze(1)).gather(1, pick.unsqueeze(-1).expand(-1, -1, 2)) * mask.unsqueeze(-1) + return merged.gather(1, pick.unsqueeze(-1).expand(-1, -1, e)) * mask.unsqueeze(-1), out, mask + + +class SetFormer(nn.Module): + """Formula transformer over a merged peak list with one intensity channel per adduct.""" + + def __init__(self, dim=512, layers=6, heads=8, dropout=0.1, pair_dim=64, fp_bits=FP_BITS, max_energy=200.0): + super().__init__() + self.config = dict(dim=dim, layers=layers, heads=heads, dropout=dropout, pair_dim=pair_dim, fp_bits=fp_bits, + max_energy=max_energy) + self.embed = CountEmbedding() + self.peak_in = nn.Sequential(nn.Linear(2 * self.embed.dim + 4, dim), nn.GELU(), nn.Linear(dim, dim)) + self.root_in = nn.Sequential(nn.Linear(self.embed.dim, dim), nn.GELU(), nn.Linear(dim, dim)) + self.context = nn.Sequential(nn.Linear(6, dim), nn.GELU(), nn.Linear(dim, dim)) + self.instrument = nn.Embedding(len(INSTRUMENTS) + 1, dim) + self.energy = nn.Sequential(nn.Linear(34, dim), nn.GELU(), nn.Linear(dim, dim)) + self.no_energy = nn.Parameter(torch.zeros(dim)) + self.pair = nn.Sequential(nn.Linear(self.embed.dim, pair_dim), nn.GELU(), nn.Linear(pair_dim, heads)) + self.blocks = nn.ModuleList([Block(dim, heads, dropout) for _ in range(layers)]) + self.norm = nn.LayerNorm(dim) + self.head = nn.Sequential(nn.Linear(dim, 2 * dim), nn.GELU(), nn.Linear(2 * dim, fp_bits)) + self.max_energy = max_energy + + energy_features = FormulaFormer.energy_features + + def forward(self, root, peaks, inten, mask, spectra, instrument, energy): + """root [B,E]; peaks [B,K,E]; inten [B,K,2]; mask [B,K]; spectra [B,2] spectra merged per adduct; + instrument [B] long; energy [B] mean recorded collision energy (NaN = none). Returns logits.""" + root_f = root.float() + loss = (root_f.unsqueeze(1) - peaks.float()).clamp(min=0) + feats = torch.cat([self.embed(peaks), self.embed(loss), inten, torch.log10(inten.clamp(min=1e-4)) / 4 + 1], dim=-1) + tokens = self.peak_in(feats) + missing = torch.isnan(energy) + context = self.energy(self.energy_features(torch.nan_to_num(energy, nan=0.0))) + context = torch.where(missing.unsqueeze(-1), self.no_energy.expand_as(context), context) + total = spectra.sum(-1, keepdim=True).clamp(min=1) + described = torch.cat([(spectra > 0).float(), spectra / total, torch.log2(total) / 8, (total == 1).float()], dim=-1) + cls = self.root_in(self.embed(root)) + self.context(described) + self.instrument(instrument) + context + x = torch.cat([cls.unsqueeze(1), tokens], dim=1) + forms = torch.cat([root_f.unsqueeze(1), peaks.float()], dim=1) + diff = (forms.unsqueeze(2) - forms.unsqueeze(1)).abs() + bias = self.pair(self.embed(diff)).permute(0, 3, 1, 2) + valid = torch.cat([torch.ones_like(mask[:, :1]), mask], dim=1) + bias = bias.masked_fill(~valid[:, None, None, :], float('-inf')).to(x.dtype) + for block in self.blocks: + x = block(x, bias) + return self.head(self.norm(x[:, 0])) diff --git a/shared/package-files/96/96aba21e6dc45a22461ebd6f5a4e7566863e028a6b5b350ed2007045f79c60b3/model_manifest.json b/shared/package-files/96/96aba21e6dc45a22461ebd6f5a4e7566863e028a6b5b350ed2007045f79c60b3/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..c0c47be68726b402cf151009a2461aa9056293dd --- /dev/null +++ b/shared/package-files/96/96aba21e6dc45a22461ebd6f5a4e7566863e028a6b5b350ed2007045f79c60b3/model_manifest.json @@ -0,0 +1,13 @@ +{ + "schema": "massspecgym-retrieval-model/v1", + "checkpoint": { + "path": "model.pt", + "sha256": "dcd6427a4b330af2accd3697855cc3ea5c8d8630f69304665f2b5c2077d303b7", + "format": "pytorch" + }, + "model_config": "model_config.json", + "training_provenance": { + "data": "MassSpecGym v1.5 train fold", + "pretrained_assets": [] + } +} diff --git a/shared/package-files/96/96dff0a9f281d3428c308ba3c2e39e1fc38590b8c38cd284fbf91c9c92747bb3/selfsim-genx1.done b/shared/package-files/96/96dff0a9f281d3428c308ba3c2e39e1fc38590b8c38cd284fbf91c9c92747bb3/selfsim-genx1.done new file mode 100644 index 0000000000000000000000000000000000000000..348dd0cbfdc6da644ffc76d90a9b6bb00de0290e --- /dev/null +++ b/shared/package-files/96/96dff0a9f281d3428c308ba3c2e39e1fc38590b8c38cd284fbf91c9c92747bb3/selfsim-genx1.done @@ -0,0 +1 @@ +Wed Nov 11 09:27:56 UTC 2026 diff --git a/shared/package-files/96/96e833dd564bcf7bbe8ffc9d69ee2e0fd4181d9bf88e40a84366c2fa6103f3ea/eval-score-N5-mix-merged-10-sqrt-0.75.log b/shared/package-files/96/96e833dd564bcf7bbe8ffc9d69ee2e0fd4181d9bf88e40a84366c2fa6103f3ea/eval-score-N5-mix-merged-10-sqrt-0.75.log new file mode 100644 index 0000000000000000000000000000000000000000..d5a70709af37c3d3148fdb462faed87ff4a4103c --- /dev/null +++ b/shared/package-files/96/96e833dd564bcf7bbe8ffc9d69ee2e0fd4181d9bf88e40a84366c2fa6103f3ea/eval-score-N5-mix-merged-10-sqrt-0.75.log @@ -0,0 +1,41 @@ +19429 queries, 5 members, 157.0 s +cos pool rule all=0.6363 dom=0.8545 non=0.4172 h5=0.7435 macro=0.7407 +cen pool rule all=0.6176 dom=0.8268 non=0.4076 h5=0.7499 macro=0.7165 +cos_pm pool rule all=0.6381 dom=0.8534 non=0.4219 h5=0.7502 macro=0.7398 +dot pool rule all=0.6462 dom=0.8286 non=0.4630 h5=0.7843 macro=0.7301 +geo pool rule all=0.5920 dom=0.8324 non=0.3506 h5=0.7039 macro=0.7150 +idf05 pool rule all=0.6401 dom=0.8535 non=0.4258 h5=0.7624 macro=0.7416 +idf1 pool rule all=0.6475 dom=0.8529 non=0.4413 h5=0.7644 macro=0.7425 +lin pool rule all=0.6104 dom=0.8087 non=0.4112 h5=0.7225 macro=0.7061 +log01 pool rule all=0.6657 dom=0.8595 non=0.4712 h5=0.7905 macro=0.7392 +log05 pool rule all=0.6709 dom=0.8681 non=0.4729 h5=0.7897 macro=0.7510 +log20 pool rule all=0.6476 dom=0.8634 non=0.4310 h5=0.7617 macro=0.7490 +nll02 pool rule all=0.4977 dom=0.7457 non=0.2486 h5=0.6474 macro=0.6178 +nll10 pool rule all=0.4611 dom=0.6987 non=0.2226 h5=0.5986 macro=0.5670 +poolcen pool rule all=0.6190 dom=0.8303 non=0.4068 h5=0.7676 macro=0.7185 +pow020 pool rule all=0.6100 dom=0.8302 non=0.3889 h5=0.7727 macro=0.7165 +pow030 pool rule all=0.6149 dom=0.8463 non=0.3826 h5=0.7870 macro=0.7239 +pow040 pool rule all=0.6608 dom=0.8566 non=0.4642 h5=0.7875 macro=0.7398 +pow05 pool rule all=0.6763 dom=0.8607 non=0.4912 h5=0.7996 macro=0.7457 +pow05idf025 pool rule all=0.6739 dom=0.8622 non=0.4848 h5=0.8048 macro=0.7481 +pow05idf05 pool rule all=0.6763 dom=0.8613 non=0.4905 h5=0.8093 macro=0.7481 +pow05m pool rule all=0.6453 dom=0.8611 non=0.4286 h5=0.7716 macro=0.7451 +pow05s pool rule all=0.6134 dom=0.8496 non=0.3763 h5=0.7275 macro=0.7307 +pow060 pool rule all=0.6484 dom=0.8621 non=0.4337 h5=0.7689 macro=0.7507 +pow060idf025 pool rule all=0.6478 dom=0.8625 non=0.4323 h5=0.7697 macro=0.7490 +pow060idf050 pool rule all=0.6470 dom=0.8635 non=0.4296 h5=0.7752 macro=0.7496 +pow060m pool rule all=0.6418 dom=0.8622 non=0.4204 h5=0.7673 macro=0.7478 +pow065 pool rule all=0.6477 dom=0.8622 non=0.4324 h5=0.7636 macro=0.7496 +pow070 pool rule all=0.6486 dom=0.8636 non=0.4327 h5=0.7615 macro=0.7496 +pow070idf025 pool rule all=0.6491 dom=0.8617 non=0.4356 h5=0.7681 macro=0.7507 +pow070idf050 pool rule all=0.6531 dom=0.8630 non=0.4425 h5=0.7707 macro=0.7507 +pow070m pool rule all=0.6441 dom=0.8647 non=0.4227 h5=0.7579 macro=0.7481 +pow075 pool rule all=0.6492 dom=0.8620 non=0.4356 h5=0.7592 macro=0.7484 +pow080 pool rule all=0.6413 dom=0.8576 non=0.4240 h5=0.7566 macro=0.7445 +pow080m pool rule all=0.6414 dom=0.8592 non=0.4227 h5=0.7526 macro=0.7442 +pow085 pool rule all=0.6392 dom=0.8570 non=0.4205 h5=0.7545 macro=0.7434 +pow085idf025 pool rule all=0.6426 dom=0.8578 non=0.4265 h5=0.7626 macro=0.7457 +pow085idf050 pool rule all=0.6463 dom=0.8577 non=0.4340 h5=0.7640 macro=0.7460 +pow090 pool rule all=0.6404 dom=0.8580 non=0.4219 h5=0.7541 macro=0.7437 +pow2 pool rule all=0.6107 dom=0.8158 non=0.4047 h5=0.7335 macro=0.7112 +tani pool rule all=0.6158 dom=0.8358 non=0.3949 h5=0.7512 macro=0.7262 diff --git a/shared/package-files/96/96f1f8b9f21541ab083d787da1b876709b3f83e878423ba5d6025cb723b075c4/errors.py b/shared/package-files/96/96f1f8b9f21541ab083d787da1b876709b3f83e878423ba5d6025cb723b075c4/errors.py new file mode 100644 index 0000000000000000000000000000000000000000..8f79f286791ea498dee8e68fda9e4bad3abda4ef --- /dev/null +++ b/shared/package-files/96/96f1f8b9f21541ab083d787da1b876709b3f83e878423ba5d6025cb723b075c4/errors.py @@ -0,0 +1,61 @@ +"""Error analysis from saved distances (development; uses validation labels).""" +import json, pickle, sys, hashlib +from pathlib import Path +from collections import defaultdict +import numpy as np +root, pred = Path(sys.argv[1]), Path(sys.argv[2]) +labels = {} +for line in open('/workspace/data/validation.jsonl'): + r = json.loads(line); labels[r['query_id']] = r +queries = [json.loads(l) for l in open(root / 'queries.jsonl')] +pools = {} +for l in open(root / 'candidate_pools.jsonl'): + r = json.loads(l); pools[r['candidate_pool_id']] = r['candidates'] +dist = pickle.load(open(pred / 'distances.pkl', 'rb')) +by_pool = defaultdict(list) +for q in queries: by_pool[q['candidate_pool_id']].append(q) +def cond(q): + return ('Na' if 'Na' in q['adduct'] else 'H', 'ceNA' if q['collision_energy'] is None else 'ce', q['instrument_type'] or 'none') +rows = [] +for pid, qs in by_pool.items(): + cands = pools[pid]; ids = np.array([c['candidate_id'] for c in cands]) + ds = [dist[q['query_id']] for q in qs] + mean = np.mean([d for d in ds if d is not None], axis=0) + conds = set(cond(q)[:2] for q in qs) + for q, d in zip(qs, ds): + tid = hashlib.sha256(labels[q['query_id']]['target_smiles'].encode()).hexdigest() + t = int(np.where(ids == tid)[0][0]) + mz = np.array(q['mzs']) if 'mzs' in q else np.array(q.get('mz', [])) + r_ind = int((d < d[t]).sum()); r_agg = int((mean < mean[t]).sum()) + ties = int((d == d[t]).sum()) - 1 + rows.append(dict(c=cond(q), npk=len(q['intensities']), n=len(cands), r_ind=r_ind, r_agg=r_agg, ties=ties, + dt=float(d[t]), dmin=float(d.min()), pool_n=len(qs), has_dom=('H','ce') in conds, pid=pid, + nunsup=int((d >= 1.0).sum()))) +def summarize(name, sel): + sel = list(sel) + if not sel: return + a = lambda k: np.array([r[k] for r in sel]) + print(f"{name:42s} n={len(sel):5d} hit1_ind={np.mean(a('r_ind')==0):.3f} hit1_agg={np.mean(a('r_agg')==0):.3f} h5_agg={np.mean(a('r_agg')<5):.3f} h20_agg={np.mean(a('r_agg')<20):.3f} " + f"npk={np.median(a('npk')):.0f} d_t={np.median(a('dt')):.3f} d_min={np.median(a('dmin')):.3f} ties={np.mean(a('ties')>0):.2f} cands={np.median(a('n')):.0f}") +summarize('all', rows) +for c in sorted(set(r['c'][:2] for r in rows)): + summarize(str(c), [r for r in rows if r['c'][:2] == c]) +for c in sorted(set(r['c'] for r in rows)): + summarize(str(c), [r for r in rows if r['c'] == c]) +print('--- non-domain queries by pool composition') +nd = [r for r in rows if r['c'][:2] != ('H', 'ce')] +summarize('nondomain, pool has domain spectra', [r for r in nd if r['has_dom']]) +summarize('nondomain, pool has no domain spectra', [r for r in nd if not r['has_dom']]) +print('--- by number of peaks') +for lo, hi in [(1, 3), (3, 6), (6, 11), (11, 21), (21, 51), (51, 10**6)]: + summarize(f'npk [{lo},{hi})', [r for r in rows if lo <= r['npk'] < hi]) +print('--- by pool size (queries per pool)') +for lo, hi in [(1, 2), (2, 4), (4, 8), (8, 16), (16, 10**6)]: + summarize(f'pool_n [{lo},{hi})', [r for r in rows if lo <= r['pool_n'] < hi]) +print('--- by candidates') +for lo, hi in [(1, 32), (32, 128), (128, 256), (256, 257)]: + summarize(f'cands [{lo},{hi})', [r for r in rows if lo <= r['n'] < hi]) +# pool-level (each pool once) +pl = {} +for r in rows: pl.setdefault(r['pid'], r) +print('pool-level hit1_agg (pools weighted equally):', np.mean([r['r_agg'] == 0 for r in pl.values()]), len(pl)) diff --git a/shared/package-files/97/9748c98a0db6aa99df282ef35a0e61cacfdf3f545565071c85d584f52d033009/selfsim-sub75-simulate.log b/shared/package-files/97/9748c98a0db6aa99df282ef35a0e61cacfdf3f545565071c85d584f52d033009/selfsim-sub75-simulate.log new file mode 100644 index 0000000000000000000000000000000000000000..946151ead082f8d735b5ba48f86ca9335eb49914 --- /dev/null +++ b/shared/package-files/97/9748c98a0db6aa99df282ef35a0e61cacfdf3f545565071c85d584f52d033009/selfsim-sub75-simulate.log @@ -0,0 +1,16 @@ +{"event": "canonicalized", "unique_candidates": 326304, "unsupported": 83, "seconds": 19.872095546219498} +{"event": "planned", "queries": 2935, "groups": 2935, "molecules": 328404, "simulations": 651127, "seconds": 21.2125099520199} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 651127, "seconds": 39.92957446491346, "per_second": 1602.8219899071923} +{"event": "simulating", "finished": 128000, "total": 651127, "seconds": 82.2282933066599, "per_second": 1556.641818195598} +{"event": "simulating", "finished": 192000, "total": 651127, "seconds": 125.21657037874684, "per_second": 1533.3433859372687} +{"event": "simulating", "finished": 256000, "total": 651127, "seconds": 169.9050160977058, "per_second": 1506.724203202949} +{"event": "simulating", "finished": 320000, "total": 651127, "seconds": 215.54192254599184, "per_second": 1484.6299792640996} +{"event": "simulating", "finished": 384000, "total": 651127, "seconds": 263.01753270067275, "per_second": 1459.9787172249519} +{"event": "simulating", "finished": 448000, "total": 651127, "seconds": 311.8782576317899, "per_second": 1436.4579416399022} +{"event": "simulating", "finished": 512000, "total": 651127, "seconds": 363.1590529526584, "per_second": 1409.8505760415246} +{"event": "simulating", "finished": 576000, "total": 651127, "seconds": 447.5288745146245, "per_second": 1287.067791155847} +{"event": "simulating", "finished": 640000, "total": 651127, "seconds": 581.2644152715802, "per_second": 1101.047962313291} +{"event": "simulated", "finished": 651127, "total": 651127, "failed": 0, "seconds": 607.1665660599247} +{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443} diff --git a/shared/package-files/97/9785e3663532664bfcd83efa76ac420d3ad5ad39c7ffb8e48cadb3b28d066b64/swap-I16-w0.75_0.1_0.5.log b/shared/package-files/97/9785e3663532664bfcd83efa76ac420d3ad5ad39c7ffb8e48cadb3b28d066b64/swap-I16-w0.75_0.1_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..815df58e5b19b03a8d452ddb6bfb410a8d93390d --- /dev/null +++ b/shared/package-files/97/9785e3663532664bfcd83efa76ac420d3ad5ad39c7ffb8e48cadb3b28d066b64/swap-I16-w0.75_0.1_0.5.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7680 pool-macro 0.8639 Hit@5 0.8761 Hit@20 0.9319 | twin pools 354 (macro 0.7542), others macro 0.8766 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4563 (domain 0.4187 / other 0.4941) macro 0.3804 + lam 1.00/1.00: Hit@1 0.8038 (+0.0358 [+0.0179, +0.0588]) macro +0.0145 [+0.0086, +0.0204] pools +81 -32 | no top 20 +0.0275 cap30 +0.0284 [+0.0157, +0.0427] | Hit@5 -0.0003 macro@5 +0.0097 cap30@5 +0.0181 +without consensus term: Hit@1 0.7680 (ref 0.7713; -0.0033 [-0.0140, +0.0062]) macro 0.8639 (+0.0047 [-0.0003, +0.0095]) pools +46 -30 cap30 -0.0030 | Hit@5 0.8761 (-0.0036) Hit@20 0.9319 (-0.0058) + domain 0.9289 (-0.0025) other 0.6064 (-0.0042) | Orbitrap no energy 0.5714 (-0.0050) | above 850 0.4431 (+0.0286) below 850 0.8420 (-0.0106) +full rule : Hit@1 0.8038 (ref 0.8022; +0.0016 [-0.0116, +0.0143]) macro 0.8783 (+0.0044 [+0.0003, +0.0092]) pools +40 -25 cap30 +0.0010 | Hit@5 0.8758 (+0.0039) Hit@20 0.9081 (-0.0083) + domain 0.9407 (+0.0043) other 0.6663 (-0.0010) | Orbitrap no energy 0.6380 (-0.0022) | above 850 0.5178 (-0.0269) below 850 0.8689 (+0.0082) diff --git a/shared/package-files/97/9798c2e7cf9fe2e57577504ccdcb223c66dec3ff7ff0038ab5afba61bcc1310d/ensemble-mean-5M-S2-30k.log b/shared/package-files/97/9798c2e7cf9fe2e57577504ccdcb223c66dec3ff7ff0038ab5afba61bcc1310d/ensemble-mean-5M-S2-30k.log new file mode 100644 index 0000000000000000000000000000000000000000..b1f9f798b4819e4424c65132a59a45ab455882ce --- /dev/null +++ b/shared/package-files/97/9798c2e7cf9fe2e57577504ccdcb223c66dec3ff7ff0038ab5afba61bcc1310d/ensemble-mean-5M-S2-30k.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 59.84098243799235} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 63.42209707899019} +ind meanD all=0.4986 dom=0.7392 non=0.2571 h5=0.6459 h20=0.7236 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6423 dom=0.8124 non=0.4715 h5=0.8454 h20=0.9064 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.5051 dom=0.7473 non=0.2620 h5=0.6496 h20=0.7245 | diff=+0.0065 [+0.0042,+0.0088] +agg Dmean all=0.6485 dom=0.8188 non=0.4776 h5=0.8464 h20=0.9093 | diff=+0.0062 [+0.0013,+0.0119] +ind gmean all=0.4969 dom=0.7364 non=0.2564 h5=0.6443 h20=0.7222 | diff=-0.0017 [-0.0034,-0.0002] +agg gmean all=0.6399 dom=0.8112 non=0.4679 h5=0.8460 h20=0.9066 | diff=-0.0024 [-0.0057,+0.0004] diff --git a/shared/package-files/99/990da80fdb23f77d9427167058b4aef130f2c1d5321ef7bec83a0cc047535cb6/scorelab-B45k-full-v4.log b/shared/package-files/99/990da80fdb23f77d9427167058b4aef130f2c1d5321ef7bec83a0cc047535cb6/scorelab-B45k-full-v4.log new file mode 100644 index 0000000000000000000000000000000000000000..e73f4e1c6663c708b6598ec879e3f8374caec719 --- /dev/null +++ b/shared/package-files/99/990da80fdb23f77d9427167058b4aef130f2c1d5321ef7bec83a0cc047535cb6/scorelab-B45k-full-v4.log @@ -0,0 +1,6 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 74.55316867597867} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 77.96208804508206} +ind base all=0.4590 dom=0.7023 non=0.2146 h5=0.5976 h20=0.6892 | diff=+0.0000 [+0.0000,+0.0000] +agg base all=0.6033 dom=0.8067 non=0.3992 h5=0.7666 h20=0.8615 | diff=+0.0000 [+0.0000,+0.0000] +ind noprec_pp0.75 all=0.4794 dom=0.7183 non=0.2395 h5=0.6312 h20=0.7129 | diff=+0.0204 [+0.0146,+0.0261] +agg noprec_pp0.75 all=0.6124 dom=0.7996 non=0.4244 h5=0.8002 h20=0.8983 | diff=+0.0091 [-0.0132,+0.0287] diff --git a/shared/package-files/99/996a0bf2adc93ed42c870ceb8428c5144014865d3b08534c493b88bf5608dbf9/netprop_final.sh b/shared/package-files/99/996a0bf2adc93ed42c870ceb8428c5144014865d3b08534c493b88bf5608dbf9/netprop_final.sh new file mode 100644 index 0000000000000000000000000000000000000000..994287df4323242264485b8143b59b2c854cf979 --- /dev/null +++ b/shared/package-files/99/996a0bf2adc93ed42c870ceb8428c5144014865d3b08534c493b88bf5608dbf9/netprop_final.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# E65: controls, sensitivity and shard behaviour of the cross-pool consensus term at the chosen setting +cd /workspace/research +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps OMP_NUM_THREADS=2 +PY=/opt/glacier/bin/python +V=10:3:half=0.5 +run() { cores=$1; tag=$2; shift 2; taskset -c $cores $PY allcond/analysis/netprop.py evaluate --pred evals/fullfold/5Ms-I9b+I13-L-ion/pred --brief "$@" > logs/netprop-final-$tag.log 2>&1; } +N="--neigh evals/netprop/neigh-val.npz" +run 8-9 shuffle $N --m 5 --tau 0.02 --variants $V --lams 1/1 --shuffle 1 & +run 10-11 randcand $N --m 5 --tau 0.02 --variants $V --lams 1/1 --control random-candidate & +run 12-13 rounds2 $N --m 5 --tau 0.02 --variants $V --lams 1/1 --rounds 2 & +run 14-15 rounds3 $N --m 5 --tau 0.02 --variants $V --lams 1/1 --rounds 3 & +run 16-17 kp $N --m 5 --tau 0.02 --variants 5:3:half=0.5,20:3:half=0.5,10:2:half=0.5,10:6:half=0.5,10:3:half=0.3 --lams 0.5/1,1/1,2/2 & +run 18-19 m1 $N --m 1 --variants $V --lams 1/1 & +run 20-21 m3 $N --m 3 --tau 0.02 --variants $V --lams 1/1 & +wait +run 8-9 m10 $N --m 10 --tau 0.02 --variants $V --lams 1/1 & +run 10-11 t01 $N --m 5 --tau 0.01 --variants $V --lams 1/1 & +run 12-13 t05 $N --m 5 --tau 0.05 --variants $V --lams 1/1 & +run 14-15 nodebias $N --m 5 --tau 0.02 --variants $V --lams 1/1 --debias none & +for spec in 0.25:1 0.25:2 0.1:1 0.03:1; do + tag=$(echo $spec | tr ':.' '-_') + taskset -c 16-21 $PY allcond/analysis/netprop.py search --out evals/netprop/neigh-sub-$tag.npz --pools $spec > logs/netprop-search-$tag.log 2>&1 + taskset -c 16-21 $PY allcond/analysis/netprop.py evaluate --pred evals/fullfold/5Ms-I9b+I13-L-ion/pred --brief --neigh evals/netprop/neigh-sub-$tag.npz --pools $spec --m 5 --tau 0.02 --variants $V,10:3:norm --lams 1/1,0.5/0.5 > logs/netprop-final-sub-$tag.log 2>&1 +done +wait +echo done > logs/netprop-final.done diff --git a/shared/package-files/99/9983e755b3ec6a3f9a6c2aa1f37956efba65a45ed0645338690f5d12b06b171a/genlm-sample-lm1.log b/shared/package-files/99/9983e755b3ec6a3f9a6c2aa1f37956efba65a45ed0645338690f5d12b06b171a/genlm-sample-lm1.log new file mode 100644 index 0000000000000000000000000000000000000000..19005d3d7c27b7521b769b5c1c81adbb6908b1dc --- /dev/null +++ b/shared/package-files/99/9983e755b3ec6a3f9a6c2aa1f37956efba65a45ed0645338690f5d12b06b171a/genlm-sample-lm1.log @@ -0,0 +1,64 @@ +{"kept": 7177, "drawn": 8192, "invalid": 212, "duplicate_or_supplied": 803, "unfinished": 0, "seconds": 2.6708156450185925} +{"kept": 14318, "drawn": 16384, "invalid": 430, "duplicate_or_supplied": 1632, "unfinished": 4, "seconds": 3.9725931970169768} +{"kept": 21480, "drawn": 24576, "invalid": 627, "duplicate_or_supplied": 2462, "unfinished": 7, "seconds": 5.364300813060254} +{"kept": 28585, "drawn": 32768, "invalid": 814, "duplicate_or_supplied": 3358, "unfinished": 11, "seconds": 6.675239652977325} +{"kept": 35734, "drawn": 40960, "invalid": 1036, "duplicate_or_supplied": 4177, "unfinished": 13, "seconds": 7.993560085073113} +{"kept": 42869, "drawn": 49152, "invalid": 1257, "duplicate_or_supplied": 5006, "unfinished": 20, "seconds": 9.302123514004052} +{"kept": 49981, "drawn": 57344, "invalid": 1476, "duplicate_or_supplied": 5862, "unfinished": 25, "seconds": 10.590397596010007} +{"kept": 57034, "drawn": 65536, "invalid": 1696, "duplicate_or_supplied": 6779, "unfinished": 27, "seconds": 11.91147746797651} +{"kept": 64143, "drawn": 73728, "invalid": 1904, "duplicate_or_supplied": 7653, "unfinished": 28, "seconds": 13.303172921994701} +{"kept": 71269, "drawn": 81920, "invalid": 2128, "duplicate_or_supplied": 8491, "unfinished": 32, "seconds": 14.600186501047574} +{"kept": 78275, "drawn": 90112, "invalid": 2346, "duplicate_or_supplied": 9456, "unfinished": 35, "seconds": 15.895826683030464} +{"kept": 85280, "drawn": 98304, "invalid": 2585, "duplicate_or_supplied": 10402, "unfinished": 37, "seconds": 17.18300375097897} +{"kept": 92353, "drawn": 106496, "invalid": 2792, "duplicate_or_supplied": 11312, "unfinished": 39, "seconds": 18.474601682974026} +{"kept": 99434, "drawn": 114688, "invalid": 3005, "duplicate_or_supplied": 12208, "unfinished": 41, "seconds": 19.78406046901364} +{"kept": 106434, "drawn": 122880, "invalid": 3247, "duplicate_or_supplied": 13157, "unfinished": 42, "seconds": 21.061057167011313} +{"kept": 113480, "drawn": 131072, "invalid": 3442, "duplicate_or_supplied": 14101, "unfinished": 49, "seconds": 22.354276424041018} +{"kept": 120515, "drawn": 139264, "invalid": 3636, "duplicate_or_supplied": 15062, "unfinished": 51, "seconds": 23.703066969057545} +{"kept": 127571, "drawn": 147456, "invalid": 3816, "duplicate_or_supplied": 16017, "unfinished": 52, "seconds": 24.99633861903567} +{"kept": 134555, "drawn": 155648, "invalid": 4049, "duplicate_or_supplied": 16989, "unfinished": 55, "seconds": 26.29549292603042} +{"kept": 141542, "drawn": 163840, "invalid": 4314, "duplicate_or_supplied": 17927, "unfinished": 57, "seconds": 27.597061697975732} +{"kept": 148558, "drawn": 172032, "invalid": 4530, "duplicate_or_supplied": 18883, "unfinished": 61, "seconds": 28.895127334049903} +{"kept": 155581, "drawn": 180224, "invalid": 4725, "duplicate_or_supplied": 19853, "unfinished": 65, "seconds": 30.185850247042254} +{"kept": 162597, "drawn": 188416, "invalid": 4939, "duplicate_or_supplied": 20809, "unfinished": 71, "seconds": 31.47238605900202} +{"kept": 169594, "drawn": 196608, "invalid": 5131, "duplicate_or_supplied": 21811, "unfinished": 72, "seconds": 32.766290414030664} +{"kept": 176557, "drawn": 204800, "invalid": 5334, "duplicate_or_supplied": 22837, "unfinished": 72, "seconds": 34.05110295303166} +{"kept": 183540, "drawn": 212992, "invalid": 5552, "duplicate_or_supplied": 23825, "unfinished": 75, "seconds": 35.351567278034054} +{"kept": 190554, "drawn": 221184, "invalid": 5740, "duplicate_or_supplied": 24812, "unfinished": 78, "seconds": 36.63529534207191} +{"kept": 197510, "drawn": 229376, "invalid": 5950, "duplicate_or_supplied": 25834, "unfinished": 82, "seconds": 37.92990020697471} +{"kept": 204482, "drawn": 237568, "invalid": 6150, "duplicate_or_supplied": 26851, "unfinished": 85, "seconds": 39.242902960046194} +{"kept": 211439, "drawn": 245760, "invalid": 6349, "duplicate_or_supplied": 27882, "unfinished": 90, "seconds": 40.550541748991236} +{"kept": 218386, "drawn": 253952, "invalid": 6555, "duplicate_or_supplied": 28917, "unfinished": 94, "seconds": 41.86057188606355} +{"kept": 225372, "drawn": 262144, "invalid": 6771, "duplicate_or_supplied": 29904, "unfinished": 97, "seconds": 43.26206718897447} +{"kept": 232329, "drawn": 270336, "invalid": 6980, "duplicate_or_supplied": 30930, "unfinished": 97, "seconds": 44.56310122704599} +{"kept": 239285, "drawn": 278528, "invalid": 7208, "duplicate_or_supplied": 31937, "unfinished": 98, "seconds": 45.847524341079406} +{"kept": 246267, "drawn": 286720, "invalid": 7435, "duplicate_or_supplied": 32914, "unfinished": 104, "seconds": 47.155395708978176} +{"kept": 253277, "drawn": 294912, "invalid": 7628, "duplicate_or_supplied": 33899, "unfinished": 108, "seconds": 48.44582691905089} +{"kept": 260246, "drawn": 303104, "invalid": 7835, "duplicate_or_supplied": 34914, "unfinished": 109, "seconds": 49.8535703769885} +{"kept": 267224, "drawn": 311296, "invalid": 8014, "duplicate_or_supplied": 35947, "unfinished": 111, "seconds": 51.14705920999404} +{"kept": 274166, "drawn": 319488, "invalid": 8233, "duplicate_or_supplied": 36977, "unfinished": 112, "seconds": 52.44807139807381} +{"kept": 281109, "drawn": 327680, "invalid": 8429, "duplicate_or_supplied": 38028, "unfinished": 114, "seconds": 53.78131529001985} +{"kept": 288037, "drawn": 335872, "invalid": 8634, "duplicate_or_supplied": 39085, "unfinished": 116, "seconds": 55.114069988019764} +{"kept": 294949, "drawn": 344064, "invalid": 8841, "duplicate_or_supplied": 40157, "unfinished": 117, "seconds": 56.40405497699976} +{"kept": 301856, "drawn": 352256, "invalid": 9050, "duplicate_or_supplied": 41231, "unfinished": 119, "seconds": 57.74231909296941} +{"kept": 308822, "drawn": 360448, "invalid": 9230, "duplicate_or_supplied": 42276, "unfinished": 120, "seconds": 59.05919127899688} +{"kept": 315664, "drawn": 368640, "invalid": 9446, "duplicate_or_supplied": 43408, "unfinished": 122, "seconds": 60.36487693700474} +{"kept": 322580, "drawn": 376832, "invalid": 9663, "duplicate_or_supplied": 44465, "unfinished": 124, "seconds": 61.65127360005863} +{"kept": 329440, "drawn": 385024, "invalid": 9886, "duplicate_or_supplied": 45573, "unfinished": 125, "seconds": 62.95653323200531} +{"kept": 336384, "drawn": 393216, "invalid": 10112, "duplicate_or_supplied": 46594, "unfinished": 126, "seconds": 64.25899139698595} +{"kept": 343271, "drawn": 401408, "invalid": 10330, "duplicate_or_supplied": 47678, "unfinished": 129, "seconds": 65.5532503380673} +{"kept": 350116, "drawn": 409600, "invalid": 10548, "duplicate_or_supplied": 48806, "unfinished": 130, "seconds": 66.86680025805254} +{"kept": 357033, "drawn": 417792, "invalid": 10752, "duplicate_or_supplied": 49877, "unfinished": 130, "seconds": 68.18379245407414} +{"kept": 363953, "drawn": 425984, "invalid": 10971, "duplicate_or_supplied": 50928, "unfinished": 132, "seconds": 69.54545891901944} +{"kept": 370902, "drawn": 434176, "invalid": 11163, "duplicate_or_supplied": 51974, "unfinished": 137, "seconds": 70.87285130703822} +{"kept": 377805, "drawn": 442368, "invalid": 11342, "duplicate_or_supplied": 53083, "unfinished": 138, "seconds": 72.15711052704137} +{"kept": 384700, "drawn": 450560, "invalid": 11557, "duplicate_or_supplied": 54164, "unfinished": 139, "seconds": 73.4353119659936} +{"kept": 391592, "drawn": 458752, "invalid": 11746, "duplicate_or_supplied": 55274, "unfinished": 140, "seconds": 74.72203787602484} +{"kept": 398510, "drawn": 466944, "invalid": 11975, "duplicate_or_supplied": 56314, "unfinished": 145, "seconds": 75.98879742599092} +{"kept": 405392, "drawn": 475136, "invalid": 12194, "duplicate_or_supplied": 57401, "unfinished": 149, "seconds": 77.29072803608142} +{"kept": 412270, "drawn": 483328, "invalid": 12386, "duplicate_or_supplied": 58520, "unfinished": 152, "seconds": 78.59009945206344} +{"kept": 419225, "drawn": 491520, "invalid": 12603, "duplicate_or_supplied": 59537, "unfinished": 155, "seconds": 79.89161153498571} +{"kept": 426130, "drawn": 499712, "invalid": 12813, "duplicate_or_supplied": 60612, "unfinished": 157, "seconds": 81.22501553606708} +{"kept": 432955, "drawn": 507904, "invalid": 13025, "duplicate_or_supplied": 61761, "unfinished": 163, "seconds": 82.52538592298515} +{"kept": 435000, "drawn": 516096, "invalid": 13224, "duplicate_or_supplied": 62866, "unfinished": 165, "seconds": 83.85766342305578} +{"schema": "allcond-generated-structures/v1", "name": "gen-lm1", "generator": "genlm.py lm-a", "structures": 435000, "seed": 0, "temperature": 1.0, "supplied_2d_keys": 456761, "drawn": 516096, "invalid_or_filtered": 13224, "duplicate_or_supplied": 62866, "unfinished": 165, "mass_percentiles_1_10_50_90_99": [175.07639175722, 263.11575803062, 360.17975526952, 480.37481507077615, 726.2371145059201], "seconds": 85.06941369606648} diff --git a/shared/package-files/99/99a2c2f34f9bc1f382750dda53e1ee2a000884bd61d24582fffd912bd90d83ca/mixed-pools-meqq.log b/shared/package-files/99/99a2c2f34f9bc1f382750dda53e1ee2a000884bd61d24582fffd912bd90d83ca/mixed-pools-meqq.log new file mode 100644 index 0000000000000000000000000000000000000000..0566eb53cb2e5721fdcab594c2be72501e5c9d5a --- /dev/null +++ b/shared/package-files/99/99a2c2f34f9bc1f382750dda53e1ee2a000884bd61d24582fffd912bd90d83ca/mixed-pools-meqq.log @@ -0,0 +1,26 @@ +mixed pools 254 queries 3437 +released all=0.7384 dom=0.9007 non=0.5755 h5=0.8418 h20=0.9104 macro=0.8210 +alpha=0.5 inverse=released all=0.7370 dom=0.8993 non=0.5741 h5=0.8419 h20=0.9083 macro=0.8198 | -0.0013 [-0.0037,+0.0011] | mixed 0.7539 pools +4 -8 +alpha=0.5 inverse=same all=0.7348 dom=0.8959 non=0.5730 h5=0.8423 h20=0.9083 macro=0.8193 | -0.0036 [-0.0076,-0.0004] | mixed 0.7411 pools +3 -9 +alpha=0.5 inverse=domain all=0.7375 dom=0.9012 non=0.5732 h5=0.8463 h20=0.9037 macro=0.8196 | -0.0009 [-0.0045,+0.0031] | mixed 0.7565 pools +6 -11 +alpha=2.0 inverse=released all=0.7374 dom=0.8996 non=0.5744 h5=0.8450 h20=0.9104 macro=0.8207 | -0.0010 [-0.0033,+0.0005] | mixed 0.7556 pools +1 -2 +alpha=2.0 inverse=same all=0.7378 dom=0.9001 non=0.5748 h5=0.8446 h20=0.9102 macro=0.8207 | -0.0006 [-0.0020,+0.0005] | mixed 0.7582 pools +1 -2 +alpha=2.0 inverse=domain all=0.7382 dom=0.9012 non=0.5746 h5=0.8481 h20=0.9064 macro=0.8207 | -0.0002 [-0.0032,+0.0029] | mixed 0.7605 pools +7 -8 +alpha=4.0 inverse=released all=0.7364 dom=0.8988 non=0.5733 h5=0.8438 h20=0.9102 macro=0.8198 | -0.0020 [-0.0048,+0.0000] | mixed 0.7501 pools +1 -5 +alpha=4.0 inverse=same all=0.7375 dom=0.9000 non=0.5742 h5=0.8443 h20=0.9102 macro=0.8204 | -0.0009 [-0.0031,+0.0010] | mixed 0.7562 pools +3 -5 +alpha=4.0 inverse=domain all=0.7381 dom=0.9010 non=0.5745 h5=0.8499 h20=0.9101 macro=0.8207 | -0.0003 [-0.0030,+0.0024] | mixed 0.7597 pools +5 -6 +alpha=8.0 inverse=released all=0.7364 dom=0.8988 non=0.5733 h5=0.8442 h20=0.9102 macro=0.8198 | -0.0020 [-0.0048,+0.0000] | mixed 0.7501 pools +1 -5 +alpha=8.0 inverse=same all=0.7433 dom=0.9026 non=0.5834 h5=0.8443 h20=0.9101 macro=0.8216 | +0.0049 [-0.0011,+0.0134] | mixed 0.7894 pools +7 -5 +alpha=8.0 inverse=domain all=0.7402 dom=0.9017 non=0.5781 h5=0.8499 h20=0.9101 macro=0.8210 | +0.0019 [-0.0025,+0.0076] | mixed 0.7719 pools +6 -6 +alpha=inf inverse=released all=0.7381 dom=0.8990 non=0.5766 h5=0.8418 h20=0.8974 macro=0.8196 | -0.0003 [-0.0044,+0.0051] | mixed 0.7600 pools +2 -7 +alpha=inf inverse=same all=0.7406 dom=0.9020 non=0.5785 h5=0.8416 h20=0.9014 macro=0.8213 | +0.0022 [-0.0019,+0.0080] | mixed 0.7739 pools +6 -5 +alpha=inf inverse=domain all=0.7406 dom=0.9020 non=0.5785 h5=0.8416 h20=0.9014 macro=0.8213 | +0.0022 [-0.0019,+0.0080] | mixed 0.7739 pools +6 -5 +alpha=1 inverse=same all=0.7384 dom=0.9007 non=0.5755 h5=0.8418 h20=0.9104 macro=0.8210 | +0.0000 [+0.0000,+0.0000] | mixed 0.7614 pools +0 -0 +alpha=1 inverse=domain all=0.7380 dom=0.9009 non=0.5744 h5=0.8471 h20=0.9064 macro=0.8204 | -0.0004 [-0.0034,+0.0026] | mixed 0.7591 pools +6 -8 +alpha=1 inverse=1.5 all=0.7381 dom=0.9010 non=0.5746 h5=0.8419 h20=0.9103 macro=0.8204 | -0.0003 [-0.0030,+0.0024] | mixed 0.7600 pools +5 -7 +alpha=1 inverse=2.0 all=0.7401 dom=0.9006 non=0.5790 h5=0.8414 h20=0.9064 macro=0.8201 | +0.0017 [-0.0033,+0.0090] | mixed 0.7710 pools +7 -10 +alpha=1 inverse=3.0 all=0.7377 dom=0.8998 non=0.5749 h5=0.8408 h20=0.9064 macro=0.8204 | -0.0007 [-0.0048,+0.0036] | mixed 0.7576 pools +10 -12 +alpha=2.0 inverse x1.5 all=0.7392 dom=0.9021 non=0.5757 h5=0.8444 h20=0.9101 macro=0.8213 | +0.0008 [-0.0013,+0.0032] | mixed 0.7661 pools +5 -4 +alpha=2.0 inverse x2.0 all=0.7372 dom=0.8999 non=0.5738 h5=0.8447 h20=0.9101 macro=0.8198 | -0.0012 [-0.0044,+0.0019] | mixed 0.7547 pools +6 -10 +alpha=4.0 inverse x1.5 all=0.7384 dom=0.9017 non=0.5745 h5=0.8441 h20=0.9101 macro=0.8210 | +0.0001 [-0.0025,+0.0028] | mixed 0.7617 pools +5 -5 +alpha=4.0 inverse x2.0 all=0.7378 dom=0.9006 non=0.5743 h5=0.8447 h20=0.9101 macro=0.8201 | -0.0006 [-0.0036,+0.0023] | mixed 0.7579 pools +6 -9 diff --git a/shared/package-files/99/99e3a35f8297bb84e7449b6060c4bbb2477d63464e5c861d4f3c74ebda48e427/replay-5Ms-N5-L-ion-net2-val-tiny.report.json b/shared/package-files/99/99e3a35f8297bb84e7449b6060c4bbb2477d63464e5c861d4f3c74ebda48e427/replay-5Ms-N5-L-ion-net2-val-tiny.report.json new file mode 100644 index 0000000000000000000000000000000000000000..22266f35385499dd187af2731667896a9a343296 --- /dev/null +++ b/shared/package-files/99/99e3a35f8297bb84e7449b6060c4bbb2477d63464e5c861d4f3c74ebda48e427/replay-5Ms-N5-L-ion-net2-val-tiny.report.json @@ -0,0 +1,119 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.9111111111111111, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.9192352744310577, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.9111111111111111, + "hit_rate_at_20": 0.9888888888888889, + "hit_rate_at_5": 0.9388888888888889 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.027777777777777776, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.0, + "molecule_groups": 40, + "queries": 180, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.0848522727272727 + }, + "queries": 180, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.9640287769784173, + "queries": 139 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.7317073170731707, + "queries": 41 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.9111111111111111, + "queries": 180 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 1.0, + "queries": 49 + }, + "40-59.999": { + "hit_rate_at_1": 1.0, + "queries": 23 + }, + "<20": { + "hit_rate_at_1": 1.0, + "queries": 7 + }, + ">=60": { + "hit_rate_at_1": 1.0, + "queries": 35 + }, + "missing": { + "hit_rate_at_1": 0.7575757575757576, + "queries": 66 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 1.0, + "queries": 1 + }, + "Orbitrap": { + "hit_rate_at_1": 0.8961038961038961, + "queries": 154 + }, + "QTOF": { + "hit_rate_at_1": 1.0, + "queries": 25 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.7647058823529411, + "queries": 68 + }, + "glacier_released": { + "hit_rate_at_1": 1.0, + "queries": 112 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.9111111111111111, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7790636183537835, + "molecule_groups": 40, + "queries": 180, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 1.0 + }, + "valid_rankings": 180 +} diff --git a/shared/package-files/99/99e3a35f8297bb84e7449b6060c4bbb2477d63464e5c861d4f3c74ebda48e427/replay-5Ms-N5-L-ion-net2-val-tiny.score.log b/shared/package-files/99/99e3a35f8297bb84e7449b6060c4bbb2477d63464e5c861d4f3c74ebda48e427/replay-5Ms-N5-L-ion-net2-val-tiny.score.log new file mode 100644 index 0000000000000000000000000000000000000000..22266f35385499dd187af2731667896a9a343296 --- /dev/null +++ b/shared/package-files/99/99e3a35f8297bb84e7449b6060c4bbb2477d63464e5c861d4f3c74ebda48e427/replay-5Ms-N5-L-ion-net2-val-tiny.score.log @@ -0,0 +1,119 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.9111111111111111, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.9192352744310577, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.9111111111111111, + "hit_rate_at_20": 0.9888888888888889, + "hit_rate_at_5": 0.9388888888888889 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.027777777777777776, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.0, + "molecule_groups": 40, + "queries": 180, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.0848522727272727 + }, + "queries": 180, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.9640287769784173, + "queries": 139 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.7317073170731707, + "queries": 41 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.9111111111111111, + "queries": 180 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 1.0, + "queries": 49 + }, + "40-59.999": { + "hit_rate_at_1": 1.0, + "queries": 23 + }, + "<20": { + "hit_rate_at_1": 1.0, + "queries": 7 + }, + ">=60": { + "hit_rate_at_1": 1.0, + "queries": 35 + }, + "missing": { + "hit_rate_at_1": 0.7575757575757576, + "queries": 66 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 1.0, + "queries": 1 + }, + "Orbitrap": { + "hit_rate_at_1": 0.8961038961038961, + "queries": 154 + }, + "QTOF": { + "hit_rate_at_1": 1.0, + "queries": 25 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.7647058823529411, + "queries": 68 + }, + "glacier_released": { + "hit_rate_at_1": 1.0, + "queries": 112 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.9111111111111111, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7790636183537835, + "molecule_groups": 40, + "queries": 180, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 1.0 + }, + "valid_rankings": 180 +} diff --git a/shared/package-files/9b/9b3b4fe65b7e5b1ec4ef0d4cebeca66603b531f59aedd647bb31414cded36bc0/e74-unexplained-train-orbi-energy.log b/shared/package-files/9b/9b3b4fe65b7e5b1ec4ef0d4cebeca66603b531f59aedd647bb31414cded36bc0/e74-unexplained-train-orbi-energy.log new file mode 100644 index 0000000000000000000000000000000000000000..5ae958dcf1e044bfbfc63b62e4131a81717b9394 --- /dev/null +++ b/shared/package-files/9b/9b3b4fe65b7e5b1ec4ef0d4cebeca66603b531f59aedd647bb31414cded36bc0/e74-unexplained-train-orbi-energy.log @@ -0,0 +1,10 @@ +== [M+H]+ Orbitrap energy=yes: 11720 spectra, with unexplained peaks 5719; unexplained share 0.064; of it +1.00335 above a stronger peak 0.067, control +1.0237 0.005 +unexplained - explained (Da: share of pair weight, explained-explained share of the same bin): + +1.004: 0.0049 (0.0001); +28.006: 0.0035 (0.0007); +0.006: 0.0034 (0.0001); +9.996: 0.0031 (0.0006); +0.008: 0.0030 (0.0001); +18.010: 0.0025 (0.0066); +0.010: 0.0025 (0.0003); +52.006: 0.0024 (0.0006); +0.004: 0.0023 (0.0000); +25.990: 0.0020 (0.0003); -0.006: 0.0019 (0.0002); +40.006: 0.0019 (0.0006); +28.998: 0.0019 (0.0000); +0.012: 0.0017 (0.0008); +13.990: 0.0017 (0.0003); +0.018: 0.0016 (0.0002); -0.004: 0.0014 (0.0000); +0.016: 0.0014 (0.0001); +37.990: 0.0013 (0.0002); +0.014: 0.0013 (0.0003); +54.022: 0.0013 (0.0009); -0.008: 0.0013 (0.0004); +1.990: 0.0011 (0.0002); +19.014: 0.0011 (0.0000) +precursor - unexplained (Da: share): + 52.982: 0.0028; 41.038: 0.0019; 45.002: 0.0018; 17.008: 0.0018; 43.988: 0.0016; 60.036: 0.0015; 46.008: 0.0014; 53.966: 0.0014; 31.014: 0.0013; 16.024: 0.0013; 253.112: 0.0011; 17.006: 0.0011; 111.094: 0.0011; 46.000: 0.0011; 17.974: 0.0011; 30.044: 0.0010; 18.008: 0.0010; 46.066: 0.0010; 1.012: 0.0010; 63.142: 0.0010; 45.996: 0.0009; 58.076: 0.0009; 180.068: 0.0009; 56.060: 0.0009 +== [M+Na]+ Orbitrap energy=yes: 1283 spectra, with unexplained peaks 1092; unexplained share 0.592; of it +1.00335 above a stronger peak 0.049, control +1.0237 0.002 +unexplained - explained (Da: share of pair weight, explained-explained share of the same bin): + -21.982: 0.0146 (0.0011); +1.004: 0.0068 (0.0021); -39.992: 0.0060 (0.0006); -18.010: 0.0022 (0.0288); -1.004: 0.0020 (0.0062); -23.998: 0.0017 (0.0002); +19.014: 0.0017 (0.0009); -17.008: 0.0017 (0.0005); -21.980: 0.0017 (0.0000); -2.006: 0.0014 (0.0010); -51.992: 0.0014 (0.0000); -58.004: 0.0014 (0.0003); -20.978: 0.0011 (0.0001); -53.972: 0.0011 (0.0000); -55.988: 0.0011 (0.0001); +18.010: 0.0010 (0.0309); -49.976: 0.0010 (0.0000); +14.054: 0.0010 (0.0000); -12.986: 0.0010 (0.0000); -27.992: 0.0009 (0.0001); -1.002: 0.0009 (0.0013); -44.026: 0.0008 (0.0039); -7.966: 0.0008 (0.0002); -35.998: 0.0008 (0.0001) +precursor - unexplained (Da: share): + 82.004: 0.0138; 137.082: 0.0064; 109.076: 0.0030; 224.102: 0.0026; 326.076: 0.0025; 69.024: 0.0024; 152.044: 0.0023; 142.024: 0.0023; 161.050: 0.0023; 216.040: 0.0022; 244.092: 0.0021; 166.096: 0.0021; 97.976: 0.0020; 250.030: 0.0020; 93.056: 0.0020; 332.018: 0.0019; 78.044: 0.0018; 82.002: 0.0017; 182.056: 0.0017; 59.986: 0.0017; 222.086: 0.0016; 354.072: 0.0016; 420.176: 0.0016; 109.998: 0.0015 diff --git a/shared/package-files/9b/9b716760cd7f94b79553f4b8c5a793f44fbca865fd1134ce8f41ae9d298bbcd4/fused-I9b+I13-idf050-weights.log b/shared/package-files/9b/9b716760cd7f94b79553f4b8c5a793f44fbca865fd1134ce8f41ae9d298bbcd4/fused-I9b+I13-idf050-weights.log new file mode 100644 index 0000000000000000000000000000000000000000..a28ca52afde15f3ad1d78be82b997af3021b3e9a --- /dev/null +++ b/shared/package-files/9b/9b716760cd7f94b79553f4b8c5a793f44fbca865fd1134ce8f41ae9d298bbcd4/fused-I9b+I13-idf050-weights.log @@ -0,0 +1,20 @@ +reference evals/score/I9b.pkl:pow070 all=0.7591 dom=0.9227 non=0.5947 h5=0.8761 h20=0.9364 | diff=+0.0000 [+0.0000,+0.0000] | ind 0.6158 +0.0000 [+0.0000,+0.0000] + pools +0 -0 | macro 0.8535 +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +w050 all=0.7602 dom=0.9248 non=0.5948 h5=0.8761 h20=0.9347 | diff=+0.0011 [-0.0066,+0.0092] | ind 0.6236 +0.0078 [+0.0047,+0.0107] + pools +28 -14 | macro 0.8576 +0.0041 [+0.0003,+0.0080] | without top 20 +0.0012 [-0.0076,+0.0101] | weight min(n,30) +0.0020 [-0.0062,+0.0106] +w075 all=0.7634 dom=0.9297 non=0.5964 h5=0.8754 h20=0.9348 | diff=+0.0043 [-0.0027,+0.0116] | ind 0.6296 +0.0137 [+0.0103,+0.0174] + pools +29 -16 | macro 0.8574 +0.0038 [+0.0000,+0.0077] | without top 20 +0.0049 [-0.0032,+0.0129] | weight min(n,30) +0.0057 [-0.0015,+0.0133] +w100 all=0.7630 dom=0.9285 non=0.5968 h5=0.8759 h20=0.9343 | diff=+0.0039 [-0.0036,+0.0117] | ind 0.6304 +0.0146 [+0.0106,+0.0185] + pools +34 -30 | macro 0.8547 +0.0012 [-0.0035,+0.0059] | without top 20 +0.0044 [-0.0043,+0.0127] | weight min(n,30) +0.0052 [-0.0024,+0.0131] +w125 all=0.7622 dom=0.9235 non=0.6002 h5=0.8741 h20=0.9337 | diff=+0.0031 [-0.0047,+0.0114] | ind 0.6294 +0.0135 [+0.0092,+0.0180] + pools +36 -46 | macro 0.8506 -0.0030 [-0.0083,+0.0021] | without top 20 +0.0035 [-0.0056,+0.0129] | weight min(n,30) +0.0036 [-0.0041,+0.0119] +n025 all=0.7554 dom=0.9300 non=0.5801 h5=0.8778 h20=0.9393 | diff=-0.0037 [-0.0125,+0.0038] | ind 0.6145 -0.0013 [-0.0051,+0.0024] + pools +27 -37 | macro 0.8506 -0.0030 [-0.0074,+0.0015] | without top 20 -0.0041 [-0.0140,+0.0045] | weight min(n,30) -0.0031 [-0.0120,+0.0050] +n075 all=0.7596 dom=0.9297 non=0.5889 h5=0.8718 h20=0.9284 | diff=+0.0006 [-0.0081,+0.0082] | ind 0.6417 +0.0259 [+0.0206,+0.0316] + pools +40 -29 | macro 0.8568 +0.0032 [-0.0018,+0.0080] | without top 20 +0.0006 [-0.0094,+0.0094] | weight min(n,30) +0.0015 [-0.0077,+0.0101] +n100 all=0.7616 dom=0.9303 non=0.5923 h5=0.8644 h20=0.9334 | diff=+0.0026 [-0.0071,+0.0130] | ind 0.6490 +0.0331 [+0.0262,+0.0408] + pools +51 -48 | macro 0.8544 +0.0009 [-0.0047,+0.0065] | without top 20 +0.0029 [-0.0082,+0.0142] | weight min(n,30) +0.0032 [-0.0071,+0.0134] +n150 all=0.7658 dom=0.9307 non=0.6003 h5=0.8658 h20=0.9277 | diff=+0.0067 [-0.0044,+0.0184] | ind 0.6598 +0.0440 [+0.0342,+0.0545] + pools +62 -64 | macro 0.8529 -0.0006 [-0.0071,+0.0059] | without top 20 +0.0076 [-0.0052,+0.0216] | weight min(n,30) +0.0065 [-0.0047,+0.0185] +w100n075 all=0.7613 dom=0.9291 non=0.5929 h5=0.8725 h20=0.9279 | diff=+0.0023 [-0.0073,+0.0117] | ind 0.6426 +0.0268 [+0.0210,+0.0328] + pools +46 -43 | macro 0.8544 +0.0009 [-0.0047,+0.0062] | without top 20 +0.0025 [-0.0080,+0.0132] | weight min(n,30) +0.0029 [-0.0069,+0.0127] diff --git a/shared/package-files/9b/9bc3bc46be90a06c620dcf75b1d00c0608928eed25dbc1ac585dbde6974f1eef/report-agg1.json b/shared/package-files/9b/9bc3bc46be90a06c620dcf75b1d00c0608928eed25dbc1ac585dbde6974f1eef/report-agg1.json new file mode 100644 index 0000000000000000000000000000000000000000..a5624457b18ce39de9c91eae4f9a6fa0d85f75dc --- /dev/null +++ b/shared/package-files/9b/9bc3bc46be90a06c620dcf75b1d00c0608928eed25dbc1ac585dbde6974f1eef/report-agg1.json @@ -0,0 +1,111 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.6033249266560297, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.241085895127166, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.6033249266560297, + "hit_rate_at_20": 0.8614957023006845, + "hit_rate_at_5": 0.7665860311904884 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.6965014974135584, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.31433396664555624, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.6043009643649115, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.10526315789473684, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.827054794520548, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.7664326738991704, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.6591666666666667, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.8333333333333334, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.39655172413793105, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6213991769547325, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.6066062412555508, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.5782747603833865, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.3991748323878288, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.8066570782823095, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.6033249266560297, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.5533814679620348, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.65048499682339 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/9e/9e0b719d5807841b210ce77573e810f6536b22e92d3b7987749bfd47a99aee5a/fused-I9a.log b/shared/package-files/9e/9e0b719d5807841b210ce77573e810f6536b22e92d3b7987749bfd47a99aee5a/fused-I9a.log new file mode 100644 index 0000000000000000000000000000000000000000..4e999f1eace1c989ef6d6da91c3c0ac35aca7eeb --- /dev/null +++ b/shared/package-files/9e/9e0b719d5807841b210ce77573e810f6536b22e92d3b7987749bfd47a99aee5a/fused-I9a.log @@ -0,0 +1,14 @@ +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 | diff=+0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] + pools +0 -0 | macro 0.8379 +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +rel all=0.7525 dom=0.9136 non=0.5907 h5=0.8728 h20=0.9292 | diff=+0.0044 [-0.0020,+0.0114] | ind 0.6053 +0.0041 [+0.0025,+0.0058] + pools +23 -11 | macro 0.8414 +0.0035 [+0.0003,+0.0071] | without top 20 +0.0049 [-0.0018,+0.0127] | weight min(n,30) +0.0046 [-0.0020,+0.0121] +I9a all=0.7582 dom=0.9240 non=0.5919 h5=0.8765 h20=0.9315 | diff=+0.0101 [+0.0010,+0.0196] | ind 0.6134 +0.0121 [+0.0086,+0.0159] + pools +77 -34 | macro 0.8506 +0.0127 [+0.0068,+0.0189] | without top 20 +0.0114 [+0.0011,+0.0218] | weight min(n,30) +0.0119 [+0.0028,+0.0214] +I8+I9a all=0.7575 dom=0.9210 non=0.5934 h5=0.8790 h20=0.9375 | diff=+0.0094 [+0.0004,+0.0186] | ind 0.6151 +0.0139 [+0.0103,+0.0178] + pools +72 -30 | macro 0.8503 +0.0124 [+0.0065,+0.0183] | without top 20 +0.0106 [+0.0010,+0.0203] | weight min(n,30) +0.0111 [+0.0023,+0.0199] +I9aw1 all=0.7563 dom=0.9200 non=0.5921 h5=0.8752 h20=0.9314 | diff=+0.0082 [-0.0014,+0.0180] | ind 0.6164 +0.0152 [+0.0115,+0.0193] + pools +78 -45 | macro 0.8476 +0.0097 [+0.0035,+0.0162] | without top 20 +0.0093 [-0.0013,+0.0202] | weight min(n,30) +0.0097 [-0.0001,+0.0199] +I8+I9aw1 all=0.7589 dom=0.9235 non=0.5936 h5=0.8768 h20=0.9370 | diff=+0.0108 [+0.0016,+0.0201] | ind 0.6176 +0.0164 [+0.0124,+0.0207] + pools +77 -35 | macro 0.8503 +0.0124 [+0.0065,+0.0186] | without top 20 +0.0121 [+0.0022,+0.0228] | weight min(n,30) +0.0126 [+0.0036,+0.0227] +I9a-p06 all=0.7575 dom=0.9231 non=0.5913 h5=0.8791 h20=0.9321 | diff=+0.0094 [-0.0000,+0.0191] | ind 0.6132 +0.0119 [+0.0082,+0.0159] + pools +77 -34 | macro 0.8506 +0.0127 [+0.0071,+0.0189] | without top 20 +0.0106 [+0.0006,+0.0211] | weight min(n,30) +0.0111 [+0.0017,+0.0208] diff --git a/shared/package-files/9e/9e10b1f76c5b019ef0aa0a89e94e35997db1f4885e29d2f27c72fb158118b4d9/consensus-determinism-5Ms-N5-L-ion-net-new.log b/shared/package-files/9e/9e10b1f76c5b019ef0aa0a89e94e35997db1f4885e29d2f27c72fb158118b4d9/consensus-determinism-5Ms-N5-L-ion-net-new.log new file mode 100644 index 0000000000000000000000000000000000000000..4ef9f12269bb3db914e260cb40d7546e6873b8a5 --- /dev/null +++ b/shared/package-files/9e/9e10b1f76c5b019ef0aa0a89e94e35997db1f4885e29d2f27c72fb158118b4d9/consensus-determinism-5Ms-N5-L-ion-net-new.log @@ -0,0 +1,8 @@ +module allcond/pkg/consensus.py +consensus {"scored": 19428, "pools": 3386, "answers": 33860, "search_seconds": 9.25485498807393, "seconds": 18.326321105007082} +consensus {"scored": 19428, "pools": 3386, "answers": 33860, "search_seconds": 9.23308725003153, "seconds": 17.990269158035517} +consensus {"scored": 19428, "pools": 3386, "answers": 33860, "search_seconds": 9.538643765030429, "seconds": 18.383631419972517} +run 1 against run 2: 0 of 19429 queries differ in some bit +run 1 against run 3: 0 of 19429 queries differ in some bit +against the term saved by the packaged run: 19428 queries, largest absolute difference 5.55e-16 +candidates with identical fingerprints in one pool: 201388 (spectrum, group) pairs; votes differ in some bit in 0 (0 spectra) diff --git a/shared/package-files/9e/9e5014961eeeb0be115e7eeb187b12c4dc57cf55ec532d180f53c191ca14cfe2/metrics.jsonl b/shared/package-files/9e/9e5014961eeeb0be115e7eeb187b12c4dc57cf55ec532d180f53c191ca14cfe2/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..bea7bc70e6a770e73b8afcb27fc14d9da665d13e --- /dev/null +++ b/shared/package-files/9e/9e5014961eeeb0be115e7eeb187b12c4dc57cf55ec532d180f53c191ca14cfe2/metrics.jsonl @@ -0,0 +1,401 @@ +{"step": 200, "loss": 0.3298077054694295, "loss_real": 0.3284922103770077, "loss_synth": 0.33013497428968547, "lr": 5.9999425457951604e-05, "elapsed": 18.2112080269726, "steps_per_second": 26.29104272860292} +{"step": 400, "loss": 0.04761186689138412, "loss_real": 0.04313275810331106, "loss_synth": 0.04872618233785033, "lr": 0.00011999538058286864, "elapsed": 25.227506496943533, "steps_per_second": 27.353322708360107} +{"step": 600, "loss": 0.04373157195746899, "loss_real": 0.037590486146509644, "loss_synth": 0.04525935469195247, "lr": 0.00017998438366332372, "elapsed": 32.04426673101261, "steps_per_second": 27.984797758743817} +{"step": 800, "loss": 0.04137183783575892, "loss_real": 0.03410899933427572, "loss_synth": 0.04317869085818529, "lr": 0.00023996295344516443, "elapsed": 38.919348150957376, "steps_per_second": 28.253282862148343} +{"step": 1000, "loss": 0.04003675527870655, "loss_real": 0.03249762903898954, "loss_synth": 0.04191234303638339, "lr": 0.0002999276093605773, "elapsed": 46.06558109202888, "steps_per_second": 28.19957564868449} +{"step": 1200, "loss": 0.03909805078059435, "loss_real": 0.03140675526112318, "loss_synth": 0.04101149544119835, "lr": 0.00035987487175711435, "elapsed": 53.04273968399502, "steps_per_second": 28.27608811710677} +{"step": 1400, "loss": 0.03819179568439722, "loss_real": 0.030347712533548475, "loss_synth": 0.04014325149357319, "lr": 0.0004198012621266681, "elapsed": 60.056222622981295, "steps_per_second": 28.31018451706642} +{"step": 1600, "loss": 0.03739639213308692, "loss_real": 0.029438963327556848, "loss_synth": 0.03937604535371065, "lr": 0.00047970330333438473, "elapsed": 67.02806412894279, "steps_per_second": 28.356722856244666} +{"step": 1800, "loss": 0.036709917578846216, "loss_real": 0.02868989210575819, "loss_synth": 0.03870514381676912, "lr": 0.0005395775198474994, "elapsed": 73.96044430800248, "steps_per_second": 28.41070977204216} +{"step": 2000, "loss": 0.036080994438380004, "loss_real": 0.028058172818273306, "loss_synth": 0.03807691616937518, "lr": 0.0005994204379640853, "elapsed": 80.87566978100222, "steps_per_second": 28.46099375426611} +{"step": 2200, "loss": 0.03536947699263692, "loss_real": 0.027379512917250395, "loss_synth": 0.03735722437500954, "lr": 0.0005992987145833635, "elapsed": 87.83934715099167, "steps_per_second": 28.48438749346759} +{"step": 2400, "loss": 0.03470889544114471, "loss_real": 0.026753226490691305, "loss_synth": 0.036688111070543525, "lr": 0.0005991654122715976, "elapsed": 94.92232042795513, "steps_per_second": 28.463583494588534} +{"step": 2600, "loss": 0.03406652741134167, "loss_real": 0.0258197283744812, "loss_synth": 0.036118170395493504, "lr": 0.0005990205362913348, "elapsed": 101.92134835396428, "steps_per_second": 28.472153449014264} +{"step": 2800, "loss": 0.03347402943298221, "loss_real": 0.025388941150158644, "loss_synth": 0.03548544166609645, "lr": 0.000598864092362031, "elapsed": 109.03383419092279, "steps_per_second": 28.446675511944445} +{"step": 3000, "loss": 0.032884612232446674, "loss_real": 0.024773223903030158, "loss_synth": 0.03490256741642952, "lr": 0.0005986960866598242, "elapsed": 115.99605634401087, "steps_per_second": 28.465158164498817} +{"step": 3200, "loss": 0.032440931275486945, "loss_real": 0.024412303352728485, "loss_synth": 0.03443829771131277, "lr": 0.000598516525817292, "elapsed": 123.09913133399095, "steps_per_second": 28.445689302898867} +{"step": 3400, "loss": 0.03200172942131758, "loss_real": 0.023845849484205248, "loss_synth": 0.03403075359761715, "lr": 0.0005983254169231893, "elapsed": 130.16817248100415, "steps_per_second": 28.436625138038497} +{"step": 3600, "loss": 0.031580281369388105, "loss_real": 0.023485768381506206, "loss_synth": 0.033594038374722, "lr": 0.0005981227675221674, "elapsed": 137.13636062201113, "steps_per_second": 28.451232046177658} +{"step": 3800, "loss": 0.03118239339441061, "loss_real": 0.022850448209792377, "loss_synth": 0.03325521916151047, "lr": 0.0005979085856144783, "elapsed": 144.07918118895032, "steps_per_second": 28.46972388870001} +{"step": 4000, "loss": 0.0308325379434973, "loss_real": 0.022574033718556166, "loss_synth": 0.032887093191966414, "lr": 0.0005976828796556566, "elapsed": 151.14368902798742, "steps_per_second": 28.46172196573304} +{"step": 4200, "loss": 0.03051111053675413, "loss_real": 0.022262974977493286, "loss_synth": 0.03256308604031801, "lr": 0.0005974456585561872, "elapsed": 158.10776158899534, "steps_per_second": 28.47386066070056} +{"step": 4400, "loss": 0.030131868217140437, "loss_real": 0.0218570161703974, "loss_synth": 0.03219049016945064, "lr": 0.0005971969316811528, "elapsed": 165.18218217394315, "steps_per_second": 28.464570445231043} +{"step": 4600, "loss": 0.029973815269768236, "loss_real": 0.021601929729804396, "loss_synth": 0.032056577187031504, "lr": 0.0005969367088498648, "elapsed": 172.16438995301723, "steps_per_second": 28.472335051135012} +{"step": 4800, "loss": 0.029628693191334605, "loss_real": 0.021237151864916086, "loss_synth": 0.031716344812884927, "lr": 0.0005966650003354748, "elapsed": 179.175573401968, "steps_per_second": 28.47456101670673} +{"step": 5000, "loss": 0.029297040468081834, "loss_real": 0.020894910432398318, "loss_synth": 0.031387326596304777, "lr": 0.0005963818168645697, "elapsed": 186.13883972901385, "steps_per_second": 28.48438272257321} +{"step": 5200, "loss": 0.028977648904547095, "loss_real": 0.020575545467436313, "loss_synth": 0.031067928439006208, "lr": 0.0005960871696167482, "elapsed": 194.3869318929501, "steps_per_second": 28.294257210833695} +{"step": 5400, "loss": 0.02885441539809108, "loss_real": 0.020489722918719054, "loss_synth": 0.03093538785353303, "lr": 0.0005957810702241789, "elapsed": 201.42550001095515, "steps_per_second": 28.298706089364934} +{"step": 5600, "loss": 0.028561315638944505, "loss_real": 0.01997272511944175, "loss_synth": 0.03069798951037228, "lr": 0.0005954635307711417, "elapsed": 208.52165474300273, "steps_per_second": 28.294603393131084} +{"step": 5800, "loss": 0.02839288585819304, "loss_real": 0.019932017996907234, "loss_synth": 0.030497784735634925, "lr": 0.0005951345637935509, "elapsed": 215.45537753391545, "steps_per_second": 28.313217205142994} +{"step": 6000, "loss": 0.028187031829729675, "loss_real": 0.01976845587603748, "loss_synth": 0.030281409453600645, "lr": 0.000594794182278459, "elapsed": 222.5198052949272, "steps_per_second": 28.313138499000573} +{"step": 6200, "loss": 0.028013876220211387, "loss_real": 0.019512242348864676, "loss_synth": 0.030128916800022124, "lr": 0.0005944423996635457, "elapsed": 229.43008493899833, "steps_per_second": 28.333009521052215} +{"step": 6400, "loss": 0.02771430114284158, "loss_real": 0.019276868160814045, "loss_synth": 0.02981336991302669, "lr": 0.0005940792298365861, "elapsed": 236.4963546579238, "steps_per_second": 28.332085686730707} +{"step": 6600, "loss": 0.027589106820523738, "loss_real": 0.019123895950615408, "loss_synth": 0.029695086274296047, "lr": 0.0005937046871349034, "elapsed": 243.36163782095537, "steps_per_second": 28.35568195102216} +{"step": 6800, "loss": 0.027389198457822204, "loss_real": 0.01869792653247714, "loss_synth": 0.029551417464390398, "lr": 0.0005933187863448017, "elapsed": 250.28429539699573, "steps_per_second": 28.371133051414585} +{"step": 7000, "loss": 0.027223581485450267, "loss_real": 0.018835422415286303, "loss_synth": 0.029310391973704098, "lr": 0.0005929215427009838, "elapsed": 257.27187996101566, "steps_per_second": 28.378245073791543} +{"step": 7200, "loss": 0.026987430294975637, "loss_real": 0.018240381460636855, "loss_synth": 0.029163525542244315, "lr": 0.0005925129718859484, "elapsed": 264.26868835894857, "steps_per_second": 28.383933123442496} +{"step": 7400, "loss": 0.026926467176526785, "loss_real": 0.018252045772969724, "loss_synth": 0.029084494234994054, "lr": 0.0005920930900293717, "elapsed": 271.1747660229448, "steps_per_second": 28.39920096966637} +{"step": 7600, "loss": 0.026771085215732456, "loss_real": 0.018092977367341518, "loss_synth": 0.02893002920784056, "lr": 0.0005916619137074705, "elapsed": 278.1767064129235, "steps_per_second": 28.40350069202665} +{"step": 7800, "loss": 0.026559368213638662, "loss_real": 0.017770685856230557, "loss_synth": 0.028745820997282862, "lr": 0.0005912194599423477, "elapsed": 285.28864354791585, "steps_per_second": 28.396205371455494} +{"step": 8000, "loss": 0.0264877101033926, "loss_real": 0.01767262725159526, "loss_synth": 0.028680731002241375, "lr": 0.0005907657462013203, "elapsed": 292.20335647801403, "steps_per_second": 28.40916134282072} +{"step": 8200, "loss": 0.02624779475852847, "loss_real": 0.017432734235189856, "loss_synth": 0.028440809957683087, "lr": 0.0005903007903962298, "elapsed": 299.05856404895894, "steps_per_second": 28.427359362162587} +{"step": 8400, "loss": 0.026176254963502288, "loss_real": 0.017420238321647047, "loss_synth": 0.02835458129644394, "lr": 0.0005898246108827355, "elapsed": 306.1804587349761, "steps_per_second": 28.419047942840265} +{"step": 8600, "loss": 0.02598117897287011, "loss_real": 0.01705805501434952, "loss_synth": 0.028201078148558736, "lr": 0.0005893372264595891, "elapsed": 313.2973295969423, "steps_per_second": 28.41159916722594} +{"step": 8800, "loss": 0.025865489607676862, "loss_real": 0.016967253927141428, "loss_synth": 0.028079196941107512, "lr": 0.0005888386563678933, "elapsed": 320.1661838769214, "steps_per_second": 28.42724987261231} +{"step": 9000, "loss": 0.025727502517402173, "loss_real": 0.0169408518075943, "loss_synth": 0.027913449928164483, "lr": 0.0005883289202903413, "elapsed": 327.284061932005, "steps_per_second": 28.419855349225507} +{"step": 9200, "loss": 0.025655279811471702, "loss_real": 0.016846159650012852, "loss_synth": 0.027846817253157498, "lr": 0.0005878080383504407, "elapsed": 334.3007354399888, "steps_per_second": 28.4216692506497} +{"step": 9400, "loss": 0.025511486250907184, "loss_real": 0.016595512041822077, "loss_synth": 0.02772960688918829, "lr": 0.0005872760311117187, "elapsed": 341.35116455494426, "steps_per_second": 28.42050532880942} +{"step": 9600, "loss": 0.02540095613338053, "loss_real": 0.016360870078206063, "loss_synth": 0.02764995344914496, "lr": 0.0005867329195769101, "elapsed": 348.25115763093345, "steps_per_second": 28.432052029012585} +{"step": 9800, "loss": 0.025335913049057125, "loss_real": 0.016383409244008364, "loss_synth": 0.02756312143057585, "lr": 0.0005861787251871285, "elapsed": 355.2067925839219, "steps_per_second": 28.438543632802755} +{"step": 10000, "loss": 0.025167770674452184, "loss_real": 0.01614371667150408, "loss_synth": 0.027412779573351146, "lr": 0.0005856134698210193, "elapsed": 362.252219381975, "steps_per_second": 28.437515113425945} +{"step": 10200, "loss": 0.025022333385422826, "loss_real": 0.016027853982523085, "loss_synth": 0.02725998468697071, "lr": 0.0005850371757938964, "elapsed": 407.76763140794355, "steps_per_second": 25.68211335426466} +{"step": 10400, "loss": 0.024890701919794082, "loss_real": 0.015788352778181435, "loss_synth": 0.027155189011245966, "lr": 0.0005844498658568614, "elapsed": 414.8729026069632, "steps_per_second": 25.725454857035448} +{"step": 10600, "loss": 0.024859246574342252, "loss_real": 0.015751887895166874, "loss_synth": 0.027124979998916388, "lr": 0.0005838515631959049, "elapsed": 422.0021757259965, "steps_per_second": 25.765795846684263} +{"step": 10800, "loss": 0.02483700062148273, "loss_real": 0.01573007579892874, "loss_synth": 0.02710262596607208, "lr": 0.0005832422914309915, "elapsed": 428.9796188629698, "steps_per_second": 25.814127122048596} +{"step": 11000, "loss": 0.024653254738077522, "loss_real": 0.015579258305951953, "loss_synth": 0.02691068818792701, "lr": 0.0005826220746151272, "elapsed": 436.06565377593506, "steps_per_second": 25.854272208543787} +{"step": 11200, "loss": 0.02443422797136009, "loss_real": 0.015388185074552894, "loss_synth": 0.026684707021340726, "lr": 0.00058199093723341, "elapsed": 443.1257481989451, "steps_per_second": 25.89465491845027} +{"step": 11400, "loss": 0.024487430714070797, "loss_real": 0.015263226353563369, "loss_synth": 0.02678223286755383, "lr": 0.000581348904202063, "elapsed": 450.01999227993656, "steps_per_second": 25.943528720519293} +{"step": 11600, "loss": 0.02436231658793986, "loss_real": 0.015102069908753037, "loss_synth": 0.02666608542203903, "lr": 0.000580696000867451, "elapsed": 457.1539872220019, "steps_per_second": 25.976938194468293} +{"step": 11800, "loss": 0.024282394405454398, "loss_real": 0.015030006431043148, "loss_synth": 0.02658420830965042, "lr": 0.0005800322530050796, "elapsed": 464.0955417819787, "steps_per_second": 26.020334083316232} +{"step": 12000, "loss": 0.024161640256643295, "loss_real": 0.014897714294493198, "loss_synth": 0.02646632419899106, "lr": 0.000579357686818578, "elapsed": 471.1654364350252, "steps_per_second": 26.055158930109833} +{"step": 12200, "loss": 0.024048419566825033, "loss_real": 0.014792186631821096, "loss_synth": 0.026351189883425833, "lr": 0.000578672328938664, "elapsed": 478.2694825580111, "steps_per_second": 26.08702561603872} +{"step": 12400, "loss": 0.023913899203762412, "loss_real": 0.014592915480025113, "loss_synth": 0.02623277817852795, "lr": 0.0005779762064220934, "elapsed": 485.28436534502544, "steps_per_second": 26.12284461617152} +{"step": 12600, "loss": 0.023964357441291214, "loss_real": 0.01470697726123035, "loss_synth": 0.026267413059249522, "lr": 0.0005772693467505911, "elapsed": 492.1832948270021, "steps_per_second": 26.163918516579777} +{"step": 12800, "loss": 0.023753618998453022, "loss_real": 0.014602753762155772, "loss_synth": 0.02603017578832805, "lr": 0.0005765517778297665, "elapsed": 499.3782293519471, "steps_per_second": 26.187962993749117} +{"step": 13000, "loss": 0.023702825708314775, "loss_real": 0.014319534148089588, "loss_synth": 0.026037205690518022, "lr": 0.0005758235279880121, "elapsed": 506.4961634440115, "steps_per_second": 26.215379856593493} +{"step": 13200, "loss": 0.02365064714103937, "loss_real": 0.014314932287670673, "loss_synth": 0.0259731908980757, "lr": 0.0005750846259753846, "elapsed": 513.5602689859224, "steps_per_second": 26.244829317704173} +{"step": 13400, "loss": 0.023570104679092766, "loss_real": 0.014339717263355851, "loss_synth": 0.025866444893181323, "lr": 0.0005743351009624703, "elapsed": 521.0479200530099, "steps_per_second": 26.251662340972175} +{"step": 13600, "loss": 0.02353799855336547, "loss_real": 0.014235921846702694, "loss_synth": 0.025852174023166297, "lr": 0.0005735749825392333, "elapsed": 528.3712400819641, "steps_per_second": 26.266631765241677} +{"step": 13800, "loss": 0.023436321718618272, "loss_real": 0.01397610729560256, "loss_synth": 0.025789838740602134, "lr": 0.0005728043007138474, "elapsed": 535.9711535900133, "steps_per_second": 26.26734720726924} +{"step": 14000, "loss": 0.02340768836438656, "loss_real": 0.013873480018228293, "loss_synth": 0.025779613675549626, "lr": 0.0005720230859115115, "elapsed": 543.5458288539667, "steps_per_second": 26.269286209233137} +{"step": 14200, "loss": 0.023262465642765164, "loss_real": 0.013775655715726316, "loss_synth": 0.02562259922735393, "lr": 0.0005712313689732482, "elapsed": 550.8061949650291, "steps_per_second": 26.286456381592018} +{"step": 14400, "loss": 0.023203393248841166, "loss_real": 0.01372439922299236, "loss_synth": 0.02556158196181059, "lr": 0.0005704291811546867, "elapsed": 558.1979891419178, "steps_per_second": 26.296858113657002} +{"step": 14600, "loss": 0.023069931603968145, "loss_real": 0.013473759568296374, "loss_synth": 0.025457271952182055, "lr": 0.0005696165541248286, "elapsed": 565.6925683299778, "steps_per_second": 26.302111536180835} +{"step": 14800, "loss": 0.02301201831549406, "loss_real": 0.013473064326681196, "loss_synth": 0.025385124208405614, "lr": 0.0005687935199647974, "elapsed": 573.23663170496, "steps_per_second": 26.30491123811798} +{"step": 15000, "loss": 0.022935610227286816, "loss_real": 0.013499589092098176, "loss_synth": 0.025283108558505775, "lr": 0.0005679601111665725, "elapsed": 580.5557182289194, "steps_per_second": 26.318021260584807} +{"step": 15200, "loss": 0.022921753069385885, "loss_real": 0.013405736186541617, "loss_synth": 0.025289152264595032, "lr": 0.0005671163606317065, "elapsed": 589.1838757839287, "steps_per_second": 26.2712238551428} +{"step": 15400, "loss": 0.022920178258791567, "loss_real": 0.013388615790754557, "loss_synth": 0.025291445096954704, "lr": 0.0005662623016700254, "elapsed": 596.6932518789545, "steps_per_second": 26.275863934633335} +{"step": 15600, "loss": 0.022798987729474904, "loss_real": 0.013269213591702283, "loss_synth": 0.025169809926301242, "lr": 0.0005653979679983149, "elapsed": 604.2813141170191, "steps_per_second": 26.276903402655876} +{"step": 15800, "loss": 0.022736388733610512, "loss_real": 0.013146413322538138, "loss_synth": 0.025122187687084078, "lr": 0.0005645233937389882, "elapsed": 611.6330954319565, "steps_per_second": 26.28824720143267} +{"step": 16000, "loss": 0.022685765214264395, "loss_real": 0.013151664026081563, "loss_synth": 0.025057663740590215, "lr": 0.0005636386134187397, "elapsed": 619.1050553739769, "steps_per_second": 26.29412273882689} +{"step": 16200, "loss": 0.022561443876475094, "loss_real": 0.013031496061012149, "loss_synth": 0.024932309128344057, "lr": 0.0005627436619671814, "elapsed": 626.4615107069258, "steps_per_second": 26.304788291021783} +{"step": 16400, "loss": 0.022504682205617427, "loss_real": 0.01286518304143101, "loss_synth": 0.024902801681309938, "lr": 0.0005618385747154643, "elapsed": 633.9298584050266, "steps_per_second": 26.310478245915967} +{"step": 16600, "loss": 0.02247170267626643, "loss_real": 0.01279772684443742, "loss_synth": 0.024878399353474377, "lr": 0.0005609233873948831, "elapsed": 641.3589762939373, "steps_per_second": 26.31767018963373} +{"step": 16800, "loss": 0.02244098413735628, "loss_real": 0.012800421291030943, "loss_synth": 0.02483936807140708, "lr": 0.0005599981361354663, "elapsed": 648.9121406519553, "steps_per_second": 26.319578848857564} +{"step": 17000, "loss": 0.022369663557037713, "loss_real": 0.012714268309064209, "loss_synth": 0.024771737717092037, "lr": 0.0005590628574645494, "elapsed": 656.3497540269746, "steps_per_second": 26.32615287485466} +{"step": 17200, "loss": 0.022351194750517608, "loss_real": 0.012662933762185276, "loss_synth": 0.02476144506596029, "lr": 0.0005581175883053327, "elapsed": 663.8256568559445, "steps_per_second": 26.331033666979103} +{"step": 17400, "loss": 0.022302791457623244, "loss_real": 0.012582412022165954, "loss_synth": 0.024721032259985804, "lr": 0.0005571623659754243, "elapsed": 671.3936184439808, "steps_per_second": 26.33213499821573} +{"step": 17600, "loss": 0.022175006670877337, "loss_real": 0.012441315758042037, "loss_synth": 0.024596559181809426, "lr": 0.000556197228185366, "elapsed": 678.8224220699631, "steps_per_second": 26.33869533926485} +{"step": 17800, "loss": 0.022173167606815695, "loss_real": 0.012428387016989291, "loss_synth": 0.024597479160875083, "lr": 0.0005552222130371452, "elapsed": 686.4354365710169, "steps_per_second": 26.337930547828417} +{"step": 18000, "loss": 0.022108224369585514, "loss_real": 0.012474183426238596, "loss_synth": 0.024504986042156816, "lr": 0.0005542373590226904, "elapsed": 693.892187892925, "steps_per_second": 26.343205924847517} +{"step": 18200, "loss": 0.022004623766988515, "loss_real": 0.01236893180757761, "loss_synth": 0.024401795994490386, "lr": 0.000553242705022352, "elapsed": 701.4186028499389, "steps_per_second": 26.345710360557128} +{"step": 18400, "loss": 0.02203942614607513, "loss_real": 0.012277674665674566, "loss_synth": 0.024467959757894276, "lr": 0.0005522382903033667, "elapsed": 708.8541719429195, "steps_per_second": 26.351588840158268} +{"step": 18600, "loss": 0.02195840932428837, "loss_real": 0.012289068140089511, "loss_synth": 0.024363952931016685, "lr": 0.0005512241545183076, "elapsed": 716.4651308850152, "steps_per_second": 26.35079426486675} +{"step": 18800, "loss": 0.021927151065319776, "loss_real": 0.0120717742620036, "loss_synth": 0.02437897652387619, "lr": 0.0005502003377035189, "elapsed": 723.9073098659283, "steps_per_second": 26.356251513160647} +{"step": 19000, "loss": 0.021838697809726, "loss_real": 0.012212201985530555, "loss_synth": 0.024233582336455582, "lr": 0.0005491668802775358, "elapsed": 731.3786221209448, "steps_per_second": 26.360530541112215} +{"step": 19200, "loss": 0.021779202334582807, "loss_real": 0.011983032305724919, "loss_synth": 0.02421629836782813, "lr": 0.0005481238230394878, "elapsed": 738.8286257409491, "steps_per_second": 26.365493230840528} +{"step": 19400, "loss": 0.021774545069783924, "loss_real": 0.01192240631673485, "loss_synth": 0.024225565325468778, "lr": 0.0005470712071674886, "elapsed": 746.2786355179269, "steps_per_second": 26.370355186875276} +{"step": 19600, "loss": 0.02164201078005135, "loss_real": 0.011745192329399287, "loss_synth": 0.024104146221652627, "lr": 0.0005460090742170103, "elapsed": 753.7558479210129, "steps_per_second": 26.374154212036686} +{"step": 19800, "loss": 0.021697127893567085, "loss_real": 0.011914624804630876, "loss_synth": 0.024130823863670228, "lr": 0.0005449374661192434, "elapsed": 761.33457734494, "steps_per_second": 26.37431062224158} +{"step": 20000, "loss": 0.02159943058155477, "loss_real": 0.011799005349166692, "loss_synth": 0.02403758526779711, "lr": 0.0005438564251794405, "elapsed": 768.8410693649203, "steps_per_second": 26.37697660732476} +{"step": 20200, "loss": 0.021533086374402047, "loss_real": 0.011718313042074442, "loss_synth": 0.023974810587242247, "lr": 0.000542765994075247, "elapsed": 818.919046910014, "steps_per_second": 24.99025774818457} +{"step": 20400, "loss": 0.021530688609927892, "loss_real": 0.011622665282338858, "loss_synth": 0.02399561152793467, "lr": 0.0005416662158550157, "elapsed": 829.7310351079796, "steps_per_second": 24.904563622260625} +{"step": 20600, "loss": 0.021451882664114238, "loss_real": 0.011638301657512784, "loss_synth": 0.02389331016689539, "lr": 0.0005405571339361076, "elapsed": 840.0614297259599, "steps_per_second": 24.83551369714902} +{"step": 20800, "loss": 0.021382803563028574, "loss_real": 0.011481818123720587, "loss_synth": 0.023845975641161202, "lr": 0.0005394387921031779, "elapsed": 849.4329146189848, "steps_per_second": 24.79647636389881} +{"step": 21000, "loss": 0.021295281741768122, "loss_real": 0.011275399345904588, "loss_synth": 0.023788033071905374, "lr": 0.0005383112345064472, "elapsed": 858.4088678259868, "steps_per_second": 24.76985229793965} +{"step": 21200, "loss": 0.02127221966162324, "loss_real": 0.011372376699000597, "loss_synth": 0.02373510742560029, "lr": 0.0005371745056599587, "elapsed": 867.0166121060029, "steps_per_second": 24.75442450529962} +{"step": 21400, "loss": 0.02127111593261361, "loss_real": 0.011398376091383397, "loss_synth": 0.0237272609770298, "lr": 0.000536028650439821, "elapsed": 875.7446027679835, "steps_per_second": 24.735865225780223} +{"step": 21600, "loss": 0.02123144651763141, "loss_real": 0.011220829710364342, "loss_synth": 0.023721892628818752, "lr": 0.000534873714082436, "elapsed": 884.1831887769513, "steps_per_second": 24.72586529987794} +{"step": 21800, "loss": 0.0212356136739254, "loss_real": 0.011193932173773647, "loss_synth": 0.023733788253739476, "lr": 0.0005337097421827136, "elapsed": 892.0819279529387, "steps_per_second": 24.731193667131055} +{"step": 22000, "loss": 0.021165598947554827, "loss_real": 0.011209683576598763, "loss_synth": 0.023642436526715757, "lr": 0.0005325367806922714, "elapsed": 899.5905102589168, "steps_per_second": 24.74728367267224} +{"step": 22200, "loss": 0.021093838177621366, "loss_real": 0.011177727216854692, "loss_synth": 0.023560773292556406, "lr": 0.0005313548759176205, "elapsed": 907.2301499639871, "steps_per_second": 24.75948460135149} +{"step": 22400, "loss": 0.02105830268934369, "loss_real": 0.011023544715717435, "loss_synth": 0.023554754834622146, "lr": 0.0005301640745183378, "elapsed": 914.7550054029562, "steps_per_second": 24.77462417166205} +{"step": 22600, "loss": 0.020971395447850226, "loss_real": 0.011064433036372065, "loss_synth": 0.02343605457805097, "lr": 0.0005289644235052233, "elapsed": 922.2552764660213, "steps_per_second": 24.790182318907128} +{"step": 22800, "loss": 0.020950290188193322, "loss_real": 0.010853321626782417, "loss_synth": 0.023462219033390283, "lr": 0.0005277559702384452, "elapsed": 929.7441621309845, "steps_per_second": 24.805793820648802} +{"step": 23000, "loss": 0.02096924539655447, "loss_real": 0.010945897595956922, "loss_synth": 0.02346285868436098, "lr": 0.0005265387624256692, "elapsed": 937.3690768959932, "steps_per_second": 24.817509775820596} +{"step": 23200, "loss": 0.02089054437354207, "loss_real": 0.010857473183423281, "loss_synth": 0.02338657676242292, "lr": 0.0005253128481201754, "elapsed": 944.8665583679685, "steps_per_second": 24.832421195277114} +{"step": 23400, "loss": 0.020846565952524543, "loss_real": 0.01073716522194445, "loss_synth": 0.023361587719991802, "lr": 0.0005240782757189615, "elapsed": 953.3742113349726, "steps_per_second": 24.820471706494725} +{"step": 23600, "loss": 0.02078541805036366, "loss_real": 0.010667941544670611, "loss_synth": 0.02330244886688888, "lr": 0.0005228350939608321, "elapsed": 963.8959857949521, "steps_per_second": 24.756319890318235} +{"step": 23800, "loss": 0.020782346623018384, "loss_real": 0.01068292125593871, "loss_synth": 0.023294886853545905, "lr": 0.0005215833519244743, "elapsed": 974.4059992309194, "steps_per_second": 24.693870076781955} +{"step": 24000, "loss": 0.020713088791817425, "loss_real": 0.010659967786632479, "loss_synth": 0.023214109279215335, "lr": 0.0005203230990265203, "elapsed": 983.8000095050083, "steps_per_second": 24.661014957095883} +{"step": 24200, "loss": 0.020629239324480294, "loss_real": 0.010638561306986958, "loss_synth": 0.023114725304767488, "lr": 0.0005190543850195967, "elapsed": 992.5834202719852, "steps_per_second": 24.64410235575921} +{"step": 24400, "loss": 0.020635154778137803, "loss_real": 0.010539262127131223, "loss_synth": 0.023146815979853273, "lr": 0.00051777725999036, "elapsed": 1001.3131024029572, "steps_per_second": 24.628825237978326} +{"step": 24600, "loss": 0.020635899044573306, "loss_real": 0.010623059442732483, "loss_synth": 0.023126898417249322, "lr": 0.0005164917743575197, "elapsed": 1009.8077192479977, "steps_per_second": 24.619605462551913} +{"step": 24800, "loss": 0.020549066159874202, "loss_real": 0.010471623414196074, "loss_synth": 0.02305613755248487, "lr": 0.0005151979788698475, "elapsed": 1018.5002454969799, "steps_per_second": 24.605708627521633} +{"step": 25000, "loss": 0.020505186868831515, "loss_real": 0.010493155606091022, "loss_synth": 0.022995984936133026, "lr": 0.0005138959246041736, "elapsed": 1026.3958938820288, "steps_per_second": 24.611341648588706} +{"step": 25200, "loss": 0.020453086541965603, "loss_real": 0.010355996997095645, "loss_synth": 0.022965045478194952, "lr": 0.0005125856629633713, "elapsed": 1035.1941016949713, "steps_per_second": 24.59520280412071} +{"step": 25400, "loss": 0.02044624550268054, "loss_real": 0.010422243266366421, "loss_synth": 0.02294002181850374, "lr": 0.0005112672456743265, "elapsed": 1042.767970217974, "steps_per_second": 24.608494460703483} +{"step": 25600, "loss": 0.020390024799853565, "loss_real": 0.01031493983231485, "loss_synth": 0.022896509310230614, "lr": 0.0005099407247858964, "elapsed": 1050.051883589942, "steps_per_second": 24.628460694507094} +{"step": 25800, "loss": 0.02045453744009137, "loss_real": 0.010381924584507943, "loss_synth": 0.02296040720306337, "lr": 0.0005086061526668541, "elapsed": 1057.6590110909892, "steps_per_second": 24.64054044167428} +{"step": 26000, "loss": 0.020310028400272132, "loss_real": 0.010211816718801857, "loss_synth": 0.022822266574949027, "lr": 0.0005072635820038217, "elapsed": 1065.205954473, "steps_per_second": 24.653852798222925} +{"step": 26200, "loss": 0.020331061128526926, "loss_real": 0.010432651732116938, "loss_synth": 0.022793592438101768, "lr": 0.0005059130657991904, "elapsed": 1072.8322136630304, "steps_per_second": 24.665134111494694} +{"step": 26400, "loss": 0.020354140643030406, "loss_real": 0.010222197389230131, "loss_synth": 0.022874770490452646, "lr": 0.0005045546573690274, "elapsed": 1080.2570475030225, "steps_per_second": 24.680901353250686} +{"step": 26600, "loss": 0.020267820321023464, "loss_real": 0.01017097087111324, "loss_synth": 0.02277971957810223, "lr": 0.0005031884103409714, "elapsed": 1087.8133306569653, "steps_per_second": 24.69343756349982} +{"step": 26800, "loss": 0.020202448386698962, "loss_real": 0.010099800161551684, "loss_synth": 0.02271579038351774, "lr": 0.0005018143786521158, "elapsed": 1095.276797208935, "steps_per_second": 24.707913223970944} +{"step": 27000, "loss": 0.02016373519785702, "loss_real": 0.009998506542760879, "loss_synth": 0.02269264585338533, "lr": 0.0005004326165468789, "elapsed": 1102.8327632229775, "steps_per_second": 24.720097344960845} +{"step": 27200, "loss": 0.020118440771475433, "loss_real": 0.010021469127386808, "loss_synth": 0.02263037028722465, "lr": 0.0004990431785748627, "elapsed": 1110.3942772229202, "steps_per_second": 24.731989282995197} +{"step": 27400, "loss": 0.02015648990869522, "loss_real": 0.00995298962108791, "loss_synth": 0.022694921661168335, "lr": 0.0004976461195886993, "elapsed": 1117.9301001209533, "steps_per_second": 24.74429289518576} +{"step": 27600, "loss": 0.020073706014081837, "loss_real": 0.0099261892773211, "loss_synth": 0.02259821035899222, "lr": 0.0004962414947418852, "elapsed": 1125.3287820289843, "steps_per_second": 24.759475879058357} +{"step": 27800, "loss": 0.020045369863510132, "loss_real": 0.009966364386491478, "loss_synth": 0.022552829952910542, "lr": 0.0004948293594866042, "elapsed": 1133.0512603949755, "steps_per_second": 24.767311867246914} +{"step": 28000, "loss": 0.020056332731619476, "loss_real": 0.009917877621483058, "loss_synth": 0.022578582698479295, "lr": 0.0004934097695715384, "elapsed": 1140.6811886319192, "steps_per_second": 24.77706977442606} +{"step": 28200, "loss": 0.019954574201256035, "loss_real": 0.009860228556208312, "loss_synth": 0.02246585047803819, "lr": 0.0004919827810396669, "elapsed": 1148.24860244093, "steps_per_second": 24.788058846331946} +{"step": 28400, "loss": 0.019917617086321115, "loss_real": 0.00978257081238553, "loss_synth": 0.02243901905603707, "lr": 0.0004905484502260535, "elapsed": 1155.8755367309786, "steps_per_second": 24.79761387867971} +{"step": 28600, "loss": 0.01991084502078593, "loss_real": 0.009666246890556068, "loss_synth": 0.022459501242265104, "lr": 0.0004891068337556227, "elapsed": 1163.416652360931, "steps_per_second": 24.80888919542548} +{"step": 28800, "loss": 0.01984110215678811, "loss_real": 0.009656140441074967, "loss_synth": 0.02237492226064205, "lr": 0.0004876579885409243, "elapsed": 1171.1239721879829, "steps_per_second": 24.816463348561886} +{"step": 29000, "loss": 0.019809999475255607, "loss_real": 0.009519247799180447, "loss_synth": 0.022370137749239804, "lr": 0.00048620197177988667, "elapsed": 1178.599573949934, "steps_per_second": 24.828862371373866} +{"step": 29200, "loss": 0.019838885059580206, "loss_real": 0.009631519443355501, "loss_synth": 0.022378278682008385, "lr": 0.00048473884095355833, "elapsed": 1186.331558224978, "steps_per_second": 24.835686764695964} +{"step": 29400, "loss": 0.01976892612874508, "loss_real": 0.009587506046518684, "loss_synth": 0.022301865015178918, "lr": 0.00048326865382383906, "elapsed": 1193.7666654249188, "steps_per_second": 24.848655401871152} +{"step": 29600, "loss": 0.01976053395308554, "loss_real": 0.009556369630154223, "loss_synth": 0.022299131201580166, "lr": 0.00048179146843119934, "elapsed": 1200.8306649849983, "steps_per_second": 24.869213760993105} +{"step": 29800, "loss": 0.0196909168548882, "loss_real": 0.009442900530993939, "loss_synth": 0.02224042355082929, "lr": 0.0004803073430923892, "elapsed": 1208.0319198049838, "steps_per_second": 24.88667657280436} +{"step": 30000, "loss": 0.019701759871095417, "loss_real": 0.009473595866002143, "loss_synth": 0.022246327502653002, "lr": 0.0004788163363981358, "elapsed": 1215.0871008979157, "steps_per_second": 24.906950821624847} +{"step": 30200, "loss": 0.019653884144499898, "loss_real": 0.009532308732159435, "loss_synth": 0.022171934731304646, "lr": 0.0004773185072108303, "elapsed": 1273.5965730620082, "steps_per_second": 23.91146389126486} +{"step": 30400, "loss": 0.01960526715964079, "loss_real": 0.009461595052853227, "loss_synth": 0.022128815092146398, "lr": 0.0004758139146622044, "elapsed": 1281.4140014559962, "steps_per_second": 23.92175169531141} +{"step": 30600, "loss": 0.01953823401592672, "loss_real": 0.009454821618273854, "loss_synth": 0.022046790271997452, "lr": 0.0004743026181509957, "elapsed": 1289.255548557965, "steps_per_second": 23.931462283323373} +{"step": 30800, "loss": 0.019495338564738632, "loss_real": 0.009307470403146, "loss_synth": 0.02202988149598241, "lr": 0.00047278467734060257, "elapsed": 1297.0237815539585, "steps_per_second": 23.942418913495054} +{"step": 31000, "loss": 0.019535280670970677, "loss_real": 0.009373596315272152, "loss_synth": 0.02206330948509276, "lr": 0.0004712601521567291, "elapsed": 1304.9529451639391, "steps_per_second": 23.95026582605767} +{"step": 31200, "loss": 0.019506871541962026, "loss_real": 0.009221267437096685, "loss_synth": 0.02206572930328548, "lr": 0.00046972910278501927, "elapsed": 1312.734804366948, "steps_per_second": 23.960727450270667} +{"step": 31400, "loss": 0.019518876001238823, "loss_real": 0.009224919048137962, "loss_synth": 0.022079811627045275, "lr": 0.0004681915896686806, "elapsed": 1320.5472523299977, "steps_per_second": 23.97050502215711} +{"step": 31600, "loss": 0.0194653788395226, "loss_real": 0.009115726258605718, "loss_synth": 0.02204017068259418, "lr": 0.0004666476735060982, "elapsed": 1328.326252743951, "steps_per_second": 23.980775344383446} +{"step": 31800, "loss": 0.01941441888920963, "loss_real": 0.009187988475896419, "loss_synth": 0.021958555337041618, "lr": 0.00046509741524843875, "elapsed": 1336.2965967039345, "steps_per_second": 23.987462394947272} +{"step": 32000, "loss": 0.019411115674301982, "loss_real": 0.009136707177385689, "loss_synth": 0.021967188017442824, "lr": 0.0004635408760972437, "elapsed": 1344.034569284995, "steps_per_second": 23.9982508632478} +{"step": 32200, "loss": 0.01937977407127619, "loss_real": 0.009016205782536417, "loss_synth": 0.02195802769623697, "lr": 0.0004619781175020134, "elapsed": 1351.793310813955, "steps_per_second": 24.008543053385353} +{"step": 32400, "loss": 0.019262342704460023, "loss_real": 0.00897087725577876, "loss_synth": 0.02182265864685178, "lr": 0.0004604092011577816, "elapsed": 1359.581044683, "steps_per_second": 24.018200635744687} +{"step": 32600, "loss": 0.019320412101224066, "loss_real": 0.009047972327098251, "loss_synth": 0.021875994857400657, "lr": 0.00045883418900267894, "elapsed": 1367.2896784630138, "steps_per_second": 24.029148261656985} +{"step": 32800, "loss": 0.019214190263301133, "loss_real": 0.008939192574471235, "loss_synth": 0.021770409252494575, "lr": 0.00045725314321548853, "elapsed": 1375.1269872540142, "steps_per_second": 24.037705203274985} +{"step": 33000, "loss": 0.019246752141043544, "loss_real": 0.008938104477711022, "loss_synth": 0.021811342695727945, "lr": 0.00045566612621319075, "elapsed": 1383.049579625018, "steps_per_second": 24.04467018662803} +{"step": 33200, "loss": 0.019216239219531417, "loss_real": 0.008963830161374062, "loss_synth": 0.021766838608309625, "lr": 0.00045407320064849954, "elapsed": 1390.7160208179848, "steps_per_second": 24.056019231828913} +{"step": 33400, "loss": 0.019168858686462044, "loss_real": 0.008977123291697354, "loss_synth": 0.02170436372049153, "lr": 0.00045247442940738873, "elapsed": 1398.6123496160144, "steps_per_second": 24.063256769335876} +{"step": 33600, "loss": 0.019194468520581723, "loss_real": 0.008858899786137044, "loss_synth": 0.021765756215900184, "lr": 0.00045086987560660925, "elapsed": 1406.5176156689413, "steps_per_second": 24.07025831484007} +{"step": 33800, "loss": 0.019158172747120263, "loss_real": 0.008880005548708141, "loss_synth": 0.02171518017537892, "lr": 0.00044925960259119784, "elapsed": 1414.171963642002, "steps_per_second": 24.08148532240949} +{"step": 34000, "loss": 0.019205659404397012, "loss_real": 0.008925760816782712, "loss_synth": 0.021763097839429976, "lr": 0.0004476436739319758, "elapsed": 1421.9323291960172, "steps_per_second": 24.09078072922011} +{"step": 34200, "loss": 0.019129411643370987, "loss_real": 0.008770131610799582, "loss_synth": 0.02170659844763577, "lr": 0.00044602215342303975, "elapsed": 1429.6560143189272, "steps_per_second": 24.100597420409386} +{"step": 34400, "loss": 0.01905694683082402, "loss_real": 0.008727105108555407, "loss_synth": 0.02162681001238525, "lr": 0.00044439510507924293, "elapsed": 1437.3176256739534, "steps_per_second": 24.11135682602476} +{"step": 34600, "loss": 0.019057056652382016, "loss_real": 0.008735198313370347, "loss_synth": 0.021624933648854493, "lr": 0.00044276259313366786, "elapsed": 1445.0864226759877, "steps_per_second": 24.120198874293454} +{"step": 34800, "loss": 0.019039496751502155, "loss_real": 0.008771484985481947, "loss_synth": 0.02159397792071104, "lr": 0.0004411246820350911, "elapsed": 1452.1566218869993, "steps_per_second": 24.140638912551637} +{"step": 35000, "loss": 0.018968427777290343, "loss_real": 0.008632902917452157, "loss_synth": 0.021539704790338874, "lr": 0.000439481436445438, "elapsed": 1459.3267840589397, "steps_per_second": 24.15921231071704} +{"step": 35200, "loss": 0.018976522274315358, "loss_real": 0.008628228707239031, "loss_synth": 0.02155097611248493, "lr": 0.0004378329212372309, "elapsed": 1467.751567679923, "steps_per_second": 24.156785558122024} +{"step": 35400, "loss": 0.018995338464155794, "loss_real": 0.008675726533401757, "loss_synth": 0.02156265658326447, "lr": 0.0004361792014910274, "elapsed": 1474.924957575975, "steps_per_second": 24.175028798892562} +{"step": 35600, "loss": 0.018890964360907675, "loss_real": 0.008623990600463004, "loss_synth": 0.021445187134668232, "lr": 0.00043452034249285166, "elapsed": 1481.9540982890176, "steps_per_second": 24.19546602904394} +{"step": 35800, "loss": 0.01889277563430369, "loss_real": 0.008566020459402352, "loss_synth": 0.021461870847269894, "lr": 0.00043285640973161633, "elapsed": 1489.1337445479585, "steps_per_second": 24.213243901799938} +{"step": 36000, "loss": 0.01890226296149194, "loss_real": 0.008607914275489747, "loss_synth": 0.021463296245783567, "lr": 0.00043118746889653773, "elapsed": 1496.18964558898, "steps_per_second": 24.23286831745897} +{"step": 36200, "loss": 0.01889948982745409, "loss_real": 0.008617537401150913, "loss_synth": 0.021457439083606006, "lr": 0.0004295135858745423, "elapsed": 1503.4056297229836, "steps_per_second": 24.249706459886024} +{"step": 36400, "loss": 0.018838362880051137, "loss_real": 0.008520840313285588, "loss_synth": 0.02140516120940447, "lr": 0.0004278348267476658, "elapsed": 1510.6295983089367, "steps_per_second": 24.266253432899063} +{"step": 36600, "loss": 0.01879291869699955, "loss_real": 0.008486909281928093, "loss_synth": 0.021356852762401103, "lr": 0.00042615125779044393, "elapsed": 1517.7381385220215, "steps_per_second": 24.284501552110616} +{"step": 36800, "loss": 0.018694994170218707, "loss_real": 0.008450782326981425, "loss_synth": 0.02124355424195528, "lr": 0.0004244629454672963, "elapsed": 1524.9187725220108, "steps_per_second": 24.301421339193645} +{"step": 37000, "loss": 0.018715743273496628, "loss_real": 0.008457176217343659, "loss_synth": 0.02126787493005395, "lr": 0.00042276995642990276, "elapsed": 1531.9819950839737, "steps_per_second": 24.320058162814075} +{"step": 37200, "loss": 0.018766019055619837, "loss_real": 0.008363584252074362, "loss_synth": 0.02135394185781479, "lr": 0.00042107235751457153, "elapsed": 1538.9915601529647, "steps_per_second": 24.339377197089213} +{"step": 37400, "loss": 0.01872227421030402, "loss_real": 0.008322863429784775, "loss_synth": 0.021309444811195136, "lr": 0.0004193702157396011, "elapsed": 1546.1539444199298, "steps_per_second": 24.356095655623715} +{"step": 37600, "loss": 0.018669976480305196, "loss_real": 0.008306883180048318, "loss_synth": 0.021248112078756095, "lr": 0.00041766359830263414, "elapsed": 1553.2425702830078, "steps_per_second": 24.373824209901496} +{"step": 37800, "loss": 0.018584102364256977, "loss_real": 0.008302277042530478, "loss_synth": 0.021142019918188454, "lr": 0.0004159525725780049, "elapsed": 1560.5541232939577, "steps_per_second": 24.387882399346662} +{"step": 38000, "loss": 0.018622377328574656, "loss_real": 0.008250518231652676, "loss_synth": 0.02120269348844886, "lr": 0.00041423720611407917, "elapsed": 1567.3700737969484, "steps_per_second": 24.409576989919287} +{"step": 38200, "loss": 0.01859650457277894, "loss_real": 0.008212768819648773, "loss_synth": 0.02117977530695498, "lr": 0.00041251756663058793, "elapsed": 1572.8853662309702, "steps_per_second": 24.4514222349833} +{"step": 38400, "loss": 0.018595771230757237, "loss_real": 0.00825680790003389, "loss_synth": 0.021167903570458294, "lr": 0.0004107937220159534, "elapsed": 1578.4413645679597, "steps_per_second": 24.492337155172457} +{"step": 38600, "loss": 0.01856281596235931, "loss_real": 0.00823564185993746, "loss_synth": 0.02113201561383903, "lr": 0.00040906574032460925, "elapsed": 1584.008032173966, "steps_per_second": 24.53279675849587} +{"step": 38800, "loss": 0.01851692103780806, "loss_real": 0.008050695271231234, "loss_synth": 0.021120713818818332, "lr": 0.0004073336897743139, "elapsed": 1589.587052582996, "steps_per_second": 24.572778839014354} +{"step": 39000, "loss": 0.018500159308314324, "loss_real": 0.008060148577205837, "loss_synth": 0.021097430316731332, "lr": 0.0004055976387434573, "elapsed": 1595.1248510179576, "steps_per_second": 24.613119681987808} +{"step": 39200, "loss": 0.018591455351561308, "loss_real": 0.008246439273934812, "loss_synth": 0.021165093686431647, "lr": 0.0004038576557683616, "elapsed": 1600.8110893159173, "steps_per_second": 24.65087824717817} +{"step": 39400, "loss": 0.018447759803384544, "loss_real": 0.00816128760110587, "loss_synth": 0.02100683333352208, "lr": 0.0004021138095405753, "elapsed": 1606.2293021989753, "steps_per_second": 24.69251477486193} +{"step": 39600, "loss": 0.01845050905831158, "loss_real": 0.008135341259185224, "loss_synth": 0.021016721595078707, "lr": 0.0004003661689041616, "elapsed": 1611.7286370439688, "steps_per_second": 24.732616333533326} +{"step": 39800, "loss": 0.018434859206900002, "loss_real": 0.008103222029749304, "loss_synth": 0.021005168920382858, "lr": 0.0003986148028529802, "elapsed": 1617.4013213600265, "steps_per_second": 24.769770788178786} +{"step": 40000, "loss": 0.01838758084923029, "loss_real": 0.007983740884810686, "loss_synth": 0.020975853111594917, "lr": 0.0003968597805279642, "elapsed": 1622.9072452560067, "steps_per_second": 24.809229574183426} +{"step": 40200, "loss": 0.01838826877065003, "loss_real": 0.008042760954704136, "loss_synth": 0.020962029369547962, "lr": 0.0003951011712143899, "elapsed": 1647.8353515350027, "steps_per_second": 24.553647413424244} +{"step": 40400, "loss": 0.01834281723946333, "loss_real": 0.008013152454514056, "loss_synth": 0.02091263609007001, "lr": 0.00039333904433914155, "elapsed": 1652.5340423429152, "steps_per_second": 24.605190416178154} +{"step": 40600, "loss": 0.018352683410048486, "loss_real": 0.007960281786508858, "loss_synth": 0.020938110370188952, "lr": 0.0003915734694679712, "elapsed": 1657.2683364530094, "steps_per_second": 24.655906153853167} +{"step": 40800, "loss": 0.018293628981336952, "loss_real": 0.007943960244301707, "loss_synth": 0.020868424642831087, "lr": 0.00038980451630275136, "elapsed": 1662.0622669250006, "steps_per_second": 24.70543892249805} +{"step": 41000, "loss": 0.01833977152593434, "loss_real": 0.008011920109856874, "loss_synth": 0.020909139700233937, "lr": 0.00038803225467872425, "elapsed": 1666.7267196739558, "steps_per_second": 24.756620307036005} +{"step": 41200, "loss": 0.01835098913870752, "loss_real": 0.007920648634899408, "loss_synth": 0.020945854373276233, "lr": 0.00038625675456174433, "elapsed": 1672.0718559499364, "steps_per_second": 24.797350852718218} +{"step": 41400, "loss": 0.018251547776162624, "loss_real": 0.007875654911622405, "loss_synth": 0.02083286764100194, "lr": 0.0003844780860455157, "elapsed": 1677.6559277409688, "steps_per_second": 24.834260209531713} +{"step": 41600, "loss": 0.018159364368766546, "loss_real": 0.00786235318519175, "loss_synth": 0.020721059804782272, "lr": 0.000382696319348826, "elapsed": 1683.0671107699163, "steps_per_second": 24.87349412456242} +{"step": 41800, "loss": 0.018243375020101666, "loss_real": 0.007875856668688357, "loss_synth": 0.0208226113114506, "lr": 0.00038091152481277364, "elapsed": 1688.6780561549822, "steps_per_second": 24.90950933159856} +{"step": 42000, "loss": 0.018207049584016203, "loss_real": 0.007730790581554174, "loss_synth": 0.020813338542357087, "lr": 0.00037912377289799076, "elapsed": 1694.1735555059277, "steps_per_second": 24.946995047217367} +{"step": 42200, "loss": 0.01819487056694925, "loss_real": 0.007714737039059401, "loss_synth": 0.020802123276516794, "lr": 0.0003773331341818617, "elapsed": 1699.652383298031, "steps_per_second": 24.984483440997728} +{"step": 42400, "loss": 0.018157953126356007, "loss_real": 0.007613141965121031, "loss_synth": 0.020781296472996473, "lr": 0.0003755396793557371, "elapsed": 1705.18387661397, "steps_per_second": 25.020951772241034} +{"step": 42600, "loss": 0.018110366323962807, "loss_real": 0.00765179411508143, "loss_synth": 0.020712255220860242, "lr": 0.0003737434792221425, "elapsed": 1710.6666182499612, "steps_per_second": 25.057901344871233} +{"step": 42800, "loss": 0.01808435800485313, "loss_real": 0.007731236752588302, "loss_synth": 0.020660012513399124, "lr": 0.00037194460469198363, "elapsed": 1716.2368106269278, "steps_per_second": 25.0933267132309} +{"step": 43000, "loss": 0.018170201275497674, "loss_real": 0.0077246754127554594, "loss_synth": 0.020768844448029997, "lr": 0.00037014312678174675, "elapsed": 1721.7811586849857, "steps_per_second": 25.128900976075638} +{"step": 43200, "loss": 0.018043100209906696, "loss_real": 0.00768774813041091, "loss_synth": 0.02061931010335684, "lr": 0.00036833911661069525, "elapsed": 1727.2343702089274, "steps_per_second": 25.165581434214307} +{"step": 43400, "loss": 0.01813902328722179, "loss_real": 0.007734707416966557, "loss_synth": 0.020727414144203066, "lr": 0.0003665326453980616, "elapsed": 1732.7748664899264, "steps_per_second": 25.200752270591423} +{"step": 43600, "loss": 0.01807270842604339, "loss_real": 0.007604392331559211, "loss_synth": 0.020677021434530617, "lr": 0.00036472378446023604, "elapsed": 1738.2345859019551, "steps_per_second": 25.236877450000694} +{"step": 43800, "loss": 0.017989768367260694, "loss_real": 0.007661018245853484, "loss_synth": 0.020559359854087234, "lr": 0.00036291260520795126, "elapsed": 1745.1447541689267, "steps_per_second": 25.251641550460715} +{"step": 44000, "loss": 0.017980087269097566, "loss_real": 0.007579593569971621, "loss_synth": 0.020567527106031776, "lr": 0.00036109917914346285, "elapsed": 1754.366984542925, "steps_per_second": 25.23278780862405} +{"step": 44200, "loss": 0.01796340461820364, "loss_real": 0.007627178761176765, "loss_synth": 0.020534856067970394, "lr": 0.0003592835778577268, "elapsed": 1762.6979962530313, "steps_per_second": 25.226957841744834} +{"step": 44400, "loss": 0.01799076745286584, "loss_real": 0.007585129959043115, "loss_synth": 0.020579487094655634, "lr": 0.000357465873027573, "elapsed": 1768.793593609007, "steps_per_second": 25.253250013115462} +{"step": 44600, "loss": 0.017942467294633387, "loss_real": 0.007453278861939907, "loss_synth": 0.020551972649991514, "lr": 0.0003556461364128757, "elapsed": 1774.9966759079834, "steps_per_second": 25.27782051544579} +{"step": 44800, "loss": 0.017958413530141114, "loss_real": 0.0075196848670020695, "loss_synth": 0.020555365635082125, "lr": 0.0003538244398537207, "elapsed": 1781.216425823979, "steps_per_second": 25.301980674825824} +{"step": 45000, "loss": 0.01790513774380088, "loss_real": 0.00751997597515583, "loss_synth": 0.020488763377070427, "lr": 0.0003520008552675689, "elapsed": 1787.2610234309686, "steps_per_second": 25.328468459850775} +{"step": 45200, "loss": 0.017888801926746963, "loss_real": 0.007545904426369816, "loss_synth": 0.02046191304922104, "lr": 0.00035017545464641707, "elapsed": 1794.6685802140273, "steps_per_second": 25.33540651027129} +{"step": 45400, "loss": 0.017926312228664757, "loss_real": 0.007475592012051493, "loss_synth": 0.020526247546076775, "lr": 0.0003483483100539563, "elapsed": 1800.8182754910085, "steps_per_second": 25.360093484957694} +{"step": 45600, "loss": 0.017854562066495418, "loss_real": 0.007377415928058326, "loss_synth": 0.02046107167378068, "lr": 0.0003465194936227266, "elapsed": 1806.9739801259711, "steps_per_second": 25.384526510614553} +{"step": 45800, "loss": 0.017811947874724864, "loss_real": 0.007406472952570766, "loss_synth": 0.020400626957416533, "lr": 0.00034468907755126903, "elapsed": 1813.1290828639176, "steps_per_second": 25.408801141340856} +{"step": 46000, "loss": 0.01778675734065473, "loss_real": 0.007383254470769316, "loss_synth": 0.020374946128576994, "lr": 0.0003428571341012763, "elapsed": 1819.1225544249173, "steps_per_second": 25.4351835502511} +{"step": 46200, "loss": 0.0178630667924881, "loss_real": 0.007436514075379819, "loss_synth": 0.02045698986388743, "lr": 0.0003410237355947386, "elapsed": 1825.2644298949745, "steps_per_second": 25.459309427597123} +{"step": 46400, "loss": 0.017822845373302698, "loss_real": 0.007454107734374702, "loss_synth": 0.02040238513611257, "lr": 0.0003391889544110898, "elapsed": 1831.4895078019472, "steps_per_second": 25.48210812243778} +{"step": 46600, "loss": 0.017756804637610913, "loss_real": 0.0073221010528504845, "loss_synth": 0.0203527554217726, "lr": 0.0003373528629843496, "elapsed": 1838.0077502130298, "steps_per_second": 25.50065982256856} +{"step": 46800, "loss": 0.017752104131504895, "loss_real": 0.007381715613882988, "loss_synth": 0.020332054439932107, "lr": 0.00033551553380026337, "elapsed": 1847.2144872359931, "steps_per_second": 25.481723923466593} +{"step": 47000, "loss": 0.01769740895368159, "loss_real": 0.007280989424325526, "loss_synth": 0.020288810888305305, "lr": 0.00033367703939344147, "elapsed": 1856.260054785991, "steps_per_second": 25.46520044623928} +{"step": 47200, "loss": 0.017730253553017973, "loss_real": 0.007268795047421009, "loss_synth": 0.020332860434427856, "lr": 0.00033183745234449495, "elapsed": 1862.4088954089675, "steps_per_second": 25.488647054047334} +{"step": 47400, "loss": 0.01772412523627281, "loss_real": 0.007254852973856032, "loss_synth": 0.02032867608591914, "lr": 0.0003299968452771707, "elapsed": 1868.5608878949424, "steps_per_second": 25.511895189122757} +{"step": 47600, "loss": 0.017622260907664895, "loss_real": 0.007193986771162599, "loss_synth": 0.020216612247750163, "lr": 0.00032815529085548407, "elapsed": 1874.700083157979, "steps_per_second": 25.53516517928845} +{"step": 47800, "loss": 0.017719293069094418, "loss_real": 0.007253918666392565, "loss_synth": 0.020322874030098317, "lr": 0.0003263128617808504, "elapsed": 1880.8040754169924, "steps_per_second": 25.55876348444388} +{"step": 48000, "loss": 0.017634740062057973, "loss_real": 0.007179141833912581, "loss_synth": 0.020235889004543425, "lr": 0.0003244696307892148, "elapsed": 1886.9551603139844, "steps_per_second": 25.581566185893564} +{"step": 48200, "loss": 0.017575476402416825, "loss_real": 0.007104670309927314, "loss_synth": 0.020180408926680684, "lr": 0.00032262567064818076, "elapsed": 1893.1559130669339, "steps_per_second": 25.603544349401844} +{"step": 48400, "loss": 0.01755699929781258, "loss_real": 0.007139777720440179, "loss_synth": 0.02014860078692436, "lr": 0.00032078105415413725, "elapsed": 1898.6181880750228, "steps_per_second": 25.63540131453828} +{"step": 48600, "loss": 0.017554923128336668, "loss_real": 0.007172725377604366, "loss_synth": 0.020137811293825508, "lr": 0.00031893585412938485, "elapsed": 1904.0832837319467, "steps_per_second": 25.66703624344062} +{"step": 48800, "loss": 0.0176343300472945, "loss_real": 0.007177949263714254, "loss_synth": 0.02023567377589643, "lr": 0.00031709014341926124, "elapsed": 1909.622862159973, "steps_per_second": 25.69748114464011} +{"step": 49000, "loss": 0.017499450026080013, "loss_real": 0.007109510444570333, "loss_synth": 0.020084264324977993, "lr": 0.0003152439948892648, "elapsed": 1915.1579578520032, "steps_per_second": 25.7278094977592} +{"step": 49200, "loss": 0.017520186938345433, "loss_real": 0.007064641613978893, "loss_synth": 0.020121322656050326, "lr": 0.0003133974814221784, "elapsed": 1920.7849628590047, "steps_per_second": 25.756722719990343} +{"step": 49400, "loss": 0.017554187010973693, "loss_real": 0.007086498229764402, "loss_synth": 0.020158343678340317, "lr": 0.00031155067591519183, "elapsed": 1926.2782482039183, "steps_per_second": 25.787266000211105} +{"step": 49600, "loss": 0.01750929228030145, "loss_real": 0.007039813881274313, "loss_synth": 0.020113894250243902, "lr": 0.0003097036512770245, "elapsed": 1931.8957965349546, "steps_per_second": 25.815964809138514} +{"step": 49800, "loss": 0.01751559308730066, "loss_real": 0.007145104575902224, "loss_synth": 0.020095568299293518, "lr": 0.00030785648042504644, "elapsed": 1937.499819715973, "steps_per_second": 25.844677694641902} +{"step": 50000, "loss": 0.01745718775317073, "loss_real": 0.0070519803976640105, "loss_synth": 0.02004580035805702, "lr": 0.0003060092362824, "elapsed": 1942.9570889089955, "steps_per_second": 25.87518901129836} +{"step": 50200, "loss": 0.017410251805558802, "loss_real": 0.006976042157039047, "loss_synth": 0.020006079813465475, "lr": 0.0003041619917751209, "elapsed": 1975.4715163399233, "steps_per_second": 25.548797044316128} +{"step": 50400, "loss": 0.017396497437730432, "loss_real": 0.007127152588218451, "loss_synth": 0.01995131019502878, "lr": 0.00030231481982925936, "elapsed": 1980.9407372779679, "steps_per_second": 25.579384702225983} +{"step": 50600, "loss": 0.017441191701218484, "loss_real": 0.006938354957383126, "loss_synth": 0.02005409248173237, "lr": 0.000300467793368001, "elapsed": 1986.4548654379323, "steps_per_second": 25.609220960077515} +{"step": 50800, "loss": 0.017394674941897392, "loss_real": 0.006906521914061159, "loss_synth": 0.020003922702744602, "lr": 0.0002986209853087878, "elapsed": 1992.0210142789874, "steps_per_second": 25.638218019155246} +{"step": 51000, "loss": 0.01738253311254084, "loss_real": 0.006909681465476752, "loss_synth": 0.019987974418327212, "lr": 0.00029677446856043966, "elapsed": 1997.440448661917, "steps_per_second": 25.668947958073876} +{"step": 51200, "loss": 0.017398650646209716, "loss_real": 0.006959219912532717, "loss_synth": 0.01999577717855573, "lr": 0.0002949283160202762, "elapsed": 2003.0013558919309, "steps_per_second": 25.697685881922105} +{"step": 51400, "loss": 0.017310771010816097, "loss_real": 0.006952697527594864, "loss_synth": 0.019887657621875405, "lr": 0.0002930826005712384, "elapsed": 2008.5392012619413, "steps_per_second": 25.726560787934574} +{"step": 51600, "loss": 0.017366469437256456, "loss_real": 0.006913541248068213, "loss_synth": 0.019966954020783304, "lr": 0.00029123739507901195, "elapsed": 2014.0482611570042, "steps_per_second": 25.75564611784377} +{"step": 51800, "loss": 0.017341008968651296, "loss_real": 0.00689772070851177, "loss_synth": 0.019939095340669157, "lr": 0.0002893927723891501, "elapsed": 2019.5865239800187, "steps_per_second": 25.78419711958357} +{"step": 52000, "loss": 0.017241747118532658, "loss_real": 0.00684300891822204, "loss_synth": 0.019828750370070338, "lr": 0.0002875488053241983, "elapsed": 2025.1594482799992, "steps_per_second": 25.812147017295473} +{"step": 52200, "loss": 0.017322024032473564, "loss_real": 0.006935241960454732, "loss_synth": 0.019906052984297276, "lr": 0.00028570556668081873, "elapsed": 2030.6818891469156, "steps_per_second": 25.840588469461977} +{"step": 52400, "loss": 0.017226288290694357, "loss_real": 0.006840701943729073, "loss_synth": 0.019810019731521605, "lr": 0.00028386312922691696, "elapsed": 2036.2630938859656, "steps_per_second": 25.86812439006178} +{"step": 52600, "loss": 0.017273054728284477, "loss_real": 0.006837164268363267, "loss_synth": 0.019869300723075866, "lr": 0.00028202156569876895, "elapsed": 2041.6604732630076, "steps_per_second": 25.897852721343234} +{"step": 52800, "loss": 0.0172631926368922, "loss_real": 0.0068362658936530355, "loss_synth": 0.019857208551838992, "lr": 0.0002801809487981495, "elapsed": 2047.252448636922, "steps_per_second": 25.924946179179173} +{"step": 53000, "loss": 0.017255155965685845, "loss_real": 0.006814392383676022, "loss_synth": 0.01985261416994035, "lr": 0.0002783413511894622, "elapsed": 2052.7712157289498, "steps_per_second": 25.95282159470775} +{"step": 53200, "loss": 0.017242683712393046, "loss_real": 0.006795866184402258, "loss_synth": 0.019841648004949093, "lr": 0.0002765028454968707, "elapsed": 2058.3083371350076, "steps_per_second": 25.980313882591734} +{"step": 53400, "loss": 0.017113638883456586, "loss_real": 0.006637137508951127, "loss_synth": 0.019719988014549016, "lr": 0.0002746655043014318, "elapsed": 2063.1140951609705, "steps_per_second": 26.01692510398024} +{"step": 53600, "loss": 0.017183257592841984, "loss_real": 0.0067463234020397065, "loss_synth": 0.019779763286933302, "lr": 0.0002728294001382298, "elapsed": 2067.845029547927, "steps_per_second": 26.05431286499115} +{"step": 53800, "loss": 0.01715562109835446, "loss_real": 0.00661390672903508, "loss_synth": 0.019778193924576044, "lr": 0.0002709946054935132, "elapsed": 2072.6125132510206, "steps_per_second": 26.09106658843213} +{"step": 54000, "loss": 0.017155270082876085, "loss_real": 0.006671633333899081, "loss_synth": 0.01976339445449412, "lr": 0.0002691611928018329, "elapsed": 2077.2933733320097, "steps_per_second": 26.12874586932641} +{"step": 54200, "loss": 0.017155970158055426, "loss_real": 0.006727676747832447, "loss_synth": 0.019750326136127115, "lr": 0.0002673292344431826, "elapsed": 2082.0222165739397, "steps_per_second": 26.165648730572446} +{"step": 54400, "loss": 0.01710774050094187, "loss_real": 0.006558798199985176, "loss_synth": 0.01973211158066988, "lr": 0.00026549880274014153, "elapsed": 2086.7596098809736, "steps_per_second": 26.20227557707084} +{"step": 54600, "loss": 0.017115700161084532, "loss_real": 0.006645658416673541, "loss_synth": 0.019720442537218334, "lr": 0.00026366996995501915, "elapsed": 2091.4938029799378, "steps_per_second": 26.23877600365113} +{"step": 54800, "loss": 0.01712567538022995, "loss_real": 0.006678493204526603, "loss_synth": 0.01972473063506186, "lr": 0.00026184280828700236, "elapsed": 2096.124377146014, "steps_per_second": 26.276416205406182} +{"step": 55000, "loss": 0.01706513624638319, "loss_real": 0.00660960758337751, "loss_synth": 0.01966626778244972, "lr": 0.00026001738986930516, "elapsed": 2100.881571637932, "steps_per_second": 26.31229564074174} +{"step": 55200, "loss": 0.017057705521583557, "loss_real": 0.006603567372076213, "loss_synth": 0.01965849126689136, "lr": 0.000258193786766321, "elapsed": 2106.440319194924, "steps_per_second": 26.337935330810105} +{"step": 55400, "loss": 0.017033017715439202, "loss_real": 0.0066294438415206965, "loss_synth": 0.019621223947033285, "lr": 0.00025637207097077797, "elapsed": 2110.945642757928, "steps_per_second": 26.376661926143512} +{"step": 55600, "loss": 0.016989555046893656, "loss_real": 0.006490261962171644, "loss_synth": 0.01960157446563244, "lr": 0.0002545523144008965, "elapsed": 2115.747691762983, "steps_per_second": 26.41149944296386} +{"step": 55800, "loss": 0.01698899382725358, "loss_real": 0.006450183484703303, "loss_synth": 0.019610844142735003, "lr": 0.0002527345888975499, "elapsed": 2120.4598027219763, "steps_per_second": 26.447305722058633} +{"step": 56000, "loss": 0.016968196518719197, "loss_real": 0.006528634433634579, "loss_synth": 0.019565355880185962, "lr": 0.00025091896622142854, "elapsed": 2125.161542876973, "steps_per_second": 26.48308230500901} +{"step": 56200, "loss": 0.017038783393800258, "loss_real": 0.006524915574118495, "loss_synth": 0.019654428632929922, "lr": 0.00024910551805020696, "elapsed": 2129.942103079986, "steps_per_second": 26.517713887495542} +{"step": 56400, "loss": 0.01692470814101398, "loss_real": 0.006504886311013251, "loss_synth": 0.019516956694424152, "lr": 0.0002472943159757138, "elapsed": 2134.6293620429933, "steps_per_second": 26.55335593351075} +{"step": 56600, "loss": 0.016942092590034007, "loss_real": 0.0064789869915693995, "loss_synth": 0.019545109113678336, "lr": 0.0002454854315011058, "elapsed": 2139.392831597943, "steps_per_second": 26.58788913714801} +{"step": 56800, "loss": 0.016991616329178214, "loss_real": 0.006584358664695173, "loss_synth": 0.019580739121884107, "lr": 0.00024367893603804446, "elapsed": 2144.131072500022, "steps_per_second": 26.622582944636978} +{"step": 57000, "loss": 0.016921521788462998, "loss_real": 0.006357145844958723, "loss_synth": 0.01954973241314292, "lr": 0.00024187490090387762, "elapsed": 2148.859870060929, "steps_per_second": 26.657240723339406} +{"step": 57200, "loss": 0.016900068745017052, "loss_real": 0.006514627321157604, "loss_synth": 0.01948376400396228, "lr": 0.0002400733973188233, "elapsed": 2153.547366534942, "steps_per_second": 26.692259977928465} +{"step": 57400, "loss": 0.016935326689854265, "loss_real": 0.006380109959281981, "loss_synth": 0.019561258722096683, "lr": 0.00023827449640315845, "elapsed": 2158.3167843649862, "steps_per_second": 26.726106897067243} +{"step": 57600, "loss": 0.016949765402823686, "loss_real": 0.0064712973800487815, "loss_synth": 0.019556603878736496, "lr": 0.00023647826917441107, "elapsed": 2163.00082013302, "steps_per_second": 26.760865339634538} +{"step": 57800, "loss": 0.016901639597490428, "loss_real": 0.006433756113983691, "loss_synth": 0.01950584483332932, "lr": 0.00023468478654455627, "elapsed": 2167.776499458938, "steps_per_second": 26.794334471045445} +{"step": 58000, "loss": 0.016873195841908453, "loss_real": 0.006390934148803353, "loss_synth": 0.01948097807355225, "lr": 0.00023289411931721752, "elapsed": 2175.79767889902, "steps_per_second": 26.787442633109006} +{"step": 58200, "loss": 0.01685294508934021, "loss_real": 0.0063936303392983975, "loss_synth": 0.019455018779262902, "lr": 0.00023110633818487078, "elapsed": 2184.1055746530183, "steps_per_second": 26.777068918645874} +{"step": 58400, "loss": 0.01687065993435681, "loss_real": 0.0064362640166655185, "loss_synth": 0.019466534135863186, "lr": 0.0002293215137260541, "elapsed": 2192.523092046962, "steps_per_second": 26.76542942120491} +{"step": 58600, "loss": 0.01685410940088332, "loss_real": 0.0063800182449631395, "loss_synth": 0.019459859039634465, "lr": 0.00022753971640258089, "elapsed": 2200.9284355209675, "steps_per_second": 26.75402808391941} +{"step": 58800, "loss": 0.016767009077593684, "loss_real": 0.006271089632064104, "loss_synth": 0.019378189044073225, "lr": 0.00022576101655675854, "elapsed": 2209.367474340019, "steps_per_second": 26.742304093607718} +{"step": 59000, "loss": 0.016742855212651193, "loss_real": 0.006415779739618301, "loss_synth": 0.019312030039727687, "lr": 0.00022398548440861137, "elapsed": 2217.783486880944, "steps_per_second": 26.730948620127627} +{"step": 59200, "loss": 0.016843147566542028, "loss_real": 0.006361627518199384, "loss_synth": 0.01945074531249702, "lr": 0.00022221319005310845, "elapsed": 2226.1678031600313, "steps_per_second": 26.720061671717026} +{"step": 59400, "loss": 0.016793054691515864, "loss_real": 0.006353461553808302, "loss_synth": 0.01939022178761661, "lr": 0.00022044420345739628, "elapsed": 2234.5768548740307, "steps_per_second": 26.708959746660344} +{"step": 59600, "loss": 0.016782234152778984, "loss_real": 0.006281764162704349, "loss_synth": 0.01939454642124474, "lr": 0.00021867859445803652, "elapsed": 2242.973314236966, "steps_per_second": 26.69809205774382} +{"step": 59800, "loss": 0.01671158298384398, "loss_real": 0.0063237820356152954, "loss_synth": 0.019295865250751377, "lr": 0.00021691643275824937, "elapsed": 2251.3949126759544, "steps_per_second": 26.68700641283904} +{"step": 60000, "loss": 0.01677434069570154, "loss_real": 0.006377596175298095, "loss_synth": 0.0193608480412513, "lr": 0.0002151577879251615, "elapsed": 2259.801566982991, "steps_per_second": 26.67618102472621} +{"step": 60200, "loss": 0.016695147682912647, "loss_real": 0.006302553536370397, "loss_synth": 0.01928062236867845, "lr": 0.0002134027293870595, "elapsed": 2318.467256537988, "steps_per_second": 26.08473498343491} +{"step": 60400, "loss": 0.016703723268583416, "loss_real": 0.006241087350063026, "loss_synth": 0.019306623060256243, "lr": 0.00021165132643064945, "elapsed": 2326.8836703959387, "steps_per_second": 26.076299073893505} +{"step": 60600, "loss": 0.016615159744396805, "loss_real": 0.006186804994940758, "loss_synth": 0.019209531052038074, "lr": 0.00020990364819832105, "elapsed": 2335.2838493660092, "steps_per_second": 26.068106298124373} +{"step": 60800, "loss": 0.016701006521470843, "loss_real": 0.006335862188134343, "loss_synth": 0.019279652033001183, "lr": 0.0002081597636854185, "elapsed": 2343.729404057027, "steps_per_second": 26.05946569221734} +{"step": 61000, "loss": 0.01666368273552507, "loss_real": 0.006246356125921011, "loss_synth": 0.019255310604348777, "lr": 0.00020641974173751627, "elapsed": 2352.1266993660247, "steps_per_second": 26.051424331103586} +{"step": 61200, "loss": 0.016622683671303092, "loss_real": 0.006193751331884414, "loss_synth": 0.01921719850972295, "lr": 0.00020468365104770166, "elapsed": 2360.4693334229523, "steps_per_second": 26.04404624899394} +{"step": 61400, "loss": 0.016540162656456234, "loss_real": 0.006184514944907278, "loss_synth": 0.019116445807740093, "lr": 0.00020295156015386222, "elapsed": 2368.702563014929, "steps_per_second": 26.03792834784559} +{"step": 61600, "loss": 0.016670024544000624, "loss_real": 0.006206889818422497, "loss_synth": 0.01927304851822555, "lr": 0.0002012235374359807, "elapsed": 2376.864953715005, "steps_per_second": 26.032632336724145} +{"step": 61800, "loss": 0.016621276712976397, "loss_real": 0.006167701298836619, "loss_synth": 0.019221922252327203, "lr": 0.00019949965111343518, "elapsed": 2385.041572836926, "steps_per_second": 26.027216772723193} +{"step": 62000, "loss": 0.01668244035448879, "loss_real": 0.006116724575404078, "loss_synth": 0.019310984294861555, "lr": 0.00019777996924230589, "elapsed": 2393.4153036329662, "steps_per_second": 26.019685791781512} +{"step": 62200, "loss": 0.016671853121370078, "loss_real": 0.006230439930222928, "loss_synth": 0.01926947299391031, "lr": 0.00019606455971268863, "elapsed": 2401.816654708935, "steps_per_second": 26.011907095461538} +{"step": 62400, "loss": 0.016593092768453062, "loss_real": 0.00614287422504276, "loss_synth": 0.01919290332123637, "lr": 0.0001943534902460142, "elapsed": 2409.621138944989, "steps_per_second": 26.010652614116058} +{"step": 62600, "loss": 0.016588594843633474, "loss_real": 0.006105627960059792, "loss_synth": 0.01919655257835984, "lr": 0.00019264682839237538, "elapsed": 2416.991473732982, "steps_per_second": 26.01409876984697} +{"step": 62800, "loss": 0.01658781962003559, "loss_real": 0.006129781904164701, "loss_synth": 0.019189575398340823, "lr": 0.00019094464152785996, "elapsed": 2424.3586347430246, "steps_per_second": 26.01755808615237} +{"step": 63000, "loss": 0.016562068006023764, "loss_real": 0.006148751224391163, "loss_synth": 0.01915269806049764, "lr": 0.00018924699685189068, "elapsed": 2431.7196307679405, "steps_per_second": 26.021062611926467} +{"step": 63200, "loss": 0.01653025112580508, "loss_real": 0.006047569282818585, "loss_synth": 0.01913813790306449, "lr": 0.0001875539613845726, "elapsed": 2438.037617918919, "steps_per_second": 26.03572800142165} +{"step": 63400, "loss": 0.016500154393725097, "loss_real": 0.006021896689198911, "loss_synth": 0.019106940478086473, "lr": 0.00018586560196404684, "elapsed": 2442.391371089965, "steps_per_second": 26.071358942755282} +{"step": 63600, "loss": 0.01644632763694972, "loss_real": 0.006065287473611534, "loss_synth": 0.01902892773039639, "lr": 0.00018418198524385257, "elapsed": 2446.8291832099203, "steps_per_second": 26.10596174108276} +{"step": 63800, "loss": 0.016498201680369674, "loss_real": 0.006099412653129548, "loss_synth": 0.019085217509418727, "lr": 0.0001825031776902951, "elapsed": 2451.3225785739487, "steps_per_second": 26.139843396378094} +{"step": 64000, "loss": 0.01649681608658284, "loss_real": 0.006068633161485195, "loss_synth": 0.019091144604608416, "lr": 0.00018082924557982189, "elapsed": 2455.790367266978, "steps_per_second": 26.173874632045038} +{"step": 64200, "loss": 0.016444089808501303, "loss_real": 0.005976026812568307, "loss_synth": 0.019048339528962968, "lr": 0.0001791602549964065, "elapsed": 2460.3067096589366, "steps_per_second": 26.207262284409993} +{"step": 64400, "loss": 0.01653669443447143, "loss_real": 0.0061009103897959, "loss_synth": 0.019132913844659923, "lr": 0.00017749627182893945, "elapsed": 2464.777446619002, "steps_per_second": 26.24101467563999} +{"step": 64600, "loss": 0.01643589647486806, "loss_real": 0.005989494200330228, "loss_synth": 0.019034757474437357, "lr": 0.00017583736176862697, "elapsed": 2469.2482576509938, "steps_per_second": 26.27464352909959} +{"step": 64800, "loss": 0.016481752139516175, "loss_real": 0.006024909412954003, "loss_synth": 0.019083210527896882, "lr": 0.00017418359030639766, "elapsed": 2473.703418346937, "steps_per_second": 26.308317461492834} +{"step": 65000, "loss": 0.016466004331596194, "loss_real": 0.00598939159186557, "loss_synth": 0.01907238122075796, "lr": 0.00017253502273031738, "elapsed": 2478.102229387965, "steps_per_second": 26.342471359211306} +{"step": 65200, "loss": 0.016442198604345322, "loss_real": 0.00596854354487732, "loss_synth": 0.019047839595004917, "lr": 0.00017089172412301098, "elapsed": 2483.4076143919956, "steps_per_second": 26.366833604233534} +{"step": 65400, "loss": 0.0164356905920431, "loss_real": 0.006006523435935378, "loss_synth": 0.01903026389889419, "lr": 0.00016925375935909377, "elapsed": 2489.9935797869693, "steps_per_second": 26.377460796072313} +{"step": 65600, "loss": 0.016325336382724345, "loss_real": 0.006001661538612098, "loss_synth": 0.018893665233626962, "lr": 0.00016762119310260992, "elapsed": 2497.3636296489276, "steps_per_second": 26.379711434598295} +{"step": 65800, "loss": 0.016390376864001154, "loss_real": 0.005982484729029239, "loss_synth": 0.01897965741343796, "lr": 0.00016599408980447994, "elapsed": 2504.740030098008, "steps_per_second": 26.38188159857425} +{"step": 66000, "loss": 0.016370488246902824, "loss_real": 0.0059338211710564795, "loss_synth": 0.018966927388682962, "lr": 0.00016437251369995603, "elapsed": 2512.1037207819754, "steps_per_second": 26.384173019245065} +{"step": 66200, "loss": 0.016342436661943793, "loss_real": 0.005954897059127689, "loss_synth": 0.01892665388993919, "lr": 0.00016275652880608612, "elapsed": 2519.474562300951, "steps_per_second": 26.38637578011304} +{"step": 66400, "loss": 0.01636675463523716, "loss_real": 0.005940330454614014, "loss_synth": 0.018960645543411373, "lr": 0.00016114619891918676, "elapsed": 2526.8393999729306, "steps_per_second": 26.388628597648232} +{"step": 66600, "loss": 0.016359629398211836, "loss_real": 0.005952289036940783, "loss_synth": 0.018948772670701147, "lr": 0.0001595415876123247, "elapsed": 2534.2101123590255, "steps_per_second": 26.390806834974263} +{"step": 66800, "loss": 0.016338548939675093, "loss_real": 0.00598304676823318, "loss_synth": 0.01891479592770338, "lr": 0.00015794275823280684, "elapsed": 2541.5849867570214, "steps_per_second": 26.392928981931963} +{"step": 67000, "loss": 0.01626673254650086, "loss_real": 0.005900052301585674, "loss_synth": 0.018845760198310017, "lr": 0.00015634977389967922, "elapsed": 2548.9658613810316, "steps_per_second": 26.394976406422572} +{"step": 67200, "loss": 0.016298363567329943, "loss_real": 0.005855015912093222, "loss_synth": 0.018896464770659805, "lr": 0.00015476269750123585, "elapsed": 2556.3385453679366, "steps_per_second": 26.397096886477694} +{"step": 67400, "loss": 0.016326793590560554, "loss_real": 0.00581359620206058, "loss_synth": 0.018942271936684848, "lr": 0.0001531815916925354, "elapsed": 2563.7088542819256, "steps_per_second": 26.3992296782589} +{"step": 67600, "loss": 0.01633174017071724, "loss_real": 0.005897722553927451, "loss_synth": 0.018927520364522932, "lr": 0.0001516065188929278, "elapsed": 2571.0780840169173, "steps_per_second": 26.401361317883854} +{"step": 67800, "loss": 0.016257776501588522, "loss_real": 0.005867338478565216, "loss_synth": 0.018842714782804252, "lr": 0.0001500375412835904, "elapsed": 2578.4440949159907, "steps_per_second": 26.403513822968694} +{"step": 68000, "loss": 0.016273981216363607, "loss_real": 0.005847791585838422, "loss_synth": 0.01886781372129917, "lr": 0.00014847472080507259, "elapsed": 2585.808534062933, "steps_per_second": 26.40567012953148} +{"step": 68200, "loss": 0.016291902353987097, "loss_real": 0.005862059607170522, "loss_synth": 0.01888664372265339, "lr": 0.00014691811915485098, "elapsed": 2593.1767150720116, "steps_per_second": 26.4077758757797} +{"step": 68400, "loss": 0.016221255506388844, "loss_real": 0.005815876906272024, "loss_synth": 0.01880991078913212, "lr": 0.00014536779778489325, "elapsed": 2600.5366006509867, "steps_per_second": 26.409954228818805} +{"step": 68600, "loss": 0.016196836736053228, "loss_real": 0.005850537451915443, "loss_synth": 0.01877079407684505, "lr": 0.00014382381789923275, "elapsed": 2607.9932691849535, "steps_per_second": 26.411136080538327} +{"step": 68800, "loss": 0.01634059344884008, "loss_real": 0.005834628825541585, "loss_synth": 0.018954272465780377, "lr": 0.00014228624045155134, "elapsed": 2615.465945782955, "steps_per_second": 26.412148847941094} +{"step": 69000, "loss": 0.016246941578574477, "loss_real": 0.005816261970903724, "loss_synth": 0.01884189116768539, "lr": 0.00014075512614277405, "elapsed": 2622.839625792927, "steps_per_second": 26.414156808538976} +{"step": 69200, "loss": 0.016186433481052517, "loss_real": 0.0058647062885575, "loss_synth": 0.01875427782535553, "lr": 0.00013923053541867213, "elapsed": 2630.2022199929925, "steps_per_second": 26.416265255690455} +{"step": 69400, "loss": 0.016210806835442782, "loss_real": 0.005865919156931341, "loss_synth": 0.018784413188695906, "lr": 0.00013771252846747682, "elapsed": 2638.7917667540023, "steps_per_second": 26.40602864016283} +{"step": 69600, "loss": 0.01615395387634635, "loss_real": 0.005816740362206474, "loss_synth": 0.018725650887936353, "lr": 0.00013620116521750327, "elapsed": 2648.4085617139935, "steps_per_second": 26.38557930011512} +{"step": 69800, "loss": 0.016141140144318344, "loss_real": 0.005723270422313362, "loss_synth": 0.018732902826741338, "lr": 0.00013469650533478477, "elapsed": 2657.9521696729353, "steps_per_second": 26.366007402624497} +{"step": 70000, "loss": 0.016207024985924363, "loss_real": 0.00579653185675852, "loss_synth": 0.018796952525153756, "lr": 0.00013319860822071707, "elapsed": 2667.324905694928, "steps_per_second": 26.348270640245726} +{"step": 70200, "loss": 0.016105697937309742, "loss_real": 0.005776011117268354, "loss_synth": 0.018675522627308965, "lr": 0.0001317075330097135, "elapsed": 2730.1788978510303, "steps_per_second": 25.81285827582208} +{"step": 70400, "loss": 0.01615307489410043, "loss_real": 0.0057478276989422735, "loss_synth": 0.018741697436198593, "lr": 0.00013022333856687015, "elapsed": 2739.5262129559414, "steps_per_second": 25.7977310871065} +{"step": 70600, "loss": 0.016193654886446893, "loss_real": 0.005755098084919154, "loss_synth": 0.01879056422971189, "lr": 0.00012874608348564245, "elapsed": 2748.4830915050115, "steps_per_second": 25.786383930359793} +{"step": 70800, "loss": 0.01610090559348464, "loss_real": 0.005748482858762145, "loss_synth": 0.01867638642899692, "lr": 0.00012727582608553135, "elapsed": 2754.1299715560162, "steps_per_second": 25.806207830287875} +{"step": 71000, "loss": 0.016104115243069827, "loss_real": 0.005730834419373423, "loss_synth": 0.018684785226359964, "lr": 0.00012581262440978152, "elapsed": 2759.492210407974, "steps_per_second": 25.828624511487316} +{"step": 71200, "loss": 0.016131991548463703, "loss_real": 0.0056472569145262245, "loss_synth": 0.018740388937294482, "lr": 0.00012435653622308986, "elapsed": 2764.8716594019206, "steps_per_second": 25.850792375337033} +{"step": 71400, "loss": 0.01597084666136652, "loss_real": 0.005726631190627813, "loss_synth": 0.018519407641142606, "lr": 0.00012290761900932463, "elapsed": 2770.2026942289667, "steps_per_second": 25.87332772798626} +{"step": 71600, "loss": 0.01605243168771267, "loss_real": 0.005735323450062424, "loss_synth": 0.018619126854464412, "lr": 0.00012146592996925655, "elapsed": 2775.3996188290184, "steps_per_second": 25.897032289263453} +{"step": 71800, "loss": 0.016035923957824706, "loss_real": 0.005658591594547033, "loss_synth": 0.01861760185100138, "lr": 0.00012003152601830035, "elapsed": 2780.0485042569926, "steps_per_second": 25.925777283405406} +{"step": 72000, "loss": 0.016112714475020766, "loss_real": 0.005648857287596911, "loss_synth": 0.018715918054804204, "lr": 0.00011860446378426794, "elapsed": 2784.722293069004, "steps_per_second": 25.954192940471856} +{"step": 72200, "loss": 0.01611637185327709, "loss_real": 0.005655752625316381, "loss_synth": 0.018718769801780583, "lr": 0.00011718479960513273, "elapsed": 2791.230156503967, "steps_per_second": 25.965375190576562} +{"step": 72400, "loss": 0.016029088934883477, "loss_real": 0.005591936068376526, "loss_synth": 0.0186256489995867, "lr": 0.00011577258952680585, "elapsed": 2797.6334404170047, "steps_per_second": 25.977479953572473} +{"step": 72600, "loss": 0.016032011401839553, "loss_real": 0.005635472007561475, "loss_synth": 0.018618467627093196, "lr": 0.00011436788930092282, "elapsed": 2803.9903558020014, "steps_per_second": 25.989960632771457} +{"step": 72800, "loss": 0.016041699033230543, "loss_real": 0.00558395276311785, "loss_synth": 0.01864338234998286, "lr": 0.00011297075438264347, "elapsed": 2810.163346754969, "steps_per_second": 26.004092930393725} +{"step": 73000, "loss": 0.01599892360623926, "loss_real": 0.005698700568173081, "loss_synth": 0.018561418177559973, "lr": 0.00011158123992846207, "elapsed": 2815.934745394974, "steps_per_second": 26.021887629286297} +{"step": 73200, "loss": 0.016040696692653, "loss_real": 0.005687708507757634, "loss_synth": 0.01861631831154227, "lr": 0.00011019940079403006, "elapsed": 2821.3556578339776, "steps_per_second": 26.04285626256064} +{"step": 73400, "loss": 0.01603877207264304, "loss_real": 0.0056852262956090275, "loss_synth": 0.018614532286301257, "lr": 0.0001088252915319904, "elapsed": 2826.761535151978, "steps_per_second": 26.06388332511348} +{"step": 73600, "loss": 0.015989514961838723, "loss_real": 0.005584528842009604, "loss_synth": 0.018578072395175695, "lr": 0.00010745896638982385, "elapsed": 2832.2078602359397, "steps_per_second": 26.084455887218958} +{"step": 73800, "loss": 0.016041354266926645, "loss_real": 0.005567916638683528, "loss_synth": 0.018646941352635622, "lr": 0.00010610047930770757, "elapsed": 2837.611619886942, "steps_per_second": 26.10534223679709} +{"step": 74000, "loss": 0.015970621262677013, "loss_real": 0.00559962588828057, "loss_synth": 0.018550722673535348, "lr": 0.00010474988391638535, "elapsed": 2843.0249852610286, "steps_per_second": 26.126060289904135} +{"step": 74200, "loss": 0.015889902645722032, "loss_real": 0.005674604575615376, "loss_synth": 0.018431269749999046, "lr": 0.00010340723353505088, "elapsed": 2849.5349643599475, "steps_per_second": 26.136599430575004} +{"step": 74400, "loss": 0.01596473216544837, "loss_real": 0.005638355887494981, "loss_synth": 0.018533733198419212, "lr": 0.00010207258116924196, "elapsed": 2855.9823702960275, "steps_per_second": 26.147665352343573} +{"step": 74600, "loss": 0.01600978747010231, "loss_real": 0.005572772002778947, "loss_synth": 0.018606313467025758, "lr": 0.00010074597950874877, "elapsed": 2862.3018907839432, "steps_per_second": 26.159854334286724} +{"step": 74800, "loss": 0.01597821756731719, "loss_real": 0.0056121406494639816, "loss_synth": 0.018557095378637315, "lr": 9.942748092553343e-05, "elapsed": 2868.408303680946, "steps_per_second": 26.17394106795163} +{"step": 75000, "loss": 0.015907235969789327, "loss_real": 0.005511451729107648, "loss_synth": 0.01849350430071354, "lr": 9.811713747166235e-05, "elapsed": 2874.182944284985, "steps_per_second": 26.191001850766337} +{"step": 75200, "loss": 0.015937198298051954, "loss_real": 0.005534026857931167, "loss_synth": 0.018525304291397333, "lr": 9.681500087725137e-05, "elapsed": 2880.635456737946, "steps_per_second": 26.201803905114264} +{"step": 75400, "loss": 0.015930313994176687, "loss_real": 0.005609049560735002, "loss_synth": 0.01849804329685867, "lr": 9.552112254842369e-05, "elapsed": 2885.963703703019, "steps_per_second": 26.22280660600069} +{"step": 75600, "loss": 0.015934157064184547, "loss_real": 0.005583176871296018, "loss_synth": 0.018509279116988183, "lr": 9.423555356528024e-05, "elapsed": 2891.397596733994, "steps_per_second": 26.24276918660963} +{"step": 75800, "loss": 0.015925518204458058, "loss_real": 0.00554842880461365, "loss_synth": 0.018507135538384317, "lr": 9.295834467988325e-05, "elapsed": 2896.6481478749774, "steps_per_second": 26.264324989477895} +{"step": 76000, "loss": 0.015914675062522293, "loss_real": 0.005581013211049139, "loss_synth": 0.018485488602891564, "lr": 9.168954631425251e-05, "elapsed": 2901.427154034958, "steps_per_second": 26.29009018743884} +{"step": 76200, "loss": 0.015871093021705748, "loss_real": 0.0055413860408589245, "loss_synth": 0.01844092252664268, "lr": 9.04292085583751e-05, "elapsed": 2905.9420970099745, "steps_per_second": 26.31817041195699} +{"step": 76400, "loss": 0.015888879992999136, "loss_real": 0.005536382920108735, "loss_synth": 0.01846437929198146, "lr": 8.917738116822742e-05, "elapsed": 2910.3833899629535, "steps_per_second": 26.34683234960491} +{"step": 76600, "loss": 0.015932308034971355, "loss_real": 0.005510843524243683, "loss_synth": 0.018524964964017274, "lr": 8.793411356381153e-05, "elapsed": 2914.823914297973, "steps_per_second": 26.37541360527379} +{"step": 76800, "loss": 0.015906603490002454, "loss_real": 0.005513990696053952, "loss_synth": 0.01849208283238113, "lr": 8.669945482720342e-05, "elapsed": 2919.352154506021, "steps_per_second": 26.403111359843287} +{"step": 77000, "loss": 0.015906404848210515, "loss_real": 0.005563122441526502, "loss_synth": 0.018479611678048968, "lr": 8.547345370061608e-05, "elapsed": 2923.8170673409477, "steps_per_second": 26.431297561698877} +{"step": 77200, "loss": 0.01584390414878726, "loss_real": 0.005444251450244337, "loss_synth": 0.01843113496899605, "lr": 8.425615858447468e-05, "elapsed": 2928.28435575997, "steps_per_second": 26.459375953196524} +{"step": 77400, "loss": 0.015856880778446793, "loss_real": 0.005457401792518794, "loss_synth": 0.018444068273529412, "lr": 8.304761753550614e-05, "elapsed": 2932.798009563936, "steps_per_second": 26.486948228776868} +{"step": 77600, "loss": 0.015827654148451983, "loss_real": 0.0054710484109818935, "loss_synth": 0.01840417569503188, "lr": 8.184787826484162e-05, "elapsed": 2937.3195579210296, "steps_per_second": 26.51436393856085} +{"step": 77800, "loss": 0.015816109161823987, "loss_real": 0.005525390438269824, "loss_synth": 0.018376239389181138, "lr": 8.065698813613332e-05, "elapsed": 2941.76378398994, "steps_per_second": 26.54239522364919} +{"step": 78000, "loss": 0.015808495567180215, "loss_real": 0.00541883212979883, "loss_synth": 0.018393241157755254, "lr": 7.947499416368436e-05, "elapsed": 2946.221674729022, "steps_per_second": 26.570217954627847} +{"step": 78200, "loss": 0.015852756882086396, "loss_real": 0.005515469890087843, "loss_synth": 0.01842447225935757, "lr": 7.830194301059288e-05, "elapsed": 2950.719184332993, "steps_per_second": 26.59759789990074} +{"step": 78400, "loss": 0.015911721582524477, "loss_real": 0.005481358427787199, "loss_synth": 0.018506592521443963, "lr": 7.713788098690989e-05, "elapsed": 2955.1026872319635, "steps_per_second": 26.6259250820999} +{"step": 78600, "loss": 0.01581640262622386, "loss_real": 0.005425017587840557, "loss_synth": 0.01840157663449645, "lr": 7.598285404781078e-05, "elapsed": 2959.543401157949, "steps_per_second": 26.653650944896036} +{"step": 78800, "loss": 0.015820694579742847, "loss_real": 0.005397492309566587, "loss_synth": 0.018413783963769675, "lr": 7.483690779178142e-05, "elapsed": 2963.9912788160145, "steps_per_second": 26.681228710281935} +{"step": 79000, "loss": 0.0158338204305619, "loss_real": 0.00550381910521537, "loss_synth": 0.018403723277151583, "lr": 7.37000874588178e-05, "elapsed": 2968.510106884991, "steps_per_second": 26.70808288071904} +{"step": 79200, "loss": 0.015762449698522685, "loss_real": 0.005394619484432042, "loss_synth": 0.018341763550415634, "lr": 7.257243792864014e-05, "elapsed": 2973.0004243130097, "steps_per_second": 26.735112428049188} +{"step": 79400, "loss": 0.015838794722221793, "loss_real": 0.005429673681501299, "loss_synth": 0.01842838107608259, "lr": 7.145400371892107e-05, "elapsed": 2977.4407743409975, "steps_per_second": 26.762510883038924} +{"step": 79600, "loss": 0.015792988948524, "loss_real": 0.005350555864861235, "loss_synth": 0.018390862597152592, "lr": 7.03448289835281e-05, "elapsed": 2981.8998430819483, "steps_per_second": 26.789658676191106} +{"step": 79800, "loss": 0.015781687973067164, "loss_real": 0.005417683036066592, "loss_synth": 0.018360050255432726, "lr": 6.924495751078057e-05, "elapsed": 2986.364528615959, "steps_per_second": 26.81667449173154} +{"step": 80000, "loss": 0.015798920840024946, "loss_real": 0.005435105963842943, "loss_synth": 0.018377235969528557, "lr": 6.815443272172096e-05, "elapsed": 2990.8184314690297, "steps_per_second": 26.843706486292053} +{"step": 80200, "loss": 0.015761764119379223, "loss_real": 0.005438882869202644, "loss_synth": 0.018329895595088602, "lr": 6.707329766840071e-05, "elapsed": 3017.360228259, "steps_per_second": 26.67326356497615} diff --git a/shared/package-files/9e/9e550e7fb95cc9ecd7f29e1bc33d9e052821a6387bd3ea9f9ae6303c292ff8fe/recipe.json b/shared/package-files/9e/9e550e7fb95cc9ecd7f29e1bc33d9e052821a6387bd3ea9f9ae6303c292ff8fe/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..7ca190232a9069b3e2ac30bacff9af4fe312fd98 --- /dev/null +++ b/shared/package-files/9e/9e550e7fb95cc9ecd7f29e1bc33d9e052821a6387bd3ea9f9ae6303c292ff8fe/recipe.json @@ -0,0 +1,167 @@ +{ + "args": { + "store": "/workspace/research/inv", + "out": "runs/I26-ff512x6-real08-corpus2+train3-noise025", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 0.25, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "noise_real_rate": 0.0, + "synth_peak_drop": -1.0, + "synth_jitter": -1.0, + "synth_rank_drop": 0.0, + "rank_keep": "inv/rank_keep.json", + "noise_near": 0.0, + "noise_deltas": "inv/noise_deltas.json", + "init": null, + "max_steps_this_run": 0 + }, + "parameters": 24997832, + "model": { + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "pair_dim": 64, + "fp_bits": 4096, + "max_energy": 200.0 + }, + "real_rows": 194119, + "synth_rows": 2333477, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "gpu": "NVIDIA H100 80GB HBM3", + "load_seconds": 294.7976578930393, + "extra_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + } +} diff --git a/shared/package-files/9e/9e74b2978423c763f4b01a99b75c958f82547bd1bbba45237499c4f927a72b2d/replay-np075-val-sub.log b/shared/package-files/9e/9e74b2978423c763f4b01a99b75c958f82547bd1bbba45237499c4f927a72b2d/replay-np075-val-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..4269d9ab055c51d197bc4f668e781a715596c1b7 --- /dev/null +++ b/shared/package-files/9e/9e74b2978423c763f4b01a99b75c958f82547bd1bbba45237499c4f927a72b2d/replay-np075-val-sub.log @@ -0,0 +1,15 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 1, "workers": 12} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 6.44422207493335} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 6.857953467988409} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 42.45025485905353, "per_second": 1507.647014428948} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 88.20078232104424, "per_second": 1451.234293297871} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 136.399599345983, "per_second": 1407.6287681240497} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 191.6797953620553, "per_second": 1335.5606912896228} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 243.5009882140439} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 4.1627985830418766, "total_seconds": 267.20400326896925} + +real 4m28.988s +user 20m39.295s +sys 0m34.211s diff --git a/shared/package-files/9e/9e954ac5426fd88e8597062935f424ab42beae502f7658b76163d0989a704585/swap-grid2.sh b/shared/package-files/9e/9e954ac5426fd88e8597062935f424ab42beae502f7658b76163d0989a704585/swap-grid2.sh new file mode 100644 index 0000000000000000000000000000000000000000..9de43ffc69421bc14c2a93655382cd74cf3e7c00 --- /dev/null +++ b/shared/package-files/9e/9e954ac5426fd88e8597062935f424ab42beae502f7658b76163d0989a704585/swap-grid2.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# E71 (reference: release sjhb_7v0 = N5 at 0.75/0.05/0.5): inverse-branch weights (domain / other / other-single) for a swapped inverse branch inside the full release rule +# usage: swap-grid.sh NAME FIRST_CORE W1 W2 ... (W = D/O/S); two cores per setting +cd /workspace/research +export CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=2 +PY=/opt/glacier/bin/python +name=$1; c=$2; shift 2 +for w in "$@"; do + tag=${w//\//_} + ( $PY - < logs/swap-$name-w$tag.log 2>&1 + taskset -c $c-$((c+1)) $PY allcond/analysis/inv_swap.py compare --ref-pred evals/fullfold/swap-N5/pred --ref-term evals/netprop/term-swap-N5-w0.75_0.05_0.5.pkl --config builds/5Ms-N5-L-ion-net2/model_config.json --pred evals/fullfold/swap-$name/pred --term evals/netprop/term-swap-$name-w$tag.pkl --inverse-weights $w 2>/dev/null >> logs/swap-$name-w$tag.log ) & + c=$((c+2)) +done +wait +echo done > logs/swap-grid2-$name.done diff --git a/shared/package-files/9e/9eae25215a226237e0bd841a3d16313bd53648111c80420d762a2043a774b848/stack_members.py b/shared/package-files/9e/9eae25215a226237e0bd841a3d16313bd53648111c80420d762a2043a774b848/stack_members.py new file mode 100644 index 0000000000000000000000000000000000000000..17f883561b04e93542a9f00772cb37bf22cd0f42 --- /dev/null +++ b/shared/package-files/9e/9eae25215a226237e0bd841a3d16313bd53648111c80420d762a2043a774b848/stack_members.py @@ -0,0 +1,50 @@ +"""Select / concatenate forward members' saved simulations (development only). + +stack_members.py OUT_DIR PRED_DIR[:INDEX] [PRED_DIR[:INDEX] ...] + +Every PRED_DIR holds `masses.npy` [M, T, K] float32, `intens.npy` [M, T, K] float16 and +`done.npy` [T] as written by `infer.py --save-predictions`. `PRED_DIR` takes all of its members, +`PRED_DIR:i` member i only. OUT_DIR receives the concatenation along the member axis (memory +mapped, so a six-member stack never has to fit in RAM), the logical AND of the `done` masks and +a `MEMBERS` file naming the source of every member. No labels are read. +""" +import sys +from pathlib import Path + +import numpy as np + + +def main(): + out = Path(sys.argv[1]) + specs = [] + for item in sys.argv[2:]: + path, _, index = item.partition(':') + count = np.load(Path(path) / 'masses.npy', mmap_mode='r').shape[0] + chosen = [int(index)] if index else list(range(count)) + assert all(0 <= i < count for i in chosen), item + specs.extend((Path(path), i) for i in chosen) + assert specs, __doc__ + out.mkdir(parents=True, exist_ok=True) + first = np.load(specs[0][0] / 'masses.npy', mmap_mode='r') + shape = (len(specs),) + first.shape[1:] + done = np.ones(shape[1], dtype=bool) + for name, dtype in (('masses.npy', np.float32), ('intens.npy', np.float16)): + target = np.lib.format.open_memmap(out / (name + '.tmp'), mode='w+', dtype=dtype, shape=shape) + for slot, (path, index) in enumerate(specs): + source = np.load(path / name, mmap_mode='r') + assert source.shape[1:] == shape[1:] and source.dtype == dtype, (path, source.shape, source.dtype) + step = 262144 + for low in range(0, shape[1], step): + target[slot, low:low + step] = source[index, low:low + step] + target.flush() + del target + (out / (name + '.tmp')).rename(out / name) + for path, _ in specs: + done &= np.load(path / 'done.npy') + np.save(out / 'done.npy', done) + (out / 'MEMBERS').write_text(''.join(f'{path}:{index}\n' for path, index in specs)) + print(f'{out}: members {shape[0]}, tasks {shape[1]}, done {int(done.sum())}') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/9e/9ee15ad891e10036cda96e0994f1ebc46276ac1c8c64f7eb4d540980bfe3d904/massterm.py b/shared/package-files/9e/9ee15ad891e10036cda96e0994f1ebc46276ac1c8c64f7eb4d540980bfe3d904/massterm.py new file mode 100644 index 0000000000000000000000000000000000000000..ca242f965227f6178fa2a168e74c7d1d81e21c77 --- /dev/null +++ b/shared/package-files/9e/9ee15ad891e10036cda96e0994f1ebc46276ac1c8c64f7eb4d540980bfe3d904/massterm.py @@ -0,0 +1,149 @@ +"""Precursor-mass agreement term (development study). + +fit: massterm.py fit OUT.json + Fits, on the TRAIN fold only, the distribution of the signed difference + precursor_mz - (candidate exact mass + adduct shift) for the labelled molecule, + per reporting stratum (adduct, energy recorded, instrument, decimals of precursor_mz), + with back-off to coarser strata. +eval: massterm.py eval MODEL.json INPUT_ROOT SCORELAB_CACHE.pkl VARIANT [LAMBDA,...] + Combines pool-mean spectral distance with lambda * pool-mean negative log-likelihood + of each candidate's mass error and evaluates on validation (model selection only). +""" +import collections +import hashlib +import json +import pickle +import sys +from pathlib import Path + +import numpy as np + +E = 0.000548579909 +SHIFT = {'[M+H]+': 1.00782503223 - E, '[M+Na]+': 22.989769282 - E} +WIDTH, HALF = 0.0002, 100 # 0.2 mDa bins over +-20 mDa +FLOOR, MIN_COUNT, SMOOTH = 0.01, 300, 1.0 + + +def decimals(value): + text = repr(float(value)) + return min(len(text.split('.')[-1]), 4) if '.' in text and 'e' not in text else 0 + + +def strata(q): + dec = decimals(q['precursor_mz']) + inst = q['instrument_type'] or 'none' + ce = 'ce' if q['collision_energy'] is not None else 'ceNA' + return [f"{q['adduct']}|{ce}|{inst}|{dec}", f'{ce}|{inst}|{dec}', f'{inst}|{dec}', f'd{dec}', 'all'] + + +def bin_index(err): + """Bin of a signed error in Da; 0 and 2*HALF+1 are the outside bins.""" + idx = np.floor(np.asarray(err) / WIDTH + 0.5).astype(np.int64) + HALF + 1 + return np.clip(idx, 0, 2 * HALF + 2) + + +def fit(out): + from rdkit import Chem, RDLogger + from rdkit.Chem.Descriptors import ExactMolWt + RDLogger.DisableLog('rdApp.*') + cache, errors = {}, collections.defaultdict(list) + for line in open('/workspace/data/train.jsonl'): + r = json.loads(line) + smi = r['target_smiles'] + if smi not in cache: + mol = Chem.MolFromSmiles(smi) + cache[smi] = ExactMolWt(mol) if mol is not None else None + if cache[smi] is None or r['adduct'] not in SHIFT: + continue + err = r['precursor_mz'] - (cache[smi] + SHIFT[r['adduct']]) + for key in strata(r): + errors[key].append(err) + kernel = np.exp(-0.5 * (np.arange(-4, 5) / SMOOTH) ** 2) + kernel /= kernel.sum() + table = {} + for key, values in errors.items(): + if len(values) < MIN_COUNT and key != 'all': + continue + counts = np.bincount(bin_index(values), minlength=2 * HALF + 3).astype(float) + inside = np.convolve(counts[1:-1], kernel, mode='same') + prob = np.concatenate([[counts[0]], inside, [counts[-1]]]) / counts.sum() + prob = (1 - FLOOR) * prob + FLOOR / len(prob) + table[key] = {'count': len(values), 'neg_log_prob': [round(float(v), 5) for v in -np.log(prob)]} + Path(out).write_text(json.dumps({'width': WIDTH, 'half': HALF, 'floor': FLOOR, 'min_count': MIN_COUNT, + 'smooth_bins': SMOOTH, 'shift': SHIFT, 'fit': 'MassSpecGym v1.5 train fold', + 'strata': table})) + for key in sorted(table): + nlp = np.array(table[key]['neg_log_prob']) + print(f"{key:36s} n={table[key]['count']:6d} min nlp {nlp.min():.2f} at {(nlp.argmin() - HALF - 1) * WIDTH * 1000:+.1f} mDa " + f"p(|err|<=0.5mDa)={np.exp(-nlp[HALF - 1:HALF + 4]).sum():.3f} p(outside)={np.exp(-nlp[0]) + np.exp(-nlp[-1]):.3f}") + + +def penalties(model, query, masses): + table = next(model['strata'][k] for k in strata(query) if k in model['strata']) + nlp = np.asarray(table['neg_log_prob']) + err = float(query['precursor_mz']) - (masses + SHIFT[query['adduct']]) + out = np.full(len(masses), nlp.max()) + ok = np.isfinite(err) + out[ok] = nlp[bin_index(err[ok])] + return out + + +def evaluate(model_path, root, cache_path, variant, lambdas): + sys.path.insert(0, '/workspace/research/allcond/analysis') + import scorelab + import infer + model = json.loads(Path(model_path).read_text()) + root = Path(root) + queries = list(infer.read_jsonl(root / 'queries.jsonl')) + pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(root / 'candidate_pools.jsonl')} + ev = scorelab.Evaluator(queries, pools) + results = pickle.load(open(cache_path, 'rb')) + dist, fallback = results[variant], results[next(iter(results))] + masses = pickle.load(open(f'/workspace/research/cache/{root.name}-candidate-masses.pkl', 'rb')) + spectral, mass_term = {}, {} + for pid, members in ev.by_pool.items(): + ids, ms = masses[pid] + assert (ids == ev.ids[pid]).all() + ds = [dist[i] if dist[i] is not None else fallback[i] for i in members] + ds = [d for d in ds if d is not None] + spectral[pid] = np.mean(ds, axis=0) if ds else np.zeros(len(ids)) + mass_term[pid] = np.mean([penalties(model, queries[i], ms) for i in members], axis=0) + + def ranks(lam, spectral_weight=1.0): + rank = np.zeros(len(queries), dtype=np.int64) + for pid, members in ev.by_pool.items(): + final = spectral_weight * spectral[pid] + lam * mass_term[pid] + order = np.lexsort((ev.ids[pid], final)) + for i in members: + rank[i] = int(np.where(order == ev.target[i])[0][0]) + return rank + + base = ranks(0.0) + print(ev.line('agg spectral only', base, base)) + print(ev.line('agg mass term only', ranks(1.0, 0.0), base)) + best = None + for lam in lambdas: + r = ranks(lam) + print(ev.line(f'agg spectral + {lam:g} * mass', r, base), flush=True) + if best is None or (r == 0).mean() > best[1]: + best = (lam, (r == 0).mean(), r) + lam, _, r = best + keys = collections.defaultdict(list) + for i, q in enumerate(queries): + keys[(q['adduct'], 'ce' if q['collision_energy'] is not None else 'ceNA', q['instrument_type'] or 'none')].append(i) + print(f'--- strata at lambda={lam:g}: hit@1 spectral -> combined') + for key, idx in sorted(keys.items()): + idx = np.array(idx) + print(f'{str(key):38s} n={len(idx):6d} {np.mean(base[idx] == 0):.3f} -> {np.mean(r[idx] == 0):.3f}') + sizes = np.array([len(ev.by_pool[q['candidate_pool_id']]) for q in queries]) + for lo, hi in ((1, 2), (2, 4), (4, 8), (8, 16), (16, 10 ** 6)): + m = (sizes >= lo) & (sizes < hi) + print(f'pool_n [{lo},{hi}) n={m.sum():6d} {np.mean(base[m] == 0):.3f} -> {np.mean(r[m] == 0):.3f}') + + +if __name__ == '__main__': + if sys.argv[1] == 'fit': + fit(sys.argv[2]) + else: + lams = [float(v) for v in sys.argv[6].split(',')] if len(sys.argv) > 6 else [0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5] + evaluate(sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], lams) diff --git a/shared/package-files/9e/9ef339b274593aa17875423fc7209147a95cf6ccd976ef36df95674b13f5c62d/fullfold-5Ms-I1+I3x2-L-saved-simulations.log b/shared/package-files/9e/9ef339b274593aa17875423fc7209147a95cf6ccd976ef36df95674b13f5c62d/fullfold-5Ms-I1+I3x2-L-saved-simulations.log new file mode 100644 index 0000000000000000000000000000000000000000..0942c0ff333bd0e0514934ec423f3cfe87b68b4e --- /dev/null +++ b/shared/package-files/9e/9ef339b274593aa17875423fc7209147a95cf6ccd976ef36df95674b13f5c62d/fullfold-5Ms-I1+I3x2-L-saved-simulations.log @@ -0,0 +1,9 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 5, "inverse_members": 3, "library": true, "workers": 7} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 74.52355299900228} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 78.58019782400515} +{"event": "candidate_store", "pools": 3386, "pairs": 1066979, "seconds": 106.84809924900765} +{"event": "library", "scored": 19429, "search_seconds": 99.24206466299074, "seconds": 104.1841156139999} +{"event": "inverse_annotated", "pools": 3386, "pairs": 1066979, "formulae": 161754, "unsupported_candidates": 7534, "seconds": 0.0013015500007895753} +{"event": "inverse", "scored": 19429, "seconds": 43.40558542999497} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 24.745926229996257, "total_seconds": 378.0200592089968} +{"event": "measured", "exit_code": 0, "wall_seconds": 380.2, "user_seconds": 1497.8, "system_seconds": 34.8, "max_rss_gib": 10.83} diff --git a/shared/package-files/9f/9f0aabaf865f8a5d8dba30565c93b70a34e5f0218cbdc45d160d9f0e54d6aec8/train-queue.sh b/shared/package-files/9f/9f0aabaf865f8a5d8dba30565c93b70a34e5f0218cbdc45d160d9f0e54d6aec8/train-queue.sh new file mode 100644 index 0000000000000000000000000000000000000000..14a8d8d75d00b1f108d40797f1a3d3b0954c760a --- /dev/null +++ b/shared/package-files/9f/9f0aabaf865f8a5d8dba30565c93b70a34e5f0218cbdc45d160d9f0e54d6aec8/train-queue.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Sequential queue of inverse-network training runs (one GPU training job at a time). +# logs/train-queue.txt: one run per line, "NAME EXTRA-ARGS..." on top of the common I9b recipe; lines may be appended while it runs. +cd /workspace/research +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps GLACIER_SOURCE=/workspace/research/ms-pred/src OMP_NUM_THREADS=4 +COMMON="--real-frac 0.08 --extra-store inv/selfsim/corpus2+train3.npz --extra-frac 0.5 --batch 512 --lr 0.0006 --warmup 2000 --dim 512 --layers 6 --heads 8 --dropout 0.1" +done_lines=0; idle=0 +while [ $idle -lt 720 ]; do + total=$(wc -l < logs/train-queue.txt) + if [ $done_lines -lt $total ]; then + line=$(sed -n "$((done_lines+1))p" logs/train-queue.txt) + done_lines=$((done_lines+1)); idle=0 + [ -z "$line" ] && continue + name=${line%% *}; extra=${line#* } + while [ -n "$(ps -eo args | grep '[t]rain_inv.py')" ]; do sleep 5; done + echo "$(date -u +%H:%M:%S) start $name" >> logs/train-queue.log + taskset -c 3-10 /opt/glacier/bin/python allcond/inv/train_inv.py --out runs/$name $COMMON $extra >> logs/$name.log 2>&1 + echo "$(date -u +%H:%M:%S) end $name ($?)" >> logs/train-queue.log + else + sleep 10; idle=$((idle+1)) + fi +done diff --git a/shared/package-files/9f/9f3a634025466bb6777a2b7b989c999b3f8b7987748ef5b747dcea1d1da6d55c/I28-ff512x6-real08-corpus2+train3-noise05-s3.log b/shared/package-files/9f/9f3a634025466bb6777a2b7b989c999b3f8b7987748ef5b747dcea1d1da6d55c/I28-ff512x6-real08-corpus2+train3-noise05-s3.log new file mode 100644 index 0000000000000000000000000000000000000000..c57f678c705a9c45d81c9a65f05052b46f1f043a --- /dev/null +++ b/shared/package-files/9f/9f3a634025466bb6777a2b7b989c999b3f8b7987748ef5b747dcea1d1da6d55c/I28-ff512x6-real08-corpus2+train3-noise05-s3.log @@ -0,0 +1,12 @@ +{"extra_rows": 2031301, "extra_structures": 434950} +{"args": {"store": "/workspace/research/inv", "out": "runs/I28-ff512x6-real08-corpus2+train3-noise05-s3", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/selfsim/corpus2+train3.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 3, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "noise_rate": 0.5, "noise_max": 12, "noise_scatter": 0.35, "noise_shape": 3.0, "noise_real_rate": 0.0, "synth_peak_drop": -1.0, "synth_jitter": -1.0, "synth_rank_drop": 0.0, "rank_keep": "inv/rank_keep.json", "noise_near": 0.0, "noise_deltas": "inv/noise_deltas.json", "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"gen-lm1.manifest.json": null, "gen-lmtest.manifest.json": null, "gen-x1.manifest.json": null, "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc"}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 69.46886807703413, "extra_store": {"path": "inv/selfsim/corpus2+train3.npz", "rows": 2031301, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/selfsim/train3.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 17.868643710809152, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 43.40271363919601}], "spectra": 2031301, "structures": 434950}}} +{"step": 5000, "elapsed": 242.54294678999577, "val_loss": 0.03541027282906472, "val_cos": 0.6515443336455009, "val_loss_ema": 0.03493182666143796, "val_cos_ema": 0.6554919376419431} +{"step": 10000, "elapsed": 408.21700230799615, "val_loss": 0.03130828089338304, "val_cos": 0.6960665475899429, "val_loss_ema": 0.030320411543512598, "val_cos_ema": 0.7064068310418704, "ind_cos": 0.4567399248545988, "agg_cos": 0.48942302743321836, "ind_nll": 0.31087549539348397, "agg_nll": 0.28761130269185237, "retrieval_seconds": 14.802102064015344} +{"step": 15000, "elapsed": 593.202366107027, "val_loss": 0.03156967434035664, "val_cos": 0.7028823609862351, "val_loss_ema": 0.02874237442232576, "val_cos_ema": 0.7274126884063449} +{"step": 20000, "elapsed": 752.4141254179412, "val_loss": 0.030863478435430164, "val_cos": 0.714868466897904, "val_loss_ema": 0.02797959832439789, "val_cos_ema": 0.7392107662032271, "ind_cos": 0.5144371815327603, "agg_cos": 0.538936641103505, "ind_nll": 0.4035205105769726, "agg_nll": 0.38982963611096816, "retrieval_seconds": 11.441061259945855} +{"step": 25000, "elapsed": 919.5905075840419, "val_loss": 0.029266719866218628, "val_cos": 0.7316565244869944, "val_loss_ema": 0.027736577624932045, "val_cos_ema": 0.7444692956566216} +{"step": 30000, "elapsed": 1023.1022429979639, "val_loss": 0.027286817572354793, "val_cos": 0.7477271888792205, "val_loss_ema": 0.027037201406804906, "val_cos_ema": 0.7519193230399789, "ind_cos": 0.5289515672448402, "agg_cos": 0.5521642904935921, "ind_nll": 0.431880179113696, "agg_nll": 0.4153584847393072, "retrieval_seconds": 11.39468296407722} +{"step": 35000, "elapsed": 1133.5926470980048, "val_loss": 0.028758131130594892, "val_cos": 0.7414264658339338, "val_loss_ema": 0.027503804715320646, "val_cos_ema": 0.7504041156261259} +{"step": 40000, "elapsed": 1234.0345112410141, "val_loss": 0.02757475427545788, "val_cos": 0.7514201975180465, "val_loss_ema": 0.027477592096393038, "val_cos_ema": 0.7518987654167095, "ind_cos": 0.533326470739616, "agg_cos": 0.5608111585773843, "ind_nll": 0.44258582531267693, "agg_nll": 0.42122600236759483, "retrieval_seconds": 11.336928524891846} +{"step": 45000, "elapsed": 1343.9721002919832, "val_loss": 0.027570541988920397, "val_cos": 0.7527546461233852, "val_loss_ema": 0.027459995286071643, "val_cos_ema": 0.7532161119894873} +{"step": 50000, "elapsed": 1441.0221368370112, "val_loss": 0.027193645815196718, "val_cos": 0.7554969903438481, "val_loss_ema": 0.027254025194573633, "val_cos_ema": 0.7550198926419592, "ind_cos": 0.5372381491584745, "agg_cos": 0.5720314993051624, "ind_nll": 0.444747542333625, "agg_nll": 0.4278655617890782, "retrieval_seconds": 11.273115969030187} diff --git a/shared/package-files/9f/9f6df9e63b6c66feb2bad14dc0aaa816506325e15eea3d03720b210e35a4d4d3/build-5Ms-I1+I3x2-L.log b/shared/package-files/9f/9f6df9e63b6c66feb2bad14dc0aaa816506325e15eea3d03720b210e35a4d4d3/build-5Ms-I1+I3x2-L.log new file mode 100644 index 0000000000000000000000000000000000000000..504a56466a2f31f74486c2f4b82d77acb460c1e2 --- /dev/null +++ b/shared/package-files/9f/9f6df9e63b6c66feb2bad14dc0aaa816506325e15eea3d03720b210e35a4d4d3/build-5Ms-I1+I3x2-L.log @@ -0,0 +1,286 @@ +{ + "built": "/run-state/workspace/research/builds/5Ms-I1+I3x2-L", + "checkpoint_sha256": "4ffa8ea9f5153437613890358e2cb23410064c1daa236232f75f828b30842e75", + "members": [ + { + "source": "runs/B-all-b32/checkpoints/step-0020000-ema.ckpt", + "sha256": "80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 5136.2172065590275, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B-all-b32/checkpoints/step-0030000-ema.ckpt", + "sha256": "0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8314.79353913304, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0020000-ema.ckpt", + "sha256": "ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 6945.18486677701, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0030000-ema.ckpt", + "sha256": "f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 9298.063542745003, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/S2-B20k-synth/checkpoints/step-0030000-ema.ckpt", + "sha256": "44742fa31f337e59b543d903018780560569c2e8e50a008ba008859c8440e3a2", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8906.84206694903, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "own-checkpoint:6c5a43fada335e5f4e9f8265ec6cfd54a8f317eb8d2100d96ea3731809005be2", + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus (auxiliary intensity term)", + "synthetic": { + "manifest_sha256": "431454e702f8da3194684fc9a565135d29a38a407aaa31e9399d871360c6e962", + "per_item": 1, + "weight": 1.0, + "schedule": "e2e", + "instrument": "flag" + } + } + ], + "config": { + "sparse_k": 100, + "inference_batch_size": 128, + "workers": 14, + "num_bins": 150000, + "upper_limit": 1500, + "max_observed_peaks": 50, + "observed_intensity_threshold": 0.001, + "ensemble": "prediction", + "pool_aggregation": 1.0, + "autocast": false, + "model": { + "pe_embed_k": 14, + "embed_elem_group": true, + "multi_hop_max_dist": 10 + }, + "checkpoint": "model.pt", + "views": [ + { + "precursor_window": 0.5, + "pred_power": 0.75, + "match_ppm": 20, + "match_floor_mda": 4, + "match_by_instrument": { + "Orbitrap": [ + 10, + 1 + ] + } + } + ], + "inverse": { + "pooled": true, + "weight_domain": 0.75, + "weight_other": 0.05, + "weight_other_single": 0.5, + "batch": 2048 + }, + "library": { + "kind": "sum", + "k": 20, + "top": 32, + "power": 6, + "debias": true, + "weight_domain": 0.0, + "weight_other": 0.4, + "weight_other_single": 0.0 + }, + "inverse_members": [ + { + "source": "runs/I1-ff512x6/step-0050000-ema.pt", + "sha256": "c131cac451c9d360d13a7576304a4f3ce59c4e542d10ec5e8e4b943838ba385b", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I1-ff512x6", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.2, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I3-ff512x6-real08/step-0030000-ema.pt", + "sha256": "27125fd05eb958236b7f815eb97d8ae9b148aedd5c552067361a7bc116dffbae", + "step": 30000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I3-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I3-ff512x6-real08/step-0100000-ema.pt", + "sha256": "d3a914a9bf011751408a2739cb18b0312df430fd31447b9115b0010861ab08e3", + "step": 100000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus", + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "/workspace/research/runs/I3-ff512x6-real08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "max_steps_this_run": 0 + } + } + ], + "library_asset": { + "schema": "train-library/v1", + "fold": "train", + "spectra": 194119, + "molecules": 25046, + "bin": 0.01, + "prior_sample": 1024, + "prior_seed": 0, + "fragment_entries": 6765621, + "loss_entries": 6763777, + "source": "/workspace/data/train.jsonl", + "source_sha256": "de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc", + "structure_store": "/run-state/workspace/research/inv/real-train.npz", + "structure_store_sha256": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "sha256": "22d1ddb216eef78d5040209ff6526371e5fcd8aac88e68a36823b6d5e73b3712", + "elapsed_seconds": 13.499361125999712, + "training_data": "MassSpecGym v1.5 train fold" + }, + "method": "native-glacier-all-conditions-forward-simulation+formula-transformer-inverse-fusion+train-library-neighbour-fusion", + "inference_runtime": "/opt/glacier/bin/python" + } +} diff --git a/shared/package-files/9f/9f8be162709817f2af70168bd1bde2572811cdbd1316dc0bf27d2fe1ad44bae9/replay-5Ms-I9b-L-val-tiny.log b/shared/package-files/9f/9f8be162709817f2af70168bd1bde2572811cdbd1316dc0bf27d2fe1ad44bae9/replay-5Ms-I9b-L-val-tiny.log new file mode 100644 index 0000000000000000000000000000000000000000..c6b1c51cbe6343c8a1886c139413148a46004c4d --- /dev/null +++ b/shared/package-files/9f/9f8be162709817f2af70168bd1bde2572811cdbd1316dc0bf27d2fe1ad44bae9/replay-5Ms-I9b-L-val-tiny.log @@ -0,0 +1,13 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 5, "inverse_members": 1, "library": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.5615926090395078} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 1.5859557820367627} +{"event": "candidate_store", "pools": 40, "pairs": 9390, "seconds": 1.1386015979805961} +{"event": "library", "scored": 180, "search_seconds": 0.8988198260194622, "seconds": 1.5755092130275443} +{"event": "inverse_annotated", "pools": 40, "pairs": 9390, "formulae": 1921, "unsupported_candidates": 75, "seconds": 7.023900980129838e-05} +{"event": "inverse", "scored": 180, "seconds": 0.6580775289912708} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 188.2530249650008} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 0.9126092650112696, "total_seconds": 209.18898224201985} +{"event": "measured", "exit_code": 0, "wall_seconds": 211.0, "user_seconds": 309.0, "system_seconds": 8.6, "max_rss_gib": 2.49} +{"event": "replay_checked", "exit_code": 0, "package_files": 268, "package_unchanged": true, "processes_left": 0, "rankings": 180} diff --git a/shared/package-files/9f/9fee6f2dc24dcd3b232206967a1e8e6d0de42fd196a09c357ba71852d2e4bc9c/replay-B20k-np075-val-sub.log b/shared/package-files/9f/9fee6f2dc24dcd3b232206967a1e8e6d0de42fd196a09c357ba71852d2e4bc9c/replay-B20k-np075-val-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..ed9041e83b9ab5e46e80679fb8d74667fe230fe1 --- /dev/null +++ b/shared/package-files/9f/9fee6f2dc24dcd3b232206967a1e8e6d0de42fd196a09c357ba71852d2e4bc9c/replay-B20k-np075-val-sub.log @@ -0,0 +1,15 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 1, "workers": 12} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 6.728387506096624} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 7.077059906092472} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 105.18434894806705, "per_second": 608.4555415330743} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 234.63516555295791, "per_second": 545.5277758487143} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 371.06406886701006, "per_second": 517.4308592751757} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 457.70054619398434, "per_second": 559.3176633254467} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 527.8239706699969} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 7.24496055894997, "total_seconds": 555.018430055934} + +real 9m17.441s +user 28m39.352s +sys 0m39.009s diff --git a/shared/package-files/9f/9fee6f2dc24dcd3b232206967a1e8e6d0de42fd196a09c357ba71852d2e4bc9c/replay-np075-val-sub.log b/shared/package-files/9f/9fee6f2dc24dcd3b232206967a1e8e6d0de42fd196a09c357ba71852d2e4bc9c/replay-np075-val-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..ed9041e83b9ab5e46e80679fb8d74667fe230fe1 --- /dev/null +++ b/shared/package-files/9f/9fee6f2dc24dcd3b232206967a1e8e6d0de42fd196a09c357ba71852d2e4bc9c/replay-np075-val-sub.log @@ -0,0 +1,15 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 1, "workers": 12} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 6.728387506096624} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 7.077059906092472} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 105.18434894806705, "per_second": 608.4555415330743} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 234.63516555295791, "per_second": 545.5277758487143} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 371.06406886701006, "per_second": 517.4308592751757} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 457.70054619398434, "per_second": 559.3176633254467} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 527.8239706699969} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 7.24496055894997, "total_seconds": 555.018430055934} + +real 9m17.441s +user 28m39.352s +sys 0m39.009s diff --git a/shared/package-files/a6/a6579860d96ff0d5fb45a33a3b84f38d4ed0b7caf73ba8c38b378d18e622b35b/release-rule-7M-B4s.log b/shared/package-files/a6/a6579860d96ff0d5fb45a33a3b84f38d4ed0b7caf73ba8c38b378d18e622b35b/release-rule-7M-B4s.log new file mode 100644 index 0000000000000000000000000000000000000000..7464d012785db1cecb44833733a06190584728b0 --- /dev/null +++ b/shared/package-files/a6/a6579860d96ff0d5fb45a33a3b84f38d4ed0b7caf73ba8c38b378d18e622b35b/release-rule-7M-B4s.log @@ -0,0 +1,13 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.161, to the average candidate 0.102 + domain: label 0.153, candidate 0.105, best similarity median 0.442 + other: label 0.168, candidate 0.098, best similarity median 0.444 +--- neighbour branch alone (per spectrum / pool mean) +frag k=20 p=6 debias ind all=0.1356 dom=0.1437 non=0.1274 | pool all=0.1965 dom=0.1713 non=0.2219 +loss k=20 p=6 debias ind all=0.0691 dom=0.0593 non=0.0789 | pool all=0.1212 dom=0.0784 non=0.1642 +sum k=20 p=6 debias ind all=0.1682 dom=0.1791 non=0.1573 | pool all=0.2540 dom=0.2259 non=0.2821 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7481 dom=0.9089 non=0.5867 h5=0.8744 h20=0.9313 macro=0.8379 | +0.0000 [+0.0000,+0.0000] | ind 0.6012 +0.0000 [+0.0000,+0.0000] +forward 7M-B4s-ensmean.pkl all=0.7502 dom=0.9110 non=0.5888 h5=0.8723 h20=0.9362 macro=0.8408 | +0.0021 [-0.0040,+0.0085] | ind 0.6043 +0.0030 [+0.0001,+0.0057] + pools +33 -23 | macro +0.0030 [-0.0015,+0.0074] | without top 20 +0.0024 [-0.0044,+0.0099] | weight min(n,30) +0.0020 [-0.0046,+0.0092] +sum k=20 p=6 debias u=0/0 all=0.7502 dom=0.9110 non=0.5888 h5=0.8723 h20=0.9362 macro=0.8408 | +0.0021 [-0.0040,+0.0085] | ind 0.6043 +0.0030 [+0.0001,+0.0057] + pools +33 -23 | macro +0.0030 [-0.0015,+0.0074] | without top 20 +0.0024 [-0.0044,+0.0099] | weight min(n,30) +0.0020 [-0.0046,+0.0092] diff --git a/shared/package-files/a6/a6b407fd6258961cff41b72368241858306d1c8cc30b488c0f384f9703991787/eval-score-I16+I18.log b/shared/package-files/a6/a6b407fd6258961cff41b72368241858306d1c8cc30b488c0f384f9703991787/eval-score-I16+I18.log new file mode 100644 index 0000000000000000000000000000000000000000..e292c3908824f8f3974ddd4e8c8e0c868a695eff --- /dev/null +++ b/shared/package-files/a6/a6b407fd6258961cff41b72368241858306d1c8cc30b488c0f384f9703991787/eval-score-I16+I18.log @@ -0,0 +1,41 @@ +19429 queries, 2 members, 82.8 s +cos pool rule all=0.6102 dom=0.8502 non=0.3693 h5=0.7177 macro=0.7315 +cen pool rule all=0.5922 dom=0.8248 non=0.3585 h5=0.7067 macro=0.7032 +cos_pm pool rule all=0.6077 dom=0.8486 non=0.3659 h5=0.7165 macro=0.7295 +dot pool rule all=0.6238 dom=0.8086 non=0.4383 h5=0.7502 macro=0.7106 +geo pool rule all=0.5941 dom=0.8371 non=0.3501 h5=0.7028 macro=0.7191 +idf05 pool rule all=0.6092 dom=0.8462 non=0.3713 h5=0.7263 macro=0.7277 +idf1 pool rule all=0.6115 dom=0.8475 non=0.3744 h5=0.7359 macro=0.7271 +lin pool rule all=0.5656 dom=0.7981 non=0.3322 h5=0.6865 macro=0.6831 +log01 pool rule all=0.6045 dom=0.8445 non=0.3636 h5=0.7615 macro=0.7268 +log05 pool rule all=0.6497 dom=0.8571 non=0.4415 h5=0.7613 macro=0.7374 +log20 pool rule all=0.6156 dom=0.8528 non=0.3775 h5=0.7309 macro=0.7333 +nll02 pool rule all=0.4596 dom=0.7321 non=0.1861 h5=0.5981 macro=0.5930 +nll10 pool rule all=0.4220 dom=0.6688 non=0.1743 h5=0.5631 macro=0.5440 +poolcen pool rule all=0.5904 dom=0.8106 non=0.3693 h5=0.7229 macro=0.7041 +pow020 pool rule all=0.5787 dom=0.8096 non=0.3468 h5=0.7485 macro=0.6988 +pow030 pool rule all=0.5980 dom=0.8228 non=0.3723 h5=0.7524 macro=0.7091 +pow040 pool rule all=0.6062 dom=0.8387 non=0.3728 h5=0.7626 macro=0.7245 +pow05 pool rule all=0.6155 dom=0.8475 non=0.3825 h5=0.7607 macro=0.7339 +pow05idf025 pool rule all=0.6442 dom=0.8491 non=0.4386 h5=0.7660 macro=0.7336 +pow05idf05 pool rule all=0.6447 dom=0.8492 non=0.4394 h5=0.7689 macro=0.7357 +pow05m pool rule all=0.6151 dom=0.8467 non=0.3825 h5=0.7606 macro=0.7333 +pow05s pool rule all=0.6162 dom=0.8514 non=0.3800 h5=0.7532 macro=0.7318 +pow060 pool rule all=0.6199 dom=0.8531 non=0.3858 h5=0.7301 macro=0.7360 +pow060idf025 pool rule all=0.6493 dom=0.8540 non=0.4437 h5=0.7619 macro=0.7366 +pow060idf050 pool rule all=0.6468 dom=0.8532 non=0.4396 h5=0.7707 macro=0.7354 +pow060m pool rule all=0.6223 dom=0.8543 non=0.3894 h5=0.7299 macro=0.7377 +pow065 pool rule all=0.6174 dom=0.8518 non=0.3822 h5=0.7289 macro=0.7363 +pow070 pool rule all=0.6153 dom=0.8516 non=0.3781 h5=0.7263 macro=0.7339 +pow070idf025 pool rule all=0.6203 dom=0.8548 non=0.3847 h5=0.7325 macro=0.7377 +pow070idf050 pool rule all=0.6160 dom=0.8527 non=0.3784 h5=0.7357 macro=0.7348 +pow070m pool rule all=0.6157 dom=0.8527 non=0.3777 h5=0.7265 macro=0.7351 +pow075 pool rule all=0.6144 dom=0.8509 non=0.3769 h5=0.7246 macro=0.7318 +pow080 pool rule all=0.6124 dom=0.8504 non=0.3735 h5=0.7263 macro=0.7312 +pow080m pool rule all=0.6134 dom=0.8508 non=0.3749 h5=0.7242 macro=0.7324 +pow085 pool rule all=0.6117 dom=0.8491 non=0.3733 h5=0.7241 macro=0.7304 +pow085idf025 pool rule all=0.6121 dom=0.8490 non=0.3742 h5=0.7297 macro=0.7318 +pow085idf050 pool rule all=0.6126 dom=0.8507 non=0.3735 h5=0.7345 macro=0.7327 +pow090 pool rule all=0.6096 dom=0.8483 non=0.3699 h5=0.7227 macro=0.7289 +pow2 pool rule all=0.5728 dom=0.8118 non=0.3327 h5=0.6961 macro=0.6973 +tani pool rule all=0.5921 dom=0.8240 non=0.3592 h5=0.7141 macro=0.7112 diff --git a/shared/package-files/b0/b0027ad56da9240665bad6c38007539af4a2df9d3fa0263cbab7172c4ee8a3b0/library.py b/shared/package-files/b0/b0027ad56da9240665bad6c38007539af4a2df9d3fa0263cbab7172c4ee8a3b0/library.py new file mode 100644 index 0000000000000000000000000000000000000000..0c6d7cbc2beff5d86d754bab22137214951418a4 --- /dev/null +++ b/shared/package-files/b0/b0027ad56da9240665bad6c38007539af4a2df9d3fa0263cbab7172c4ee8a3b0/library.py @@ -0,0 +1,177 @@ +"""Library-neighbour branch: structure evidence transferred from the most similar train-fold spectra. + +A memory-based component fitted on the MassSpecGym v1.5 train fold only. The library holds, for +every train-fold spectrum, its binned fragment and neutral-loss vectors and, for every train-fold +molecule, its 4096-bit Morgan fingerprint. At inference a query spectrum is compared with all +library spectra; the ``k`` most similar library molecules (plus any molecule tied with the k-th +one, among the ``top`` retrieved) vote for the candidates that resemble them: + + similarity(q, m) = max over spectra t of molecule m of + 0.5 * (fragment cosine(q, t) + neutral-loss cosine(q, t)) + score_q(c) = sum_j s_j^p * Tanimoto(c, m_j) / sum_j s_j^p - prior(c) + distance = -score_q(c) + +``prior(c)`` is the mean Tanimoto similarity of the candidate to a fixed sample of library +molecules: it removes the spectrum-free part of the score (how much a candidate resembles train +molecules in general), so the branch only carries evidence that depends on the query spectrum. + +Vectors: peaks at or above precursor - 0.5 Da are dropped, intensities are square-rooted, peaks +are binned at ``bin`` Da (fragment m/z, or precursor m/z - fragment m/z for the neutral-loss +view), rows are L2-normalised and query peaks are spread to the two adjacent bins. + +Nothing is fitted at inference. The library contains train-fold spectra and train-fold structures +only; it does not know any candidate pool, validation or test spectrum. +""" +import time + +import numpy as np +import scipy.sparse as sp + +MAX_MASS = 2000.0 +WINDOW = 0.5 + + +def spectrum_vectors(records, width, spread): + """CSR fragment and neutral-loss matrices [spectra, bins]; ``records`` = (mz, intensity, precursor).""" + bins = int(MAX_MASS / width) + 3 + out = [] + for kind in ('frag', 'loss'): + rows, cols, vals = [np.zeros(0, np.int64)], [np.zeros(0, np.int64)], [np.zeros(0, np.float64)] + for i, (mz, inten, precursor) in enumerate(records): + mz = np.asarray(mz, dtype=np.float64) + inten = np.asarray(inten, dtype=np.float64) + keep = (mz < precursor - WINDOW) & (inten > 0) + if not keep.any(): + continue + value = np.sqrt(inten[keep]) + mass = mz[keep] if kind == 'frag' else precursor - mz[keep] + index = np.rint(mass / width).astype(np.int64) + ok = (index > 0) & (index < bins - 1) + index, value = index[ok], value[ok] + if not len(index): + continue + uniq, inverse = np.unique(index, return_inverse=True) + merged = np.bincount(inverse, weights=value) + merged = merged / np.sqrt(np.sum(merged ** 2)) + for shift in ((-1, 0, 1) if spread else (0,)): + rows.append(np.full(len(uniq), i, dtype=np.int64)) + cols.append(uniq + shift) + vals.append(merged) + matrix = sp.csr_matrix((np.concatenate(vals).astype(np.float32), + (np.concatenate(rows), np.concatenate(cols))), shape=(len(records), bins)) + matrix.sum_duplicates() + out.append(matrix) + return out + + +def build(records, molecule, fingerprints, width, sample): + """Library asset (tensors only). ``records`` are train-fold spectra, ``molecule[i]`` the index of + spectrum i's structure in ``fingerprints`` (packed bits), ``sample`` the prior's molecule rows.""" + import torch + molecule = np.asarray(molecule) + if not np.all(np.diff(molecule) >= 0): + raise ValueError('library spectra must be ordered by molecule') + starts = np.flatnonzero(np.diff(molecule, prepend=-1) != 0) + if not np.array_equal(molecule[starts], np.arange(len(fingerprints))): + raise ValueError('every library molecule needs at least one spectrum') + frag, loss = spectrum_vectors(records, width, spread=False) + + def pack(matrix): + return {'indptr': torch.from_numpy(matrix.indptr.astype(np.int64)), + 'indices': torch.from_numpy(matrix.indices.astype(np.int32)), + 'data': torch.from_numpy(matrix.data.astype(np.float32)), + 'shape': [int(matrix.shape[0]), int(matrix.shape[1])]} + + return {'format': 'train-library/v1', 'bin': float(width), 'frag': pack(frag), 'loss': pack(loss), + 'starts': torch.from_numpy(starts.astype(np.int64)), + 'fingerprints': torch.from_numpy(np.ascontiguousarray(fingerprints, dtype=np.uint8)), + 'prior_sample': torch.from_numpy(np.asarray(sample, dtype=np.int64))} + + +def _csr(packed): + return sp.csr_matrix((packed['data'].numpy(), packed['indices'].numpy(), packed['indptr'].numpy()), + shape=tuple(packed['shape'])) + + +def neighbours(library, queries, top, kind='sum', chunk=400): + """Most similar library molecules of every query: (molecule rows [Q, top], similarities [Q, top]). + + Ties are broken by the lower molecule row (stable sort), independent of the chunking. + """ + width = float(library['bin']) + starts = library['starts'].numpy() + frag, loss = _csr(library['frag']).T.tocsr(), _csr(library['loss']).T.tocsr() + records = [(q['mzs'], q['intensities'], float(q['precursor_mz'])) for q in queries] + top = min(top, len(starts)) + molecules = np.zeros((len(queries), top), np.int64) + values = np.zeros((len(queries), top), np.float32) + for low in range(0, len(queries), chunk): + high = min(len(queries), low + chunk) + qf, ql = spectrum_vectors(records[low:high], width, spread=True) + if kind == 'frag': + sim = np.asarray((qf @ frag).todense(), dtype=np.float32) + elif kind == 'loss': + sim = np.asarray((ql @ loss).todense(), dtype=np.float32) + else: + sim = 0.5 * (np.asarray((qf @ frag).todense(), dtype=np.float32) + + np.asarray((ql @ loss).todense(), dtype=np.float32)) + per_molecule = np.maximum.reduceat(sim, starts, axis=1) + order = np.argsort(-per_molecule, axis=1, kind='stable')[:, :top] + molecules[low:high] = order + values[low:high] = np.take_along_axis(per_molecule, order, axis=1) + return molecules, values + + +def run(queries, data, library, options, device, log=None): + """Library-neighbour distances per query (candidate order); None when a query has no evidence. + + ``data`` is the candidate store of ``invrun.build_store`` (pool layout, candidate fingerprints). + """ + import torch + started = time.monotonic() + k, power = int(options.get('k', 20)), float(options.get('power', 6.0)) + top = max(k, int(options.get('top', 32))) + molecules, values = neighbours(library, queries, top, options.get('kind', 'sum'), int(options.get('chunk', 400))) + # the k most similar molecules vote, together with every molecule tied with the k-th one + # (identical spectra of different structures), so the vote does not depend on the library order + values = np.maximum(values.astype(np.float64), 0.0) + values = np.where(values >= values[:, min(k, values.shape[1]) - 1][:, None], values, 0.0) + searched = time.monotonic() - started + fingerprints = library['fingerprints'].numpy() + + def bits(packed): + return torch.from_numpy(np.unpackbits(packed, axis=1)).to(device=device, dtype=torch.float32) + + def tanimoto(a, b): + inter = a @ b.T + return inter / (a.sum(1)[:, None] + b.sum(1)[None, :] - inter).clamp_min(1.0) + + sample = bits(fingerprints[library['prior_sample'].numpy()]) + debias = bool(options.get('debias', True)) + query_pool = data['query_pool'] + members = {} + for index, slot in enumerate(query_pool): + if slot >= 0: + members.setdefault(int(slot), []).append(index) + out = [None] * len(queries) + start = data['pool_cand_start'] + for slot, rows in members.items(): + cand = bits(data['cand_fps'][start[slot]:start[slot + 1]]) + used, position = np.unique(molecules[rows], return_inverse=True) + position = torch.from_numpy(position.reshape(len(rows), -1)).to(device) + local = tanimoto(cand, bits(fingerprints[used])).double() # [candidates, used] + weight = torch.from_numpy(values[rows] ** power).to(device) + total = weight.sum(1) + scale = weight / total.clamp_min(1e-300)[:, None] # [spectra, k] + score = torch.einsum('cqk,qk->qc', local[:, position], scale) # [spectra, candidates] + if debias: + score = score - tanimoto(cand, sample).double().mean(1)[None, :] + score = score.cpu().numpy() + usable = (total > 0).cpu().numpy() + for n, index in enumerate(rows): + if usable[n]: + out[index] = -score[n] + if log: + log('library', scored=sum(d is not None for d in out), search_seconds=searched, + seconds=time.monotonic() - started) + return out diff --git a/shared/package-files/b0/b02c4bb3916c2ec6fa858930b2fe822a8a63e238cd1bb49a0030b562420a0b44/metrics.jsonl b/shared/package-files/b0/b02c4bb3916c2ec6fa858930b2fe822a8a63e238cd1bb49a0030b562420a0b44/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..9377e678674982950f35f381f0a19f8fa218b41b --- /dev/null +++ b/shared/package-files/b0/b02c4bb3916c2ec6fa858930b2fe822a8a63e238cd1bb49a0030b562420a0b44/metrics.jsonl @@ -0,0 +1,250 @@ +{"step": 200, "loss": 0.3298377270065248, "loss_real": 0.3283500629477203, "loss_synth": 0.32984541572630405, "lr": 5.999770185426209e-05, "elapsed": 26.78957955504302, "steps_per_second": 26.260318017490953, "loss_extra": 0.3300885006599128} +{"step": 400, "loss": 0.04828887648880482, "loss_real": 0.04370321985334158, "loss_synth": 0.04879639312624931, "lr": 0.0001199815230572914, "elapsed": 33.794265795033425, "steps_per_second": 27.35839492505076, "loss_extra": 0.04858016956597567} +{"step": 600, "loss": 0.04503978580236435, "loss_real": 0.039167468175292014, "loss_synth": 0.04556596163660288, "lr": 0.00017993754018322624, "elapsed": 40.82369788404321, "steps_per_second": 27.713404220283177, "loss_extra": 0.04553602878004313} +{"step": 800, "loss": 0.04285469967871904, "loss_real": 0.03548454632051289, "loss_synth": 0.043511097896844146, "lr": 0.0002398518371215969, "elapsed": 48.10660778300371, "steps_per_second": 27.650008961399827, "loss_extra": 0.043481489587575195} +{"step": 1000, "loss": 0.04184834836050868, "loss_real": 0.033979304516687986, "loss_synth": 0.04247339433059096, "lr": 0.0002997105087403322, "elapsed": 55.19991360499989, "steps_per_second": 27.75743099871302, "loss_extra": 0.042593028768897055} +{"step": 1200, "loss": 0.04088888878002763, "loss_real": 0.0330852359905839, "loss_synth": 0.041441110502928494, "lr": 0.00035949966454633923, "elapsed": 62.1643723550369, "steps_per_second": 27.91291842561265, "loss_extra": 0.041694725304841994} +{"step": 1400, "loss": 0.04003360034897924, "loss_real": 0.03222500703297555, "loss_synth": 0.04048407316207886, "lr": 0.0004192054323428467, "elapsed": 69.29991953005083, "steps_per_second": 27.929397897878147, "loss_extra": 0.04094161245971918} +{"step": 1600, "loss": 0.0393375457637012, "loss_real": 0.031679912181571124, "loss_synth": 0.039731170423328875, "lr": 0.0004788139618827038, "elapsed": 76.43971589399735, "steps_per_second": 27.93969690014706, "loss_extra": 0.04027593906968832} +{"step": 1800, "loss": 0.038700366709381345, "loss_real": 0.03118048045784235, "loss_synth": 0.03909924399107695, "lr": 0.000538311428516825, "elapsed": 83.65582478605211, "steps_per_second": 27.914637091020055, "loss_extra": 0.03960959861055016} +{"step": 2000, "loss": 0.03808518163859844, "loss_real": 0.030599278546869755, "loss_synth": 0.03844364613294601, "lr": 0.0005976840368369773, "elapsed": 90.64153834304307, "steps_per_second": 27.984547372020767, "loss_extra": 0.03902875173836946} +{"step": 2200, "loss": 0.037453918606042864, "loss_real": 0.030053149545565247, "loss_synth": 0.037727510519325734, "lr": 0.0005971982039200904, "elapsed": 97.57108489004895, "steps_per_second": 28.062097880711192, "loss_extra": 0.038467210996896026} +{"step": 2400, "loss": 0.036768848355859515, "loss_real": 0.029388576140627266, "loss_synth": 0.03700917748734355, "lr": 0.000596666387431128, "elapsed": 104.50288713001646, "steps_per_second": 28.126308954901933, "loss_extra": 0.037811702117323875} +{"step": 2600, "loss": 0.03611131647601724, "loss_real": 0.02897420421242714, "loss_synth": 0.036329621300101284, "lr": 0.0005960886713500785, "elapsed": 111.50731405505212, "steps_per_second": 28.15870567139844, "loss_extra": 0.037133857421576974} +{"step": 2800, "loss": 0.03553747542202473, "loss_real": 0.02857700103893876, "loss_synth": 0.035721220672130585, "lr": 0.0005954651469050082, "elapsed": 118.82561404502485, "steps_per_second": 28.097755229531096, "loss_extra": 0.036563742887228724} +{"step": 3000, "loss": 0.03506759813055396, "loss_real": 0.028187929317355156, "loss_synth": 0.03520589077845216, "lr": 0.0005947959125576553, "elapsed": 125.71153264300665, "steps_per_second": 28.158964792205566, "loss_extra": 0.036125086955726145} +{"step": 3200, "loss": 0.03451579859480262, "loss_real": 0.02782223151996732, "loss_synth": 0.03457268672063947, "lr": 0.000594081073987881, "elapsed": 132.692896512046, "steps_per_second": 28.18902149438069, "loss_extra": 0.03562201604247093} +{"step": 3400, "loss": 0.03418397905305028, "loss_real": 0.02739251093007624, "loss_synth": 0.034285525660961866, "lr": 0.0005933207440769824, "elapsed": 139.57983275305014, "steps_per_second": 28.237723379866846, "loss_extra": 0.035262735690921546} +{"step": 3600, "loss": 0.03369895746931434, "loss_real": 0.02728396587073803, "loss_synth": 0.03371947523206473, "lr": 0.0005925150428898661, "elapsed": 146.5414158690255, "steps_per_second": 28.264580488882597, "loss_extra": 0.03479299433529377} +{"step": 3800, "loss": 0.0332841076888144, "loss_real": 0.027047905949875713, "loss_synth": 0.03333944331854582, "lr": 0.0005916640976560898, "elapsed": 153.41135513503104, "steps_per_second": 28.307966590503558, "loss_extra": 0.03431241352111101} +{"step": 4000, "loss": 0.03293615030124784, "loss_real": 0.026389730209484697, "loss_synth": 0.033018280630931256, "lr": 0.0005907680427497705, "elapsed": 160.27177167101763, "steps_per_second": 28.349041137798682, "loss_extra": 0.03399166790768504} +{"step": 4200, "loss": 0.03263005022890866, "loss_real": 0.02666678571142256, "loss_synth": 0.03254413638263941, "lr": 0.000589827019668365, "elapsed": 167.12548431701725, "steps_per_second": 28.387592958055357, "loss_extra": 0.03375158954411745} +{"step": 4400, "loss": 0.03224737348966301, "loss_real": 0.025981906987726688, "loss_synth": 0.032169240908697244, "lr": 0.0005888411770103267, "elapsed": 173.9752198040369, "steps_per_second": 28.42346152017402, "loss_extra": 0.03341366574168205} +{"step": 4600, "loss": 0.03199401313439012, "loss_real": 0.025746850967407225, "loss_synth": 0.0320079015661031, "lr": 0.0005878106704516395, "elapsed": 180.83677868102677, "steps_per_second": 28.454209005421916, "loss_extra": 0.03306549476459622} +{"step": 4800, "loss": 0.03173984689638019, "loss_real": 0.026042885286733507, "loss_synth": 0.03160851490683854, "lr": 0.0005867356627212351, "elapsed": 187.72376680700108, "steps_per_second": 28.478155592508656, "loss_extra": 0.03286034818738699} +{"step": 5000, "loss": 0.03136129201389849, "loss_real": 0.025384666323661806, "loss_synth": 0.031197982467710973, "lr": 0.000585616323575296, "elapsed": 194.62776837602723, "steps_per_second": 28.497458481692068, "loss_extra": 0.03256222014315426} +{"step": 5200, "loss": 0.03117991393432021, "loss_real": 0.02519769093953073, "loss_synth": 0.031099116494879127, "lr": 0.000584452829770449, "elapsed": 203.0156287170248, "steps_per_second": 28.28514198895745, "loss_extra": 0.03229965275153518} +{"step": 5400, "loss": 0.030951667027547956, "loss_real": 0.02531965513713658, "loss_synth": 0.030836558165028692, "lr": 0.0005832453650358537, "elapsed": 209.83547492400976, "steps_per_second": 28.322378897806825, "loss_extra": 0.03204472988843918} +{"step": 5600, "loss": 0.030635853577405215, "loss_real": 0.024895116351544858, "loss_synth": 0.03044307398609817, "lr": 0.0005819941200441891, "elapsed": 216.67341691203183, "steps_per_second": 28.354445954875978, "loss_extra": 0.031825146498158575} +{"step": 5800, "loss": 0.03045312878675759, "loss_real": 0.024789601592347027, "loss_synth": 0.03030343720689416, "lr": 0.0005806992923815441, "elapsed": 223.51110087201232, "steps_per_second": 28.38440260033064, "loss_extra": 0.0315861027315259} +{"step": 6000, "loss": 0.030220986008644105, "loss_real": 0.02440895965322852, "loss_synth": 0.0300824308488518, "lr": 0.0005793610865162167, "elapsed": 230.35397142299917, "steps_per_second": 28.411721286429295, "loss_extra": 0.03136866956017911} +{"step": 6200, "loss": 0.029957604221999647, "loss_real": 0.024446037113666535, "loss_synth": 0.02982859518378973, "lr": 0.0005779797137664262, "elapsed": 237.1947787910467, "steps_per_second": 28.437594556291643, "loss_extra": 0.031043583657592536} +{"step": 6400, "loss": 0.02987468465231359, "loss_real": 0.02472828287631273, "loss_synth": 0.02966111954301596, "lr": 0.0005765553922669433, "elapsed": 244.0159519650042, "steps_per_second": 28.46437880202068, "loss_extra": 0.03098142208531499} +{"step": 6600, "loss": 0.02965874595567584, "loss_real": 0.024310917956754566, "loss_synth": 0.029530439907684922, "lr": 0.0005750883469346437, "elapsed": 250.87741395802004, "steps_per_second": 28.484631948012666, "loss_extra": 0.03071557910181582} +{"step": 6800, "loss": 0.029393701162189246, "loss_real": 0.024148244019597767, "loss_synth": 0.02912399373948574, "lr": 0.000573578809432992, "elapsed": 257.72317550500156, "steps_per_second": 28.505596163194316, "loss_extra": 0.030573551533743738} +{"step": 7000, "loss": 0.029251297945156695, "loss_real": 0.023831802802160382, "loss_synth": 0.02902916233986616, "lr": 0.000572027018135459, "elapsed": 264.5496433080407, "steps_per_second": 28.52763365049504, "loss_extra": 0.03041401377879083} +{"step": 7200, "loss": 0.029176566721871494, "loss_real": 0.023870399054139853, "loss_synth": 0.028979046978056432, "lr": 0.0005704332180878793, "elapsed": 271.3483489380451, "steps_per_second": 28.551620976376135, "loss_extra": 0.03029508251696825} +{"step": 7400, "loss": 0.028914412083104253, "loss_real": 0.023700073016807436, "loss_synth": 0.028723589964210986, "lr": 0.0005687976609697565, "elapsed": 278.13526121299947, "steps_per_second": 28.575650261651308, "loss_extra": 0.030010305689647795} +{"step": 7600, "loss": 0.028819390330463646, "loss_real": 0.023699082639068364, "loss_synth": 0.028580996301025154, "lr": 0.0005671206050545193, "elapsed": 284.95087470300496, "steps_per_second": 28.595363820190062, "loss_extra": 0.029946318389847876} +{"step": 7800, "loss": 0.028595878416672348, "loss_real": 0.02352027712389827, "loss_synth": 0.028408962236717343, "lr": 0.000565402315168738, "elapsed": 291.76049752300605, "steps_per_second": 28.61472032758982, "loss_extra": 0.029663779493421315} +{"step": 8000, "loss": 0.02851601326838136, "loss_real": 0.0233730551507324, "loss_synth": 0.028278009425848724, "lr": 0.0005636430626503045, "elapsed": 298.54318828805117, "steps_per_second": 28.635893809297585, "loss_extra": 0.02964648782275617} +{"step": 8200, "loss": 0.02832086866721511, "loss_real": 0.023300568237900735, "loss_synth": 0.027981515629217028, "lr": 0.0005618431253055855, "elapsed": 305.3292994190124, "steps_per_second": 28.655720934645917, "loss_extra": 0.029530953736975788} +{"step": 8400, "loss": 0.02826777503825724, "loss_real": 0.02335953769274056, "loss_synth": 0.027953653493896127, "lr": 0.000560002787365553, "elapsed": 312.13432810403174, "steps_per_second": 28.67277770971817, "loss_extra": 0.02943326688371599} +{"step": 8600, "loss": 0.028013582890853286, "loss_real": 0.022922459319233895, "loss_synth": 0.02769033989869058, "lr": 0.0005581223394409018, "elapsed": 318.937415796041, "steps_per_second": 28.68924602172524, "loss_extra": 0.029219930050894617} +{"step": 8800, "loss": 0.027895799223333597, "loss_real": 0.02273437550291419, "loss_synth": 0.02758663675747812, "lr": 0.0005562020784761579, "elapsed": 325.7707776300376, "steps_per_second": 28.70214890743817, "loss_extra": 0.02910033905878663} +{"step": 9000, "loss": 0.02781517190858722, "loss_real": 0.022510342597961426, "loss_synth": 0.02748801711946726, "lr": 0.0005542423077027882, "elapsed": 332.55230116902385, "steps_per_second": 28.719239128051836, "loss_extra": 0.029062541322782635} +{"step": 9200, "loss": 0.027634706404060124, "loss_real": 0.02268372039310634, "loss_synth": 0.027312903739511965, "lr": 0.0005522433365913161, "elapsed": 339.3543056110502, "steps_per_second": 28.733767179422504, "loss_extra": 0.028815273297950625} +{"step": 9400, "loss": 0.02760461939498782, "loss_real": 0.022599486941471694, "loss_synth": 0.02737892315723002, "lr": 0.0005502054808024529, "elapsed": 346.2454934690031, "steps_per_second": 28.739852136296648, "loss_extra": 0.028698893804103134} +{"step": 9600, "loss": 0.027497618747875093, "loss_real": 0.022654241509735586, "loss_synth": 0.027191869001835584, "lr": 0.0005481290621372514, "elapsed": 353.04808732902166, "steps_per_second": 28.75331365217176, "loss_extra": 0.02864350619725883} +{"step": 9800, "loss": 0.027313983887434005, "loss_real": 0.02250654679723084, "loss_synth": 0.02700836886651814, "lr": 0.000546014408486289, "elapsed": 359.82217190699885, "steps_per_second": 28.768644995803122, "loss_extra": 0.028453493481501935} +{"step": 10000, "loss": 0.027206576289609076, "loss_real": 0.022178658051416278, "loss_synth": 0.02692160664126277, "lr": 0.0005438618537778916, "elapsed": 366.6149166150135, "steps_per_second": 28.78183268198521, "loss_extra": 0.028363831639289856} +{"step": 10200, "loss": 0.027152879731729626, "loss_real": 0.022197940787300467, "loss_synth": 0.026765883322805165, "lr": 0.0005416717379254006, "elapsed": 403.3076751460321, "steps_per_second": 26.55322367618743, "loss_extra": 0.02839905087836087} +{"step": 10400, "loss": 0.026979763489216567, "loss_real": 0.021891085831448436, "loss_synth": 0.026726341880857943, "lr": 0.0005394444067734975, "elapsed": 410.1757411650033, "steps_per_second": 26.598314720700344, "loss_extra": 0.028116160240024328} +{"step": 10600, "loss": 0.026910027107223868, "loss_real": 0.022166643515229224, "loss_synth": 0.02656724297441542, "lr": 0.0005371802120435915, "elapsed": 417.06069212500006, "steps_per_second": 26.640718502294035, "loss_extra": 0.028075420316308736} +{"step": 10800, "loss": 0.02675153379328549, "loss_real": 0.02199081261176616, "loss_synth": 0.0263785177282989, "lr": 0.0005348795112782779, "elapsed": 423.97370180202415, "steps_per_second": 26.679830250380963, "loss_extra": 0.027950042989104987} +{"step": 11000, "loss": 0.026661989856511355, "loss_real": 0.0218963086232543, "loss_synth": 0.02630641152150929, "lr": 0.0005325426677848778, "elapsed": 430.8484096470056, "steps_per_second": 26.72011438853914, "loss_extra": 0.02784399705938995} +{"step": 11200, "loss": 0.026576182479038833, "loss_real": 0.021883040443062784, "loss_synth": 0.026134683219715953, "lr": 0.0005301700505780687, "elapsed": 437.6843084630091, "steps_per_second": 26.76155651551368, "loss_extra": 0.027831144100055098} +{"step": 11400, "loss": 0.02644091391004622, "loss_real": 0.021847092686221002, "loss_synth": 0.026025026934221387, "lr": 0.0005277620343216117, "elapsed": 444.50487482803874, "steps_per_second": 26.802632841109066, "loss_extra": 0.02765311679802835} +{"step": 11600, "loss": 0.026393780708312987, "loss_real": 0.021598680512979626, "loss_synth": 0.026080125775188208, "lr": 0.0005253189992691882, "elapsed": 451.3229683150421, "steps_per_second": 26.842566141618523, "loss_extra": 0.027539152586832642} +{"step": 11800, "loss": 0.02637725992128253, "loss_real": 0.02133045023307204, "loss_synth": 0.026121954806149005, "lr": 0.0005228413312043536, "elapsed": 458.4220610689954, "steps_per_second": 26.86406224668315, "loss_extra": 0.027508258484303952} +{"step": 12000, "loss": 0.026205211905762554, "loss_real": 0.02149110408499837, "loss_synth": 0.02581940940581262, "lr": 0.0005203294213796174, "elapsed": 465.2298167120316, "steps_per_second": 26.90243413687423, "loss_extra": 0.027408354999497533} +{"step": 12200, "loss": 0.026080411793664098, "loss_real": 0.021124581173062325, "loss_synth": 0.025756485769525172, "lr": 0.0005177836664546598, "elapsed": 472.015402035031, "steps_per_second": 26.940971306417556, "loss_extra": 0.02726393487304449} +{"step": 12400, "loss": 0.02607296816073358, "loss_real": 0.021176883950829506, "loss_synth": 0.025682278918102385, "lr": 0.000515204468433695, "elapsed": 478.84125453804154, "steps_per_second": 26.976007196606414, "loss_extra": 0.027312591830268504} +{"step": 12600, "loss": 0.025938254911452532, "loss_real": 0.021233864864334463, "loss_synth": 0.025486413817852736, "lr": 0.0005125922346019892, "elapsed": 485.71601242700126, "steps_per_second": 27.007186573670037, "loss_extra": 0.02720546848140657} +{"step": 12800, "loss": 0.025930096693336964, "loss_real": 0.021268565943464636, "loss_synth": 0.02548842898570001, "lr": 0.0005099473774615467, "elapsed": 492.6589696200099, "steps_per_second": 27.033565996385857, "loss_extra": 0.02717973426915705} +{"step": 13000, "loss": 0.025837138062343, "loss_real": 0.021103348806500433, "loss_synth": 0.025429087169468404, "lr": 0.00050727031466597, "elapsed": 499.5053649720503, "steps_per_second": 27.06462268119955, "loss_extra": 0.027065854566171766} +{"step": 13200, "loss": 0.025737016918137668, "loss_real": 0.020873978934250772, "loss_synth": 0.025326191810891033, "lr": 0.000504561468954508, "elapsed": 506.37517099204706, "steps_per_second": 27.09350449474663, "loss_extra": 0.026990949967876078} +{"step": 13400, "loss": 0.025612733801826836, "loss_real": 0.020930146388709544, "loss_synth": 0.025181841496378185, "lr": 0.0005018212680853004, "elapsed": 513.2468428630382, "steps_per_second": 27.1214807987158, "loss_extra": 0.02685529968701303} +{"step": 13600, "loss": 0.02556630000472069, "loss_real": 0.020717263235710562, "loss_synth": 0.025193221280351282, "lr": 0.0004990501447678302, "elapsed": 520.0859182660352, "steps_per_second": 27.15045624481916, "loss_extra": 0.026780214384198187} +{"step": 13800, "loss": 0.025597933577373624, "loss_real": 0.020701452642679214, "loss_synth": 0.02524910369887948, "lr": 0.0004962485365945929, "elapsed": 526.878397123015, "steps_per_second": 27.181145528556318, "loss_extra": 0.026795944143086673} +{"step": 14000, "loss": 0.0253673193231225, "loss_real": 0.020606118189170956, "loss_synth": 0.0249396937713027, "lr": 0.0004934168859719962, "elapsed": 533.7008452370064, "steps_per_second": 27.209439540644404, "loss_extra": 0.026620289888232947} +{"step": 14200, "loss": 0.025450764009729027, "loss_real": 0.020933005628176033, "loss_synth": 0.02503708902746439, "lr": 0.0004905556400504991, "elapsed": 540.4875285580056, "steps_per_second": 27.238861630976327, "loss_extra": 0.026647550398483873} +{"step": 14400, "loss": 0.025265873800963165, "loss_real": 0.020793215874582528, "loss_synth": 0.024848159085959196, "lr": 0.0004876652506540011, "elapsed": 547.320232151018, "steps_per_second": 27.265151547971474, "loss_extra": 0.0264588472712785} +{"step": 14600, "loss": 0.025254412898793818, "loss_real": 0.020573103972710668, "loss_synth": 0.02476496234536171, "lr": 0.00048474617420849446, "elapsed": 554.1451234790147, "steps_per_second": 27.291168439465142, "loss_extra": 0.02655506697483361} +{"step": 14800, "loss": 0.025177026130259038, "loss_real": 0.020799057432450353, "loss_synth": 0.024737862637266517, "lr": 0.000481798871669989, "elapsed": 561.0026436370099, "steps_per_second": 27.314884899742342, "loss_extra": 0.02637490727007389} +{"step": 15000, "loss": 0.02507521165534854, "loss_real": 0.020458727795630693, "loss_synth": 0.024655299540609122, "lr": 0.00047882380845172155, "elapsed": 567.8096203900059, "steps_per_second": 27.340527056776175, "loss_extra": 0.026295360047370195} +{"step": 15200, "loss": 0.024982763063162564, "loss_real": 0.020249271728098393, "loss_synth": 0.024495383324101568, "lr": 0.0004758214543506626, "elapsed": 575.9532697810209, "steps_per_second": 27.29984371365713, "loss_extra": 0.026290420815348624} +{"step": 15400, "loss": 0.024902530973777176, "loss_real": 0.020361170447431506, "loss_synth": 0.024461483657360075, "lr": 0.0004727922834733288, "elapsed": 582.767130548018, "steps_per_second": 27.324653556588256, "loss_extra": 0.026130673652514817} +{"step": 15600, "loss": 0.024857993656769394, "loss_real": 0.0202769328514114, "loss_synth": 0.024404259137809275, "lr": 0.0004697367741609171, "elapsed": 589.576785479032, "steps_per_second": 27.349072294292654, "loss_extra": 0.026105666952207684} +{"step": 15800, "loss": 0.024864422725513577, "loss_real": 0.02022209754679352, "loss_synth": 0.02443000579252839, "lr": 0.0004666554089137685, "elapsed": 596.3744099070318, "steps_per_second": 27.37348541014488, "loss_extra": 0.026103503732010723} +{"step": 16000, "loss": 0.02472030436620116, "loss_real": 0.020158521682024002, "loss_synth": 0.024293250171467662, "lr": 0.00046354867431517584, "elapsed": 603.187053525995, "steps_per_second": 27.396625598629818, "loss_extra": 0.02593806111253798} +{"step": 16200, "loss": 0.02476007835008204, "loss_real": 0.02008197278250009, "loss_synth": 0.02436906491406262, "lr": 0.0004604170609545466, "elapsed": 609.967004589038, "steps_per_second": 27.420749502492956, "loss_extra": 0.025962155843153596} +{"step": 16400, "loss": 0.024619674049317836, "loss_real": 0.019933176268823447, "loss_synth": 0.024173100609332324, "lr": 0.00045726106334993325, "elapsed": 616.794946123031, "steps_per_second": 27.442122104927115, "loss_extra": 0.025878534130752088} +{"step": 16600, "loss": 0.024602487878873945, "loss_real": 0.01992911607027054, "loss_synth": 0.024158086655661465, "lr": 0.0004540811798699431, "elapsed": 623.6038441280252, "steps_per_second": 27.463877106332106, "loss_extra": 0.025856904592365025} +{"step": 16800, "loss": 0.024469092879444362, "loss_real": 0.019638585853390397, "loss_synth": 0.024052074244245887, "lr": 0.00045087791265504006, "elapsed": 630.3961366510484, "steps_per_second": 27.485894151458076, "loss_extra": 0.025723541770130396} +{"step": 17000, "loss": 0.024488219022750855, "loss_real": 0.019950446700677277, "loss_synth": 0.024092483511194588, "lr": 0.0004476517675382507, "elapsed": 637.2447506909957, "steps_per_second": 27.50492063864587, "loss_extra": 0.02567061851732433} +{"step": 17200, "loss": 0.02441257261671126, "loss_real": 0.01981996145565063, "loss_synth": 0.02393247626721859, "lr": 0.00044440325396528766, "elapsed": 644.0763605690445, "steps_per_second": 27.5242790075158, "loss_extra": 0.02568850261159241} +{"step": 17400, "loss": 0.024411006569862365, "loss_real": 0.019652853147126736, "loss_synth": 0.02390921061858535, "lr": 0.00044113288491410207, "elapsed": 650.8617731270497, "steps_per_second": 27.545233056641766, "loss_extra": 0.025737303588539363} +{"step": 17600, "loss": 0.024237633123993872, "loss_real": 0.01967115352395922, "loss_synth": 0.02380264740437269, "lr": 0.00043784117681387844, "elapsed": 657.6743526360369, "steps_per_second": 27.564568831466826, "loss_extra": 0.025464103994891046} +{"step": 17800, "loss": 0.02429554590024054, "loss_real": 0.019475496164523064, "loss_synth": 0.02383966906927526, "lr": 0.00043452864946348456, "elapsed": 664.4586464950116, "steps_per_second": 27.584705454087402, "loss_extra": 0.0255868717469275} +{"step": 18000, "loss": 0.024176953248679637, "loss_real": 0.019286637087352575, "loss_synth": 0.02378356870263815, "lr": 0.00043119582594938896, "elapsed": 671.2629359660204, "steps_per_second": 27.603576612035997, "loss_extra": 0.02541825911030173} +{"step": 18200, "loss": 0.0241142066847533, "loss_real": 0.019233668744564055, "loss_synth": 0.023651955556124447, "lr": 0.0004278432325630599, "elapsed": 678.0737238030415, "steps_per_second": 27.621785541665425, "loss_extra": 0.025422388454899192} +{"step": 18400, "loss": 0.024149110140278936, "loss_real": 0.019463702347129585, "loss_synth": 0.023700327938422562, "lr": 0.00042447139871785766, "elapsed": 685.0221397580463, "steps_per_second": 27.633908951807403, "loss_extra": 0.025409980164840817} +{"step": 18600, "loss": 0.02400118892081082, "loss_real": 0.01938037676271051, "loss_synth": 0.02349018519744277, "lr": 0.0004210808568654337, "elapsed": 691.8189880910213, "steps_per_second": 27.65201139777856, "loss_extra": 0.02531279468908906} +{"step": 18800, "loss": 0.02401066690683365, "loss_real": 0.019348123776726425, "loss_synth": 0.023524898774921893, "lr": 0.00041767214241165117, "elapsed": 698.627153700043, "steps_per_second": 27.669290763819955, "loss_extra": 0.025304393703117968} +{"step": 19000, "loss": 0.023986801160499453, "loss_real": 0.019246063944883644, "loss_synth": 0.02354732553474605, "lr": 0.00041424579363203725, "elapsed": 705.40309334005, "steps_per_second": 27.687527463105518, "loss_extra": 0.02524801656603813} +{"step": 19200, "loss": 0.02395493579097092, "loss_real": 0.01932939272839576, "loss_synth": 0.023522810311987996, "lr": 0.00041080235158678376, "elapsed": 712.2330232190434, "steps_per_second": 27.703249229093153, "loss_extra": 0.025188819514587523} +{"step": 19400, "loss": 0.023855379419401287, "loss_real": 0.019140350138768553, "loss_synth": 0.023337473925203085, "lr": 0.00040734236003530744, "elapsed": 719.0216569530312, "steps_per_second": 27.72029977350625, "loss_extra": 0.025190226081758738} +{"step": 19600, "loss": 0.023711219653487204, "loss_real": 0.019025510060600936, "loss_synth": 0.023306263843551278, "lr": 0.0004038663653503835, "elapsed": 725.8666577850236, "steps_per_second": 27.734810348877584, "loss_extra": 0.02492850136011839} +{"step": 19800, "loss": 0.023729323484003542, "loss_real": 0.018877492104656994, "loss_synth": 0.023226309902966022, "lr": 0.000400374916431868, "elapsed": 732.6549257720471, "steps_per_second": 27.751249000144206, "loss_extra": 0.025073107900097966} +{"step": 20000, "loss": 0.02370106021873653, "loss_real": 0.018902462059631944, "loss_synth": 0.023270212532952427, "lr": 0.00039686856462001896, "elapsed": 739.4341832970385, "steps_per_second": 27.76772515905568, "loss_extra": 0.024963736329227687} +{"step": 20200, "loss": 0.023675491847097874, "loss_real": 0.01918433670885861, "loss_synth": 0.023229406736791133, "lr": 0.00039334786360843476, "elapsed": 776.4378076910507, "steps_per_second": 26.67496734092198, "loss_extra": 0.024899928979575634} +{"step": 20400, "loss": 0.023582385750487447, "loss_real": 0.018856335985474287, "loss_synth": 0.02310457721352577, "lr": 0.00038981336935661813, "elapsed": 783.3000389560475, "steps_per_second": 26.69714980265829, "loss_extra": 0.0248792199511081} +{"step": 20600, "loss": 0.023571495451033115, "loss_real": 0.018888614480383693, "loss_synth": 0.023147185090929268, "lr": 0.00038626564000218466, "elapsed": 790.0841650210205, "steps_per_second": 26.72164442701338, "loss_extra": 0.024807558227330447} +{"step": 20800, "loss": 0.02351791043765843, "loss_real": 0.018590953457169233, "loss_synth": 0.023019067468121646, "lr": 0.00038270523577272616, "elapsed": 796.9782500720466, "steps_per_second": 26.741930620359543, "loss_extra": 0.024870593594387175} +{"step": 21000, "loss": 0.02346003260463476, "loss_real": 0.018724824688397347, "loss_synth": 0.02302331487648189, "lr": 0.0003791327188973438, "elapsed": 803.7771763480268, "steps_per_second": 26.765106146065975, "loss_extra": 0.02471754088997841} +{"step": 21200, "loss": 0.02348911409266293, "loss_real": 0.01846400778274983, "loss_synth": 0.023058408554643393, "lr": 0.00037554865351786614, "elapsed": 810.6350404010154, "steps_per_second": 26.785888635474233, "loss_extra": 0.02479099960066378} +{"step": 21400, "loss": 0.023383917221799493, "loss_real": 0.018520580250769855, "loss_synth": 0.02290297893807292, "lr": 0.00037195360559976446, "elapsed": 817.4448684260133, "steps_per_second": 26.807927133691873, "loss_extra": 0.024707718696445228} +{"step": 21600, "loss": 0.023354602316394447, "loss_real": 0.018524107071571053, "loss_synth": 0.022900427393615246, "lr": 0.0003683481428427801, "elapsed": 824.240547413996, "steps_per_second": 26.830064343146063, "loss_extra": 0.024646048340946435} +{"step": 21800, "loss": 0.02329821905121207, "loss_real": 0.018870703876018524, "loss_synth": 0.02285351127386093, "lr": 0.0003647328345912784, "elapsed": 831.0805120040313, "steps_per_second": 26.850366296681766, "loss_extra": 0.024510228838771582} +{"step": 22000, "loss": 0.02327465279959142, "loss_real": 0.018424943527206777, "loss_synth": 0.022769989520311354, "lr": 0.0003611082517443419, "elapsed": 837.902428320027, "steps_per_second": 26.870921406311012, "loss_extra": 0.02461971130222082} +{"step": 22200, "loss": 0.02322132929228246, "loss_real": 0.01839616011828184, "loss_synth": 0.02281858080998063, "lr": 0.00035747496666562, "elapsed": 844.7480130830081, "steps_per_second": 26.89036582970216, "loss_extra": 0.024460641462355853} +{"step": 22400, "loss": 0.02328037327155471, "loss_real": 0.01835440881550312, "loss_synth": 0.022865593181923032, "lr": 0.00035383355309294483, "elapsed": 851.5647358550341, "steps_per_second": 26.910423512079568, "loss_extra": 0.024549177046865225} +{"step": 22600, "loss": 0.023228644281625747, "loss_real": 0.018435499561019243, "loss_synth": 0.02275512774474919, "lr": 0.00035018458604773206, "elapsed": 858.4052778590121, "steps_per_second": 26.92939099775942, "loss_extra": 0.024532861011102795} +{"step": 22800, "loss": 0.023035419890657067, "loss_real": 0.018271276787854732, "loss_synth": 0.022610608246177433, "lr": 0.0003465286417441785, "elapsed": 865.19066823303, "steps_per_second": 26.949808508533376, "loss_extra": 0.024286099318414925} +{"step": 23000, "loss": 0.023003206672146916, "loss_real": 0.018244752786122264, "loss_synth": 0.022608086504042148, "lr": 0.0003428662974982705, "elapsed": 872.0105840260512, "steps_per_second": 26.968809301361055, "loss_extra": 0.024223332451656462} +{"step": 23200, "loss": 0.023024543030187486, "loss_real": 0.01832169508561492, "loss_synth": 0.022557373074814677, "lr": 0.00033919813163662, "elapsed": 878.8545926510124, "steps_per_second": 26.986752277196818, "loss_extra": 0.024306752998381854} +{"step": 23400, "loss": 0.022955967718735336, "loss_real": 0.01803034980315715, "loss_synth": 0.022409039046615363, "lr": 0.000335524723405139, "elapsed": 885.6704378200229, "steps_per_second": 27.005289526422665, "loss_extra": 0.02435629991814494} +{"step": 23600, "loss": 0.022982361586764456, "loss_real": 0.01843497857451439, "loss_synth": 0.02248144770041108, "lr": 0.00033184665287757097, "elapsed": 892.4867344039958, "steps_per_second": 27.02352346985438, "loss_extra": 0.024271163325756788} +{"step": 23800, "loss": 0.022946516601368785, "loss_real": 0.01849070797674358, "loss_synth": 0.02243470326066017, "lr": 0.0003281645008638895, "elapsed": 899.3075854800409, "steps_per_second": 27.041335047515627, "loss_extra": 0.024230262748897075} +{"step": 24000, "loss": 0.02279340149834752, "loss_real": 0.01784312622155994, "loss_synth": 0.022376812482252716, "lr": 0.0003244788488185826, "elapsed": 906.1276946970029, "steps_per_second": 27.05889529040868, "loss_extra": 0.02406823013909161} +{"step": 24200, "loss": 0.022920120880007742, "loss_real": 0.017909941314719617, "loss_synth": 0.022442028345540165, "lr": 0.00032079027874883385, "elapsed": 912.953154102026, "steps_per_second": 27.07602547158182, "loss_extra": 0.024266599463298916} +{"step": 24400, "loss": 0.022788643380627038, "loss_real": 0.01793757017236203, "loss_synth": 0.02232301636599004, "lr": 0.00031709937312261613, "elapsed": 919.7838870490086, "steps_per_second": 27.092737370131793, "loss_extra": 0.024095067866146565} +{"step": 24600, "loss": 0.02285071203485131, "loss_real": 0.018200199590064584, "loss_synth": 0.02240317055955529, "lr": 0.0003134067147767145, "elapsed": 926.5950780450366, "steps_per_second": 27.109781451967077, "loss_extra": 0.0241042841412127} +{"step": 24800, "loss": 0.02279057592153549, "loss_real": 0.017695344374515115, "loss_synth": 0.02234105095267296, "lr": 0.0003097128868246881, "elapsed": 933.4684471360524, "steps_per_second": 27.12472683904397, "loss_extra": 0.024123383723199367} +{"step": 25000, "loss": 0.022694897595793007, "loss_real": 0.018106337804347276, "loss_synth": 0.02222176443785429, "lr": 0.0003060184725647909, "elapsed": 940.2987954950077, "steps_per_second": 27.14071669007965, "loss_extra": 0.023963190065696836} +{"step": 25200, "loss": 0.022669346490874886, "loss_real": 0.01786824889946729, "loss_synth": 0.022213881127536295, "lr": 0.0003023240553878617, "elapsed": 948.4673729560454, "steps_per_second": 27.117364510387542, "loss_extra": 0.02395696993917227} +{"step": 25400, "loss": 0.022625738522037864, "loss_real": 0.017782137095928192, "loss_synth": 0.02215972965583205, "lr": 0.0002986302186851996, "elapsed": 955.2917610640288, "steps_per_second": 27.133324632225555, "loss_extra": 0.02393124529160559} +{"step": 25600, "loss": 0.02256790831685066, "loss_real": 0.018075554305687545, "loss_synth": 0.022092444393783807, "lr": 0.00029493754575644036, "elapsed": 962.1531495790114, "steps_per_second": 27.147988498901956, "loss_extra": 0.023821808295324445} +{"step": 25800, "loss": 0.022546804593876004, "loss_real": 0.01750597620382905, "loss_synth": 0.022082077497616412, "lr": 0.0002912466197174462, "elapsed": 969.074940491002, "steps_per_second": 27.160713294663168, "loss_extra": 0.023885298604145646} +{"step": 26000, "loss": 0.02252634273841977, "loss_real": 0.0175665418850258, "loss_synth": 0.02203887654468417, "lr": 0.00028755802340822527, "elapsed": 976.021455507027, "steps_per_second": 27.172551860081175, "loss_extra": 0.023873402867466212} +{"step": 26200, "loss": 0.022466688491404055, "loss_real": 0.017525511253625156, "loss_synth": 0.022076320685446262, "lr": 0.0002838723393008943, "elapsed": 982.941079382028, "steps_per_second": 27.184978260024437, "loss_extra": 0.02371382635086775} +{"step": 26400, "loss": 0.02242862028069794, "loss_real": 0.017265156917273997, "loss_synth": 0.02194993732497096, "lr": 0.00028019014940769974, "elapsed": 989.8729888570379, "steps_per_second": 27.19688327231264, "loss_extra": 0.023802316216751933} +{"step": 26600, "loss": 0.02247984760440886, "loss_real": 0.017635922827757895, "loss_synth": 0.021979827601462602, "lr": 0.000276512035189111, "elapsed": 996.8169624540024, "steps_per_second": 27.20828368484188, "loss_extra": 0.02381927733309567} +{"step": 26800, "loss": 0.022345713870599866, "loss_real": 0.017363063497468828, "loss_synth": 0.021877179909497498, "lr": 0.00027283857746200125, "elapsed": 1003.8304182150168, "steps_per_second": 27.217602595464395, "loss_extra": 0.02367789139971137} +{"step": 27000, "loss": 0.022421804573386907, "loss_real": 0.017614805889315903, "loss_synth": 0.022009399803355336, "lr": 0.0002691703563079296, "elapsed": 1010.8555369890528, "steps_per_second": 27.226469456183928, "loss_extra": 0.023667574990540743} +{"step": 27200, "loss": 0.022337832739576697, "loss_real": 0.017281740261241792, "loss_synth": 0.0219037043210119, "lr": 0.0002655079509815397, "elapsed": 1017.810632631008, "steps_per_second": 27.23712128343589, "loss_extra": 0.02364851008169353} +{"step": 27400, "loss": 0.02222929415293038, "loss_real": 0.01756564890500158, "loss_synth": 0.021794225089251995, "lr": 0.00026185193981908867, "elapsed": 1024.7410396030173, "steps_per_second": 27.24829473236914, "loss_extra": 0.023472728664055465} +{"step": 27600, "loss": 0.02230188250541687, "loss_real": 0.01721617073286325, "loss_synth": 0.021875644708052276, "lr": 0.0002582029001471206, "elapsed": 1031.6160080610425, "steps_per_second": 27.26080787077033, "loss_extra": 0.023609848245978355} +{"step": 27800, "loss": 0.02231311609968543, "loss_real": 0.017308178571984172, "loss_synth": 0.0219071364402771, "lr": 0.00025456140819130085, "elapsed": 1038.474235212023, "steps_per_second": 27.27360014254728, "loss_extra": 0.0235868766810745} +{"step": 28000, "loss": 0.022176698921248315, "loss_real": 0.01729949361179024, "loss_synth": 0.021646447964012622, "lr": 0.0002509280389854229, "elapsed": 1045.3793873840477, "steps_per_second": 27.28497373418113, "loss_extra": 0.023552013197913765} +{"step": 28200, "loss": 0.02221883710473776, "loss_real": 0.017099160999059677, "loss_synth": 0.021756343971937896, "lr": 0.00024730336628060344, "elapsed": 1052.521698326047, "steps_per_second": 27.289930643602965, "loss_extra": 0.02356880501843989} +{"step": 28400, "loss": 0.022120036175474523, "loss_real": 0.017084142914973198, "loss_synth": 0.02178623774088919, "lr": 0.00024368796245468133, "elapsed": 1059.6233776130248, "steps_per_second": 27.295885461071652, "loss_extra": 0.0233272991143167} +{"step": 28600, "loss": 0.02215523652732372, "loss_real": 0.017121481285430493, "loss_synth": 0.02171753709204495, "lr": 0.00024008239842183163, "elapsed": 1066.6927639869973, "steps_per_second": 27.302601170894437, "loss_extra": 0.023465588726103305} +{"step": 28800, "loss": 0.022095677591860294, "loss_real": 0.01720433492679149, "loss_synth": 0.02155481114052236, "lr": 0.00023648724354241227, "elapsed": 1073.7668885670137, "steps_per_second": 27.309104159638512, "loss_extra": 0.023484018594026566} +{"step": 29000, "loss": 0.022066293954849242, "loss_real": 0.017167290206998587, "loss_synth": 0.021587628629058598, "lr": 0.00023290306553305494, "elapsed": 1080.8594643690158, "steps_per_second": 27.3150457631073, "loss_extra": 0.02339402833022177} +{"step": 29200, "loss": 0.021956509314477443, "loss_real": 0.01687207201961428, "loss_synth": 0.02151316503994167, "lr": 0.00022933043037701642, "elapsed": 1087.8963596970425, "steps_per_second": 27.32233191080268, "loss_extra": 0.02328128758817911} +{"step": 29400, "loss": 0.021984895709902048, "loss_real": 0.017011321098543704, "loss_synth": 0.021446987334638835, "lr": 0.00022576990223480343, "elapsed": 1094.9498652380425, "steps_per_second": 27.32910076844071, "loss_extra": 0.023384577054530384} +{"step": 29600, "loss": 0.021969419512897728, "loss_real": 0.016964011499658226, "loss_synth": 0.02147125517949462, "lr": 0.00022222204335508425, "elapsed": 1101.9568492000108, "steps_per_second": 27.336955920957966, "loss_extra": 0.023335055857896806} +{"step": 29800, "loss": 0.02194623339921236, "loss_real": 0.017110347198322415, "loss_synth": 0.021515384959056975, "lr": 0.00021868741398590414, "elapsed": 1108.8747490320238, "steps_per_second": 27.346945516328606, "loss_extra": 0.023215388087555765} +{"step": 30000, "loss": 0.021890073828399182, "loss_real": 0.017025755564682186, "loss_synth": 0.021407340290024876, "lr": 0.00021516657228621528, "elapsed": 1115.8792500480195, "steps_per_second": 27.354648867527644, "loss_extra": 0.023215833716094494} +{"step": 30200, "loss": 0.021906175538897513, "loss_real": 0.017085900260135532, "loss_synth": 0.021441827276721597, "lr": 0.00021166007423773693, "elapsed": 1157.0193572930293, "steps_per_second": 26.54138122471905, "loss_extra": 0.02320597607642412} +{"step": 30400, "loss": 0.021814090935513376, "loss_real": 0.01687306886073202, "loss_synth": 0.02130739198066294, "lr": 0.0002081684735571596, "elapsed": 1163.8844288830296, "steps_per_second": 26.55692358763645, "loss_extra": 0.023177039958536625} +{"step": 30600, "loss": 0.0218505272641778, "loss_real": 0.01690843257587403, "loss_synth": 0.02140295844525099, "lr": 0.00020469232160870657, "elapsed": 1170.7609268510132, "steps_per_second": 26.572016986687704, "loss_extra": 0.023154783239588143} +{"step": 30800, "loss": 0.02188738662749529, "loss_real": 0.017039583469741045, "loss_synth": 0.021354868495836853, "lr": 0.00020123216731706737, "elapsed": 1177.6866630940349, "steps_per_second": 26.585801224481685, "loss_extra": 0.02325985062867403} +{"step": 31000, "loss": 0.02174322166480124, "loss_real": 0.016918121981434525, "loss_synth": 0.02126617911271751, "lr": 0.00019778855708071612, "elapsed": 1184.7846144440118, "steps_per_second": 26.595491651078966, "loss_extra": 0.023056501066312195} +{"step": 31200, "loss": 0.021799666155129672, "loss_real": 0.016591057339683177, "loss_synth": 0.02131547371856868, "lr": 0.00019436203468562864, "elapsed": 1191.7581787070376, "steps_per_second": 26.607887041925427, "loss_extra": 0.023186691561713813} +{"step": 31400, "loss": 0.021638946244493126, "loss_real": 0.016686359364539386, "loss_synth": 0.021145414346829056, "lr": 0.00019095314121941266, "elapsed": 1198.753342328011, "steps_per_second": 26.619648410434927, "loss_extra": 0.02299079311080277} +{"step": 31600, "loss": 0.021677609411999584, "loss_real": 0.016778435525484383, "loss_synth": 0.021236032899469136, "lr": 0.0001875624149858636, "elapsed": 1205.6651047560154, "steps_per_second": 26.633143066050337, "loss_extra": 0.02296844177879393} +{"step": 31800, "loss": 0.021633803807199002, "loss_real": 0.016516668829135595, "loss_synth": 0.02117416455410421, "lr": 0.00018419039141996036, "elapsed": 1212.525377624028, "steps_per_second": 26.647631140810958, "loss_extra": 0.022980488324537873} +{"step": 32000, "loss": 0.021605514446273445, "loss_real": 0.01651789678260684, "loss_synth": 0.021098313434049488, "lr": 0.0001808376030033136, "elapsed": 1219.4964131870074, "steps_per_second": 26.65949331233427, "loss_extra": 0.022994431452825665} +{"step": 32200, "loss": 0.02160949070006609, "loss_real": 0.016629852009937166, "loss_synth": 0.021151688229292632, "lr": 0.0001775045791800812, "elapsed": 1226.427170923038, "steps_per_second": 26.672108321383345, "loss_extra": 0.022930459529161454} +{"step": 32400, "loss": 0.021581721473485232, "loss_real": 0.016561638535931705, "loss_synth": 0.021132786553353072, "lr": 0.00017419184627336242, "elapsed": 1233.7374125189963, "steps_per_second": 26.676241854855245, "loss_extra": 0.02290088664740324} +{"step": 32600, "loss": 0.021548940213397146, "loss_real": 0.016637383522465826, "loss_synth": 0.02113243818283081, "lr": 0.00017089992740208575, "elapsed": 1240.5544325720402, "steps_per_second": 26.691100056522426, "loss_extra": 0.022816955437883736} +{"step": 32800, "loss": 0.021530463900417088, "loss_real": 0.016729064625687896, "loss_synth": 0.021019923947751522, "lr": 0.00016762934239840198, "elapsed": 1247.4117291140137, "steps_per_second": 26.704917583159297, "loss_extra": 0.022872981475666167} +{"step": 33000, "loss": 0.021563880797475576, "loss_real": 0.016519756279885767, "loss_synth": 0.02112761520780623, "lr": 0.000164380607725597, "elapsed": 1254.4005713060033, "steps_per_second": 26.71573628296819, "loss_extra": 0.022874606838449836} +{"step": 33200, "loss": 0.021538093741983174, "loss_real": 0.016531780567020177, "loss_synth": 0.020995725262910128, "lr": 0.00016115423639653619, "elapsed": 1261.1531195290154, "steps_per_second": 26.731518099507948, "loss_extra": 0.02294790421612561} +{"step": 33400, "loss": 0.021436306852847337, "loss_real": 0.016410699179396034, "loss_synth": 0.020954576041549444, "lr": 0.0001579507378926539, "elapsed": 1267.8367773439968, "steps_per_second": 26.74860491666904, "loss_extra": 0.02278908864594996} +{"step": 33600, "loss": 0.021460277670994402, "loss_real": 0.016547318208031358, "loss_synth": 0.020991194611415267, "lr": 0.00015477061808349973, "elapsed": 1274.6399664430064, "steps_per_second": 26.76296147944929, "loss_extra": 0.022780894935131073} +{"step": 33800, "loss": 0.02145742348395288, "loss_real": 0.016373380050063134, "loss_synth": 0.020992212817072867, "lr": 0.0001516143791468568, "elapsed": 1281.5517139810254, "steps_per_second": 26.77486058121833, "loss_extra": 0.02280390728265047} +{"step": 34000, "loss": 0.021457162061706184, "loss_real": 0.016360129779204726, "loss_synth": 0.020996321802958847, "lr": 0.00014848251948944142, "elapsed": 1288.3482517060474, "steps_per_second": 26.78906166155865, "loss_extra": 0.02280155010521412} +{"step": 34200, "loss": 0.021434128321707248, "loss_real": 0.016235820166766644, "loss_synth": 0.020911011854186656, "lr": 0.00014537553366819925, "elapsed": 1295.1268809070461, "steps_per_second": 26.80348764436313, "loss_extra": 0.022858123192563654} +{"step": 34400, "loss": 0.021350442934781312, "loss_real": 0.016319428761489688, "loss_synth": 0.02085761188529432, "lr": 0.0001422939123122089, "elapsed": 1302.0991563270218, "steps_per_second": 26.813713254754717, "loss_extra": 0.02271521701477468} +{"step": 34600, "loss": 0.02131258706562221, "loss_real": 0.016104650618508458, "loss_synth": 0.020853527141734957, "lr": 0.00013923814204520548, "elapsed": 1308.9762741650338, "steps_per_second": 26.825807309437778, "loss_extra": 0.02267446981742978} +{"step": 34800, "loss": 0.021249410985037683, "loss_real": 0.01614637454971671, "loss_synth": 0.020841193730011583, "lr": 0.00013620870540873793, "elapsed": 1315.8577657740097, "steps_per_second": 26.837682541444266, "loss_extra": 0.022542442269623278} +{"step": 35000, "loss": 0.021287968764081597, "loss_real": 0.016100019165314734, "loss_synth": 0.020887540178373454, "lr": 0.00013320608078596944, "elapsed": 1322.7432118340512, "steps_per_second": 26.84935094381875, "loss_extra": 0.02258799615316093} +{"step": 35200, "loss": 0.021228897972032427, "loss_real": 0.016132926126010715, "loss_synth": 0.020808046972379087, "lr": 0.00013023074232613552, "elapsed": 1330.9447295260034, "steps_per_second": 26.833947791883382, "loss_extra": 0.02253328209742904} +{"step": 35400, "loss": 0.02125730546191335, "loss_real": 0.0164350616466254, "loss_synth": 0.020791700426489115, "lr": 0.0001272831598696703, "elapsed": 1337.7918726050411, "steps_per_second": 26.846281984931768, "loss_extra": 0.022558699510991573} +{"step": 35600, "loss": 0.02120181948877871, "loss_real": 0.016068570879288018, "loss_synth": 0.02074371370486915, "lr": 0.00012436379887401295, "elapsed": 1344.6576333290432, "steps_per_second": 26.85811153355733, "loss_extra": 0.022549776630476116} +{"step": 35800, "loss": 0.021254113931208848, "loss_real": 0.01609394046943635, "loss_synth": 0.020808864925056694, "lr": 0.00012147312034010696, "elapsed": 1351.5326202940196, "steps_per_second": 26.869633077225476, "loss_extra": 0.022593946382403373} +{"step": 36000, "loss": 0.0211319275572896, "loss_real": 0.015919458493590354, "loss_synth": 0.02065255433320999, "lr": 0.00011861158073960271, "elapsed": 1358.3757501509972, "steps_per_second": 26.88167576969192, "loss_extra": 0.022514824597164987} +{"step": 36200, "loss": 0.021130645042285325, "loss_real": 0.0157683340087533, "loss_synth": 0.02063828262500465, "lr": 0.00011577963194277514, "elapsed": 1365.271177085, "steps_per_second": 26.89255118480733, "loss_extra": 0.02255250871181488} +{"step": 36400, "loss": 0.02115519741550088, "loss_real": 0.01589439389295876, "loss_synth": 0.02060911119915545, "lr": 0.0001129777211471684, "elapsed": 1371.9636710840277, "steps_per_second": 26.907351533357016, "loss_extra": 0.022612922014668583} +{"step": 36600, "loss": 0.021165590146556498, "loss_real": 0.016061053960584104, "loss_synth": 0.020709480876103043, "lr": 0.00011020629080697766, "elapsed": 1378.7010484900093, "steps_per_second": 26.92111732891264, "loss_extra": 0.022506571104750038} +{"step": 36800, "loss": 0.021199059849604966, "loss_real": 0.016080022156238556, "loss_synth": 0.02066233632154763, "lr": 0.00010746577856318116, "elapsed": 1385.6000663920422, "steps_per_second": 26.931561184508883, "loss_extra": 0.02262283275835216} +{"step": 37000, "loss": 0.02106791620142758, "loss_real": 0.016045905062928797, "loss_synth": 0.02055170022882521, "lr": 0.00010475661717443124, "elapsed": 1392.4417706790264, "steps_per_second": 26.94302451784412, "loss_extra": 0.022454411955550313} +{"step": 37200, "loss": 0.021117739705368878, "loss_real": 0.015740729942917822, "loss_synth": 0.0206085610575974, "lr": 0.00010207923444871681, "elapsed": 1399.2776133440202, "steps_per_second": 26.954488671606295, "loss_extra": 0.0225589017290622} +{"step": 37400, "loss": 0.021075530936941506, "loss_real": 0.016052101491950452, "loss_synth": 0.020586944464594126, "lr": 9.94340531758075e-05, "elapsed": 1406.113882657024, "steps_per_second": 26.965831507398114, "loss_extra": 0.022434760807082055} +{"step": 37600, "loss": 0.02104799778200686, "loss_real": 0.01602620561141521, "loss_synth": 0.02058611365035176, "lr": 9.682149106049004e-05, "elapsed": 1412.9249488270143, "steps_per_second": 26.977550920431728, "loss_extra": 0.02238035419024527} +{"step": 37800, "loss": 0.02103499968536198, "loss_real": 0.01589299271814525, "loss_synth": 0.02057220851071179, "lr": 9.424196065660837e-05, "elapsed": 1419.7510577640496, "steps_per_second": 26.988866474476296, "loss_extra": 0.02238914373330772} +{"step": 38000, "loss": 0.02101908656768501, "loss_real": 0.015777812427841126, "loss_synth": 0.020578989731147884, "lr": 9.169586930191606e-05, "elapsed": 1426.586344588024, "steps_per_second": 26.999896185933817, "loss_extra": 0.022367878090590237} +{"step": 38200, "loss": 0.021021831780672073, "loss_real": 0.015864021605812014, "loss_synth": 0.020513496631756424, "lr": 8.91836190537533e-05, "elapsed": 1433.424639186007, "steps_per_second": 27.0107618107362, "loss_extra": 0.022424072744324803} +{"step": 38400, "loss": 0.021013759933412077, "loss_real": 0.015914595504291355, "loss_synth": 0.020596181377768516, "lr": 8.670560662555727e-05, "elapsed": 1440.2959174580174, "steps_per_second": 27.02089574748549, "loss_extra": 0.022315440261736513} +{"step": 38600, "loss": 0.020891599589958787, "loss_real": 0.015793666606768966, "loss_synth": 0.02040124443359673, "lr": 8.426222332421624e-05, "elapsed": 1447.1352803630289, "steps_per_second": 27.03153629052035, "loss_extra": 0.0222655344940722} +{"step": 38800, "loss": 0.02097811918705702, "loss_real": 0.015888621248304844, "loss_synth": 0.02050581977702677, "lr": 8.185385498827815e-05, "elapsed": 1454.0073095910484, "steps_per_second": 27.04145972887733, "loss_extra": 0.022332609230652452} +{"step": 39000, "loss": 0.02086904076859355, "loss_real": 0.015566193889826536, "loss_synth": 0.020432505970820785, "lr": 7.948088192702195e-05, "elapsed": 1460.8621501630405, "steps_per_second": 27.051611098348566, "loss_extra": 0.022224982753396034} +{"step": 39200, "loss": 0.020912313358858226, "loss_real": 0.01571559235919267, "loss_synth": 0.020473562870174645, "lr": 7.714367886040248e-05, "elapsed": 1467.724617245025, "steps_per_second": 27.061523908374063, "loss_extra": 0.022252024030312897} +{"step": 39400, "loss": 0.020889821508899332, "loss_real": 0.015596115998923778, "loss_synth": 0.02040784662589431, "lr": 7.48426148598775e-05, "elapsed": 1474.576294235012, "steps_per_second": 27.071543939266757, "loss_extra": 0.022289422564208506} +{"step": 39600, "loss": 0.020931321689859034, "loss_real": 0.01577978689223528, "loss_synth": 0.020440599219873547, "lr": 7.25780532901276e-05, "elapsed": 1483.312578512996, "steps_per_second": 27.046611397007908, "loss_extra": 0.022314934404566885} +{"step": 39800, "loss": 0.020885824589058757, "loss_real": 0.015582906836643816, "loss_synth": 0.020407000714913012, "lr": 7.035035175167622e-05, "elapsed": 1491.3171188330161, "steps_per_second": 27.035406170972855, "loss_extra": 0.022283888338133693} +{"step": 40000, "loss": 0.020852712662890554, "loss_real": 0.015604182668030262, "loss_synth": 0.02040978506207466, "lr": 6.81598620244206e-05, "elapsed": 1500.431794469012, "steps_per_second": 27.004068655225336, "loss_extra": 0.02220558368600905} +{"step": 40200, "loss": 0.020814074110239743, "loss_real": 0.015499638067558408, "loss_synth": 0.020326963514089583, "lr": 6.600693001208181e-05, "elapsed": 1552.3736366680241, "steps_per_second": 26.21966937668411, "loss_extra": 0.022222390687093137} +{"step": 40400, "loss": 0.020886320238932967, "loss_real": 0.015498171858489514, "loss_synth": 0.020423468258231877, "lr": 6.38918956875819e-05, "elapsed": 1561.5394691760303, "steps_per_second": 26.193524416425703, "loss_extra": 0.022283287001773715} +{"step": 40600, "loss": 0.020807001693174242, "loss_real": 0.015744069335050882, "loss_synth": 0.02032174536958337, "lr": 6.181509303935915e-05, "elapsed": 1570.6966574340477, "steps_per_second": 26.167834155699534, "loss_extra": 0.02216977834701538} +{"step": 40800, "loss": 0.02082610503770411, "loss_real": 0.015572588546201587, "loss_synth": 0.020301416395232082, "lr": 5.977685001862671e-05, "elapsed": 1579.8555405030493, "steps_per_second": 26.142416975571457, "loss_extra": 0.022261257069185376} +{"step": 41000, "loss": 0.02086165677756071, "loss_real": 0.0158540673321113, "loss_synth": 0.020348724368959667, "lr": 5.7777488487585654e-05, "elapsed": 1589.0369067970314, "steps_per_second": 26.116922331960396, "loss_extra": 0.022242377493530512} +{"step": 41200, "loss": 0.020809578504413367, "loss_real": 0.015372462780214846, "loss_synth": 0.020372907500714063, "lr": 5.581732416859908e-05, "elapsed": 1598.147542885039, "steps_per_second": 26.092892947298093, "loss_extra": 0.022188982544466853} +{"step": 41400, "loss": 0.020743938032537698, "loss_real": 0.015240998412482441, "loss_synth": 0.020283790715038778, "lr": 5.3896666594335835e-05, "elapsed": 1607.3198353570187, "steps_per_second": 26.068127192322144, "loss_extra": 0.022158153811469673} +{"step": 41600, "loss": 0.020795595329254866, "loss_real": 0.015369765786454081, "loss_synth": 0.020370298782363534, "lr": 5.20158190588919e-05, "elapsed": 1616.5879159610486, "steps_per_second": 26.042084148742155, "loss_extra": 0.022161711873486638} +{"step": 41800, "loss": 0.02079072954133153, "loss_real": 0.01563013330567628, "loss_synth": 0.020458366125822067, "lr": 5.017507856989665e-05, "elapsed": 1625.8392679550452, "steps_per_second": 26.016612477784474, "loss_extra": 0.022018228275701403} +{"step": 42000, "loss": 0.020722834495827555, "loss_real": 0.015580365722998977, "loss_synth": 0.02027656895108521, "lr": 4.837473580161169e-05, "elapsed": 1635.0703737910371, "steps_per_second": 25.99175809548965, "loss_extra": 0.02206060364842415} +{"step": 42200, "loss": 0.020752329947426915, "loss_real": 0.015503476234152913, "loss_synth": 0.020297697531059384, "lr": 4.6615075049030575e-05, "elapsed": 1644.1160816670163, "steps_per_second": 25.97014881910565, "loss_extra": 0.02211691251024604} +{"step": 42400, "loss": 0.02071872984059155, "loss_real": 0.015398826100863516, "loss_synth": 0.020274283038452266, "lr": 4.489637418298455e-05, "elapsed": 1653.1323754100013, "steps_per_second": 25.94924591146343, "loss_extra": 0.022085513360798358} +{"step": 42600, "loss": 0.020722549557685852, "loss_real": 0.015566450282931328, "loss_synth": 0.020263927606865764, "lr": 4.321890460626433e-05, "elapsed": 1662.1238871460082, "steps_per_second": 25.928963515744222, "loss_extra": 0.022074990393593907} +{"step": 42800, "loss": 0.02069103197194636, "loss_real": 0.015555730899795889, "loss_synth": 0.02023970289155841, "lr": 4.158293121076186e-05, "elapsed": 1671.1126909489976, "steps_per_second": 25.908944408400817, "loss_extra": 0.02203259779140353} +{"step": 43000, "loss": 0.02073434056714177, "loss_real": 0.01541065953206271, "loss_synth": 0.020331217916682364, "lr": 3.99887123356411e-05, "elapsed": 1680.0992523050518, "steps_per_second": 25.889176927667844, "loss_extra": 0.022060631085187198} +{"step": 43200, "loss": 0.020616978406906128, "loss_real": 0.015278406008146703, "loss_synth": 0.020127885183319448, "lr": 3.843649972654328e-05, "elapsed": 1689.0939892090391, "steps_per_second": 25.8694955495265, "loss_extra": 0.022031462593004106} +{"step": 43400, "loss": 0.020690744733437894, "loss_real": 0.015487785073928536, "loss_synth": 0.02020983069203794, "lr": 3.69265384958331e-05, "elapsed": 1698.1638329220004, "steps_per_second": 25.848868699180404, "loss_extra": 0.02207352450117469} +{"step": 43600, "loss": 0.02073556849732995, "loss_real": 0.015574980876408517, "loss_synth": 0.020282473051920533, "lr": 3.545906708389291e-05, "elapsed": 1707.2464370950474, "steps_per_second": 25.828268261688745, "loss_extra": 0.022083285888656976} +{"step": 43800, "loss": 0.02064697372727096, "loss_real": 0.015335553586483001, "loss_synth": 0.020264849634841084, "lr": 3.403431722147019e-05, "elapsed": 1716.3345541400486, "steps_per_second": 25.807804484456753, "loss_extra": 0.02195022478699684} +{"step": 44000, "loss": 0.02068153495900333, "loss_real": 0.015470392354764044, "loss_synth": 0.020248840702697633, "lr": 3.265251389308442e-05, "elapsed": 1725.448162729037, "steps_per_second": 25.7871734391244, "loss_extra": 0.02201772039756179} +{"step": 44200, "loss": 0.02067790014669299, "loss_real": 0.01527107012923807, "loss_synth": 0.02023701281286776, "lr": 3.1313875301499545e-05, "elapsed": 1734.5584559970303, "steps_per_second": 25.766811412865188, "loss_extra": 0.02205624068155885} +{"step": 44400, "loss": 0.02065150212496519, "loss_real": 0.015534123410470784, "loss_synth": 0.020177372563630343, "lr": 3.0018612833267117e-05, "elapsed": 1743.7198733440018, "steps_per_second": 25.745901268133995, "loss_extra": 0.022012658175081013} +{"step": 44600, "loss": 0.020655553871765733, "loss_real": 0.01551202850881964, "loss_synth": 0.02023762308061123, "lr": 2.8766931025346027e-05, "elapsed": 1752.8705043840455, "steps_per_second": 25.725372165881705, "loss_extra": 0.021965291630476714} +{"step": 44800, "loss": 0.02063587764278054, "loss_real": 0.015153767396695913, "loss_synth": 0.020226941565051674, "lr": 2.755902753280375e-05, "elapsed": 1762.0874019380426, "steps_per_second": 25.70408131496009, "loss_extra": 0.021995480796322228} +{"step": 45000, "loss": 0.02057852112688124, "loss_real": 0.015229122960008681, "loss_synth": 0.020154137397184968, "lr": 2.639509309760422e-05, "elapsed": 1771.34946239501, "steps_per_second": 25.682352454290836, "loss_extra": 0.021930450545623897} +{"step": 45200, "loss": 0.02068510898388922, "loss_real": 0.01531834207009524, "loss_synth": 0.020235819770023228, "lr": 2.5275311518487436e-05, "elapsed": 1782.4654972450226, "steps_per_second": 25.633871604188897, "loss_extra": 0.02206485603004694} +{"step": 45400, "loss": 0.020585432825610043, "loss_real": 0.015503500225022435, "loss_synth": 0.020105495508760216, "lr": 2.4199859621945708e-05, "elapsed": 1791.9496480640373, "steps_per_second": 25.60955070827603, "loss_extra": 0.021946214027702807} +{"step": 45600, "loss": 0.020574977211654185, "loss_real": 0.01505711134057492, "loss_synth": 0.020147690400481224, "lr": 2.316890723430054e-05, "elapsed": 1801.460945169034, "steps_per_second": 25.585098958793527, "loss_extra": 0.02195906494744122} +{"step": 45800, "loss": 0.020569985788315533, "loss_real": 0.015088910511694848, "loss_synth": 0.020215910095721483, "lr": 2.218261715488513e-05, "elapsed": 1811.1371071190224, "steps_per_second": 25.558555137064477, "loss_extra": 0.021874781372025608} +{"step": 46000, "loss": 0.020635937191545963, "loss_real": 0.015182169382460415, "loss_synth": 0.02019140156917274, "lr": 2.1241145130336496e-05, "elapsed": 1820.9583560440224, "steps_per_second": 25.530240460487548, "loss_extra": 0.02202606528066099} +{"step": 46200, "loss": 0.0206103369127959, "loss_real": 0.015238200849853455, "loss_synth": 0.020159827386960386, "lr": 2.0344639830001105e-05, "elapsed": 1831.1239406130044, "steps_per_second": 25.497386472313362, "loss_extra": 0.021992231905460357} +{"step": 46400, "loss": 0.0205579187348485, "loss_real": 0.01529816649388522, "loss_synth": 0.020102165155112744, "lr": 1.949324282245851e-05, "elapsed": 1841.5096973120235, "steps_per_second": 25.461822416904777, "loss_extra": 0.021925511052832008} +{"step": 46600, "loss": 0.02059579993598163, "loss_real": 0.015338981142267585, "loss_synth": 0.02016595139168203, "lr": 1.8687088553165976e-05, "elapsed": 1852.426342818013, "steps_per_second": 25.41929817586182, "loss_extra": 0.021937087085098027} +{"step": 46800, "loss": 0.020668157106265427, "loss_real": 0.015176124121062458, "loss_synth": 0.02015181998722255, "lr": 1.7926304323227836e-05, "elapsed": 1863.3964920500293, "steps_per_second": 25.376541142349854, "loss_extra": 0.022136430265381934} +{"step": 47000, "loss": 0.020576168382540345, "loss_real": 0.015218312740325928, "loss_synth": 0.02014043625444174, "lr": 1.721101026929328e-05, "elapsed": 1871.5922559950268, "steps_per_second": 25.372233195008942, "loss_extra": 0.021940867444500328} +{"step": 47200, "loss": 0.020517523931339383, "loss_real": 0.01515293948352337, "loss_synth": 0.020103666977956892, "lr": 1.6541319344585365e-05, "elapsed": 1878.360421607038, "steps_per_second": 25.387442274425602, "loss_extra": 0.02186160959303379} +{"step": 47400, "loss": 0.020607686741277574, "loss_real": 0.015508141843602061, "loss_synth": 0.020206344658508898, "lr": 1.5917337301064426e-05, "elapsed": 1884.9785427160095, "steps_per_second": 25.404583845129306, "loss_extra": 0.021893265387043358} +{"step": 47600, "loss": 0.020596365993842482, "loss_real": 0.015239043841138483, "loss_synth": 0.020164223033934833, "lr": 1.533916267272854e-05, "elapsed": 1891.6034446000122, "steps_per_second": 25.421512183387897, "loss_extra": 0.021957398345693945} +{"step": 47800, "loss": 0.020478380862623453, "loss_real": 0.015296960053965449, "loss_synth": 0.01999484669417143, "lr": 1.480688676005397e-05, "elapsed": 1898.205014378007, "steps_per_second": 25.43863701707109, "loss_extra": 0.021860027397051455} +{"step": 48000, "loss": 0.020636028591543436, "loss_real": 0.01550062927417457, "loss_synth": 0.02017900664359331, "lr": 1.432059361557764e-05, "elapsed": 1904.8286308610113, "steps_per_second": 25.455344330778054, "loss_extra": 0.021983280349522828} +{"step": 48200, "loss": 0.02057850488461554, "loss_real": 0.015372361023910344, "loss_synth": 0.02019007378257811, "lr": 1.3880360030624374e-05, "elapsed": 1911.4514400340267, "steps_per_second": 25.47194555048773, "loss_extra": 0.02186974653042853} +{"step": 48400, "loss": 0.020544912936165928, "loss_real": 0.015409334334544838, "loss_synth": 0.020038918731734155, "lr": 1.3486255523180529e-05, "elapsed": 1918.0659563430236, "steps_per_second": 25.48854227863287, "loss_extra": 0.02194096059538424} +{"step": 48600, "loss": 0.0205357800796628, "loss_real": 0.015294791208580136, "loss_synth": 0.02010826132260263, "lr": 1.313834232691649e-05, "elapsed": 1924.682735436014, "steps_per_second": 25.504993495669442, "loss_extra": 0.021871997574344278} +{"step": 48800, "loss": 0.02057092170231044, "loss_real": 0.015494606322608889, "loss_synth": 0.020093015283346175, "lr": 1.2836675381359077e-05, "elapsed": 1931.2859720110428, "steps_per_second": 25.521511601263132, "loss_extra": 0.0219287047162652} +{"step": 49000, "loss": 0.020543988710269332, "loss_real": 0.015381199498660863, "loss_synth": 0.020031003849580883, "lr": 1.2581302323216026e-05, "elapsed": 1937.8920100030373, "steps_per_second": 25.5378787466296, "loss_extra": 0.021951724709942937} +{"step": 49200, "loss": 0.020529035096988082, "loss_real": 0.015255076261237264, "loss_synth": 0.020090852165594697, "lr": 1.2372263478853567e-05, "elapsed": 1944.5026273310068, "steps_per_second": 25.554072786354848, "loss_extra": 0.0218815993424505} +{"step": 49400, "loss": 0.020531281623989345, "loss_real": 0.015473682945594192, "loss_synth": 0.02000816633924842, "lr": 1.2209591857928498e-05, "elapsed": 1951.1233434070018, "steps_per_second": 25.570022341092915, "loss_extra": 0.021930830189958214} +{"step": 49600, "loss": 0.02057318008504808, "loss_real": 0.015087779518216849, "loss_synth": 0.020147783048450947, "lr": 1.2093313148175555e-05, "elapsed": 1957.7532886520494, "steps_per_second": 25.585741143369436, "loss_extra": 0.02194974634796381} +{"step": 49800, "loss": 0.02060118755325675, "loss_real": 0.015493534728884697, "loss_synth": 0.020141471568495037, "lr": 1.2023445711350887e-05, "elapsed": 1964.3620904650306, "steps_per_second": 25.601631072606526, "loss_extra": 0.02194630153477192} +{"step": 50000, "loss": 0.020553016439080238, "loss_real": 0.015279360027052461, "loss_synth": 0.02005392109043896, "lr": 1.2000000580332747e-05, "elapsed": 1970.9712541600456, "steps_per_second": 25.617408644390462, "loss_extra": 0.021966182384639977} diff --git a/shared/package-files/b0/b0a84367c56fb5820eb58a75283afe6f377835723cbaa08841cbfe6ccd02d78e/replays-5Ms-N5-L-ion-net.sh b/shared/package-files/b0/b0a84367c56fb5820eb58a75283afe6f377835723cbaa08841cbfe6ccd02d78e/replays-5Ms-N5-L-ion-net.sh new file mode 100644 index 0000000000000000000000000000000000000000..327c92c6160b8e4eee465e2bcde13efc1a92f7b3 --- /dev/null +++ b/shared/package-files/b0/b0a84367c56fb5820eb58a75283afe6f377835723cbaa08841cbfe6ccd02d78e/replays-5Ms-N5-L-ion-net.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +cd /workspace/research +N=5Ms-N5-L-ion-net +for pair in val-tiny:tiny edge-input:edge val-sub:sub; do + input=${pair%%:*}; tag=${pair##*:}; name=$input; [ "$input" = edge-input ] && name=edge + bash allcond/checks/replay.sh builds/$N /workspace/research/$input n5-$tag 8-23 > logs/replay-$N-$name.log 2>&1 + mkdir -p evals/replay/$N-$tag; cp /tmp/reloc-n5-$tag/out/rankings.jsonl evals/replay/$N-$tag/rankings.jsonl +done +date -u +%H:%M:%S > logs/replays-$N.done diff --git a/shared/package-files/b0/b0bb567b00b2d8cf92172df13a6c38934b61374951441cb279f5f9508913ace6/invdata.py b/shared/package-files/b0/b0bb567b00b2d8cf92172df13a6c38934b61374951441cb279f5f9508913ace6/invdata.py new file mode 100644 index 0000000000000000000000000000000000000000..72383eae8fca21949b1ba94b9500efb602953f7b --- /dev/null +++ b/shared/package-files/b0/b0bb567b00b2d8cf92172df13a6c38934b61374951441cb279f5f9508913ace6/invdata.py @@ -0,0 +1,86 @@ +"""Stores of the inverse branch on the GPU (see ``prepare_inv.py``) and batch construction.""" +import numpy as np +import torch + +H_INDEX = 7 # inverse.H +RDBE_SIGN = None # set by the trainer from inverse.RDBE_SIGN when the noise augmentation is on + + +def load_padded(path, device, max_peaks=24): + data = np.load(path) + offset = data['offset'] + counts = np.diff(offset) + n, width = len(counts), data['peaks'].shape[1] + row = np.repeat(np.arange(n), counts) + pos = np.arange(offset[-1]) - np.repeat(offset[:-1], counts) + keep = pos < max_peaks + peaks = np.zeros((n, max_peaks, width), dtype=np.uint8) + inten = np.zeros((n, max_peaks), dtype=np.float32) + peaks[row[keep], pos[keep]] = data['peaks'][keep] + inten[row[keep], pos[keep]] = data['inten'][keep] + store = {'root': torch.from_numpy(data['root'].astype(np.int16)), 'peaks': torch.from_numpy(peaks), + 'inten': torch.from_numpy(inten), 'count': torch.from_numpy(np.minimum(counts, max_peaks).astype(np.int16)), + 'adduct': torch.from_numpy(data['adduct']), 'instrument': torch.from_numpy(data['instrument']), + 'energy': torch.from_numpy(data['energy']), 'mol': torch.from_numpy(data['mol'].astype(np.int64)), + 'fps': torch.from_numpy(data['fps'])} + return {k: v.to(device) for k, v in store.items()} + + +def batch_of(store, index, augment=None, generator=None): + """Model inputs of the rows ``index``. ``augment``: dict(peak_drop, min_keep, jitter, energy_drop, instrument_drop).""" + root = store['root'][index].long() + peaks = store['peaks'][index].long() + inten = store['inten'][index].float() + count = store['count'][index].long() + adduct = store['adduct'][index].long() + instrument = store['instrument'][index].long() + energy = store['energy'][index].float() + b, k = inten.shape + device = inten.device + mask = torch.arange(k, device=device).unsqueeze(0) < count.unsqueeze(1) + if augment: + rand = lambda *shape: torch.rand(*shape, device=device, generator=generator) + # truncate to a random number of strongest peaks, then drop peaks at a per-sample rate + if augment.get('truncate', 0) > 0: + cut = rand(b) < augment['truncate'] + limit = (augment['min_keep'] + rand(b) * (k + 1 - augment['min_keep'])).long() + limit = torch.where(cut, limit, torch.full_like(limit, k)) + mask = mask & (torch.arange(k, device=device).unsqueeze(0) < limit.unsqueeze(1)) + if augment.get('peak_drop', 0) > 0: + rate = rand(b, 1) * augment['peak_drop'] + kept = mask & (rand(b, k) >= rate) + mask = torch.where(kept.any(1, keepdim=True), kept, mask) + if augment.get('jitter', 0) > 0: + noise = torch.randn(b, k, device=device, generator=generator) * augment['jitter'] + inten = (inten * torch.exp(noise)).clamp(max=1.0) + if augment.get('noise_rate', 0) > 0: + # E68: spurious annotated peaks (chimeric / noise peaks of real spectra get a sub-formula of the + # candidate formula whenever one fits the mass). A random sub-composition of the root: a shared size + # fraction plus per-element scatter, hydrogens uniform up to the annotation's RDBE bound; the + # strongest k peaks of the union are kept, as for a real spectrum. + n_max = int(augment['noise_max']) + width = root.shape[1] + apply = rand(b) < augment['noise_rate'] + number = (1 + (rand(b) * n_max).long()).clamp(max=n_max) * apply + frac = rand(b, n_max, 1) + scatter = torch.randn(b, n_max, width, device=device, generator=generator) * augment.get('noise_scatter', 0.35) + noise = torch.round((frac + scatter).clamp(0, 1) * root.unsqueeze(1).float()) + noise[..., H_INDEX] = 0 + sign = torch.as_tensor(RDBE_SIGN, dtype=torch.float32, device=device) + hmax = torch.minimum((2 + noise @ sign).clamp(min=0), root[:, H_INDEX].float().unsqueeze(1)) + heavy = noise.sum(-1) > 0 + noise[..., H_INDEX] = torch.floor(rand(b, n_max) * (hmax + 1)).clamp(max=hmax) + n_inten = augment.get('noise_floor', 0.05) + (1 - augment.get('noise_floor', 0.05)) * rand(b, n_max) ** augment.get('noise_shape', 2.0) + n_mask = (torch.arange(n_max, device=device).unsqueeze(0) < number.unsqueeze(1)) & heavy + all_inten = torch.cat([inten * mask, n_inten * n_mask], dim=1) + order = all_inten.argsort(dim=1, descending=True)[:, :k] + peaks = torch.gather(torch.cat([peaks, noise.long()], dim=1), 1, order.unsqueeze(-1).expand(-1, -1, width)) + inten = torch.gather(all_inten, 1, order) + mask = inten > 0 + if augment.get('energy_drop', 0) > 0: + energy = torch.where(rand(b) < augment['energy_drop'], torch.full_like(energy, float('nan')), energy) + if augment.get('instrument_drop', 0) > 0: + instrument = torch.where(rand(b) < augment['instrument_drop'], torch.full_like(instrument, 2), instrument) + inten = inten * mask + peaks = peaks * mask.unsqueeze(-1) + return root, peaks, inten, mask, adduct, instrument, energy diff --git a/shared/package-files/b0/b0fed09c10c38c73823843c2edff1d735dd0b473b4231e9914b1d329821118bd/big-pools-4member-ci.log b/shared/package-files/b0/b0fed09c10c38c73823843c2edff1d735dd0b473b4231e9914b1d329821118bd/big-pools-4member-ci.log new file mode 100644 index 0000000000000000000000000000000000000000..ccfb8b47873d8b124995b1122731533608c3c46a --- /dev/null +++ b/shared/package-files/b0/b0fed09c10c38c73823843c2edff1d735dd0b473b4231e9914b1d329821118bd/big-pools-4member-ci.log @@ -0,0 +1,19 @@ +cumulative share of queries in the largest pools: top1=0.028 top2=0.037 top5=0.058 top10=0.077 top20=0.112 top50=0.190 top100=0.287 + size share dom orbi Na | released rel-fwd inv relM relM-fwd 4bin 4bin-fwd 4M 4M-fwd + 542 0.028 0.00 1.00 0.79 | 0 0 88 0 0 1 1 4 4 + 179 0.009 0.00 1.00 1.00 | 6 3 43 2 2 0 4 0 4 + 157 0.008 0.01 0.99 0.57 | 14 15 3 14 17 15 16 15 15 +query-weighted Hit@1 without the 5 largest pools: released=0.7408 rel-fwd=0.6511 inv=0.5321 relM=0.7446 relM-fwd=0.6683 4bin=0.7329 4bin-fwd=0.6469 4M=0.7534 4M-fwd=0.6722 +query-weighted Hit@1 without the 10 largest pools: released=0.7439 rel-fwd=0.6566 inv=0.5352 relM=0.7478 relM-fwd=0.6742 4bin=0.7359 4bin-fwd=0.6523 4M=0.7568 4M-fwd=0.6782 +query-weighted Hit@1 without the 20 largest pools: released=0.7535 rel-fwd=0.6706 inv=0.5367 relM=0.7575 relM-fwd=0.6889 4bin=0.7452 4bin-fwd=0.6661 4M=0.7669 4M-fwd=0.6930 +query-weighted Hit@1 without the 50 largest pools: released=0.7659 rel-fwd=0.6842 inv=0.5472 relM=0.7735 relM-fwd=0.7011 4bin=0.7633 4bin-fwd=0.6859 4M=0.7806 4M-fwd=0.7056 +query-weighted Hit@1 (all pools): released=0.7384 rel-fwd=0.6539 inv=0.5139 relM=0.7420 relM-fwd=0.6701 4bin=0.7123 4bin-fwd=0.6220 4M=0.7316 4M-fwd=0.6459 +pool-macro Hit@1: released=0.8210 rel-fwd=0.7519 inv=0.5898 relM=0.8234 relM-fwd=0.7628 4bin=0.8204 4bin-fwd=0.7563 4M=0.8290 4M-fwd=0.7688 + rel-fwd vs released: pools +55 -289 | macro -0.0691 [-0.0791,-0.0582] | without top 20 -0.0829 [-0.1026,-0.0632] | pool weight min(n,30) -0.0845 [-0.1022,-0.0659] | query-weighted -0.0845 [-0.1056,-0.0640] + inv vs released: pools +68 -851 | macro -0.2312 [-0.2463,-0.2159] | without top 20 -0.2167 [-0.2466,-0.1873] | pool weight min(n,30) -0.2130 [-0.2392,-0.1871] | query-weighted -0.2245 [-0.2789,-0.1816] + relM vs released: pools +39 -31 | macro +0.0024 [-0.0024,+0.0074] | without top 20 +0.0041 [-0.0124,+0.0202] | pool weight min(n,30) +0.0053 [-0.0084,+0.0189] | query-weighted +0.0036 [-0.0110,+0.0182] + relM-fwd vs released: pools +81 -278 | macro -0.0582 [-0.0688,-0.0473] | without top 20 -0.0646 [-0.0849,-0.0446] | pool weight min(n,30) -0.0669 [-0.0855,-0.0486] | query-weighted -0.0682 [-0.0908,-0.0467] + 4bin vs released: pools +48 -50 | macro -0.0006 [-0.0062,+0.0053] | without top 20 -0.0083 [-0.0216,+0.0038] | pool weight min(n,30) -0.0060 [-0.0177,+0.0059] | query-weighted -0.0260 [-0.0852,+0.0200] + 4bin-fwd vs released: pools +76 -295 | macro -0.0647 [-0.0756,-0.0532] | without top 20 -0.0874 [-0.1089,-0.0660] | pool weight min(n,30) -0.0885 [-0.1089,-0.0672] | query-weighted -0.1164 [-0.1739,-0.0732] + 4M vs released: pools +80 -53 | macro +0.0080 [+0.0012,+0.0148] | without top 20 +0.0134 [-0.0024,+0.0301] | pool weight min(n,30) +0.0134 [-0.0013,+0.0295] | query-weighted -0.0068 [-0.0683,+0.0407] + 4M-fwd vs released: pools +100 -277 | macro -0.0523 [-0.0635,-0.0413] | without top 20 -0.0605 [-0.0829,-0.0394] | pool weight min(n,30) -0.0645 [-0.0847,-0.0444] | query-weighted -0.0925 [-0.1506,-0.0480] diff --git a/shared/package-files/b1/b104a3084ec171ac77b73f2233903ca613b9ea6ddc14596700997126041635f1/I25-ff512x6-real08-corpus2+train3-noise05-rank2.log b/shared/package-files/b1/b104a3084ec171ac77b73f2233903ca613b9ea6ddc14596700997126041635f1/I25-ff512x6-real08-corpus2+train3-noise05-rank2.log new file mode 100644 index 0000000000000000000000000000000000000000..1950a36a8ec03cac9fba39e2b4be12c7a45b75f1 --- /dev/null +++ b/shared/package-files/b1/b104a3084ec171ac77b73f2233903ca613b9ea6ddc14596700997126041635f1/I25-ff512x6-real08-corpus2+train3-noise05-rank2.log @@ -0,0 +1,12 @@ +{"extra_rows": 2031301, "extra_structures": 434950} +{"args": {"store": "/workspace/research/inv", "out": "runs/I25-ff512x6-real08-corpus2+train3-noise05-rank2", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/selfsim/corpus2+train3.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 1, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "noise_rate": 0.5, "noise_max": 12, "noise_scatter": 0.35, "noise_shape": 3.0, "noise_real_rate": 0.0, "synth_peak_drop": -1.0, "synth_jitter": -1.0, "synth_rank_drop": 2.0, "rank_keep": "inv/rank_keep.json", "noise_near": 0.0, "noise_deltas": "inv/noise_deltas.json", "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"gen-x1.manifest.json": null, "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc"}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 27.54604012402706, "extra_store": {"path": "inv/selfsim/corpus2+train3.npz", "rows": 2031301, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/selfsim/train3.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 17.868643710809152, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 43.40271363919601}], "spectra": 2031301, "structures": 434950}}} +{"step": 5000, "elapsed": 151.00557545910124, "val_loss": 0.03534691064661717, "val_cos": 0.6487005898278668, "val_loss_ema": 0.0337743482806187, "val_cos_ema": 0.6620741028432048} +{"step": 10000, "elapsed": 283.40176780102775, "val_loss": 0.030395358593810314, "val_cos": 0.7026839786651076, "val_loss_ema": 0.028747913577159143, "val_cos_ema": 0.716240550027504, "ind_cos": 0.43934324978125483, "agg_cos": 0.46785732667661745, "ind_nll": 0.2882804055792887, "agg_nll": 0.27170724175202016, "retrieval_seconds": 12.520354838925414} +{"step": 15000, "elapsed": 403.42947550606914, "val_loss": 0.02750924452192116, "val_cos": 0.732525467326548, "val_loss_ema": 0.02653670150220434, "val_cos_ema": 0.7410338981636664} +{"step": 20000, "elapsed": 504.34144732903223, "val_loss": 0.026206592455950393, "val_cos": 0.746940947749659, "val_loss_ema": 0.02517344112397222, "val_cos_ema": 0.7567181081397332, "ind_cos": 0.518297390498739, "agg_cos": 0.5548407020433372, "ind_nll": 0.40177054917906224, "agg_nll": 0.39235163930207423, "retrieval_seconds": 11.32653521001339} +{"step": 25000, "elapsed": 615.5103161340812, "val_loss": 0.02529357237886785, "val_cos": 0.7582650315933978, "val_loss_ema": 0.02445412457673412, "val_cos_ema": 0.7655488262150008} +{"step": 30000, "elapsed": 751.3598122720141, "val_loss": 0.024347838067475848, "val_cos": 0.768878658553258, "val_loss_ema": 0.02406346140816402, "val_cos_ema": 0.7719602286892339, "ind_cos": 0.5451644449019507, "agg_cos": 0.5734211745329147, "ind_nll": 0.4392403108754954, "agg_nll": 0.4354315713623964, "retrieval_seconds": 13.833086180966347} +{"step": 35000, "elapsed": 879.3827004210325, "val_loss": 0.02420593737647834, "val_cos": 0.7713175516463792, "val_loss_ema": 0.02357340327771449, "val_cos_ema": 0.7770265770360993} +{"step": 40000, "elapsed": 980.7470724279992, "val_loss": 0.023832665253510178, "val_cos": 0.7758750485541909, "val_loss_ema": 0.023472262457165754, "val_cos_ema": 0.7788119613802177, "ind_cos": 0.5526275155695095, "agg_cos": 0.5817077564465489, "ind_nll": 0.4579237222708323, "agg_nll": 0.4428946420299552, "retrieval_seconds": 11.548225487000309} +{"step": 45000, "elapsed": 1093.3165971450508, "val_loss": 0.023565148539069235, "val_cos": 0.7788497718254607, "val_loss_ema": 0.023284549861371753, "val_cos_ema": 0.7809753496504902} +{"step": 50000, "elapsed": 1234.6558678090805, "val_loss": 0.023378890432818895, "val_cos": 0.7806081271673465, "val_loss_ema": 0.023333811663005667, "val_cos_ema": 0.7807247753438803, "ind_cos": 0.5531422100983067, "agg_cos": 0.5820165731638273, "ind_nll": 0.46404858716351843, "agg_nll": 0.4514385712079881, "retrieval_seconds": 11.417422970989719} diff --git a/shared/package-files/b1/b119973278e4e924227d5ba61d4cf7483a4d409e968b7ed7f5213725e3078781/replay-published-sjhb_7v0-val-tiny.log b/shared/package-files/b1/b119973278e4e924227d5ba61d4cf7483a4d409e968b7ed7f5213725e3078781/replay-published-sjhb_7v0-val-tiny.log new file mode 100644 index 0000000000000000000000000000000000000000..a970efc4e3df88f21a2e04de80f31354e24a4f26 --- /dev/null +++ b/shared/package-files/b1/b119973278e4e924227d5ba61d4cf7483a4d409e968b7ed7f5213725e3078781/replay-published-sjhb_7v0-val-tiny.log @@ -0,0 +1,15 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 5, "inverse_members": 5, "library": true, "ion": true, "workers": 14} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.5996812849771231} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 1.6239971379982308} +{"event": "candidate_store", "pools": 40, "pairs": 9390, "seconds": 1.201049758004956} +{"event": "intact_ion", "scored": 180, "seconds": 0.011333180940710008} +{"event": "library", "scored": 180, "search_seconds": 0.9135015490464866, "seconds": 1.332695099990815} +{"event": "inverse_annotated", "pools": 40, "pairs": 9390, "formulae": 1921, "unsupported_candidates": 75, "seconds": 7.257703691720963e-05} +{"event": "inverse", "scored": 180, "seconds": 1.3269404760794714} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 64.91413666296285} +{"event": "consensus", "scored": 168, "pools": 40, "answers": 400, "search_seconds": 0.025174572016112506, "seconds": 0.06015023204963654} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 0.3446682010544464, "total_seconds": 83.54914172308054} +{"event": "measured", "exit_code": 0, "wall_seconds": 85.5, "user_seconds": 188.9, "system_seconds": 10.3, "max_rss_gib": 2.72} +{"event": "replay_checked", "exit_code": 0, "package_files": 2090, "package_unchanged": true, "processes_left": 0, "rankings": 180} diff --git a/shared/package-files/b1/b143fed7d1df9ed153a3e48880447ecea14095f81f9e81d97a01dd0270d172a2/eval-soupB3-sub.log b/shared/package-files/b1/b143fed7d1df9ed153a3e48880447ecea14095f81f9e81d97a01dd0270d172a2/eval-soupB3-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..9dedb8fc61aab087cbcb039379d12927a65d0844 --- /dev/null +++ b/shared/package-files/b1/b143fed7d1df9ed153a3e48880447ecea14095f81f9e81d97a01dd0270d172a2/eval-soupB3-sub.log @@ -0,0 +1,11 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 1, "inverse_members": 0, "workers": 5} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 15.268683810005314} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 15.689434883010108} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 39.438486938001006, "per_second": 1622.7803084994296} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 82.41583332901064, "per_second": 1553.0996269735417} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 130.11796564000542, "per_second": 1475.5840906028477} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 186.63892298001156, "per_second": 1371.6324328951298} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 268.0892392700043} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 3.116142144004698, "total_seconds": 302.89701650499774} diff --git a/shared/package-files/b1/b144bc37d8d7461ad284f090e223bbc05017a148601fdc67066dfd2f46dcd83a/metrics.jsonl b/shared/package-files/b1/b144bc37d8d7461ad284f090e223bbc05017a148601fdc67066dfd2f46dcd83a/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..77308c70e35f1d99907f88dccbd8e9184a2e9815 --- /dev/null +++ b/shared/package-files/b1/b144bc37d8d7461ad284f090e223bbc05017a148601fdc67066dfd2f46dcd83a/metrics.jsonl @@ -0,0 +1,300 @@ +{"step": 100, "epoch": 0, "elapsed_seconds": 100.41095985900029, "train_loss": 1.7740537559986114, "lr": 1.9508230199714393e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.892088770866394, "train_magma_inten_loss": 0.7857952117919922, "train_frag_loss": 7.623183250427246, "train_loss": 1.5481135845184326}} +{"step": 200, "epoch": 0, "elapsed_seconds": 120.96071145099995, "train_loss": 1.4113497126102448, "lr": 3.80650327856162e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.8864442110061646, "train_magma_inten_loss": 0.7478121519088745, "train_frag_loss": 5.451473236083984, "train_loss": 1.292959451675415}} +{"step": 300, "epoch": 0, "elapsed_seconds": 142.80877786900965, "train_loss": 1.3227240633964539, "lr": 5.571680942997688e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.8968807458877563, "train_magma_inten_loss": 0.7560117840766907, "train_frag_loss": 5.706462383270264, "train_loss": 1.326658010482788}} +{"step": 400, "epoch": 0, "elapsed_seconds": 165.11896668400732, "train_loss": 1.2393658769130707, "lr": 7.250769876880728e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.824951171875, "train_magma_inten_loss": 0.68228679895401, "train_frag_loss": 5.327319622039795, "train_loss": 1.2150187492370605}} +{"step": 500, "epoch": 0, "elapsed_seconds": 187.29678726400016, "train_loss": 1.1295650243759154, "lr": 8.847968677143805e-05, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7921110987663269, "train_magma_inten_loss": 0.6914978623390198, "train_frag_loss": 5.168715000152588, "train_loss": 1.2083693742752075}} +{"step": 600, "epoch": 0, "elapsed_seconds": 208.88936903300055, "train_loss": 1.0700792473554612, "lr": 0.00010367271172731286, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7454839944839478, "train_magma_inten_loss": 0.6669696569442749, "train_frag_loss": 5.157172679901123, "train_loss": 1.1826869249343872}} +{"step": 700, "epoch": 0, "elapsed_seconds": 230.78381685100612, "train_loss": 1.0296791487932204, "lr": 0.00011812476411251463, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6184831857681274, "train_magma_inten_loss": 0.48989030718803406, "train_frag_loss": 4.240436553955078, "train_loss": 0.9139339923858643}} +{"step": 800, "epoch": 0, "elapsed_seconds": 252.23046022201015, "train_loss": 1.017117965221405, "lr": 0.00013187198158574428, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7729309797286987, "train_magma_inten_loss": 0.6854881048202515, "train_frag_loss": 4.512211799621582, "train_loss": 1.1367093324661255}} +{"step": 900, "epoch": 0, "elapsed_seconds": 276.7052447990136, "train_loss": 0.9927142375707626, "lr": 0.00014494873935129066, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6912822127342224, "train_magma_inten_loss": 0.567320704460144, "train_frag_loss": 4.455059051513672, "train_loss": 1.012826681137085}} +{"step": 1000, "epoch": 0, "elapsed_seconds": 300.8232735690108, "train_loss": 0.9792510092258453, "lr": 0.00015738773611494663, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6386334300041199, "train_magma_inten_loss": 0.5244662165641785, "train_frag_loss": 4.684698104858398, "train_loss": 0.9929360151290894}} +{"step": 1100, "epoch": 0, "elapsed_seconds": 326.72290744700877, "train_loss": 0.9581437122821808, "lr": 0.00016922007584780534, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.620966911315918, "train_magma_inten_loss": 0.49369508028030396, "train_frag_loss": 4.026595592498779, "train_loss": 0.8963546752929688}} +{"step": 1200, "epoch": 0, "elapsed_seconds": 353.0399275050004, "train_loss": 0.9543021130561828, "lr": 0.00018047534556238945, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7050926685333252, "train_magma_inten_loss": 0.5876186490058899, "train_frag_loss": 4.5627641677856445, "train_loss": 1.0438950061798096}} +{"step": 1300, "epoch": 0, "elapsed_seconds": 377.6550823900034, "train_loss": 0.9384080666303635, "lr": 0.0001911816892955936, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6378170251846313, "train_magma_inten_loss": 0.5008432865142822, "train_frag_loss": 4.145165920257568, "train_loss": 0.9153598546981812}} +{"step": 1400, "epoch": 0, "elapsed_seconds": 404.23567771501257, "train_loss": 0.9477885764837265, "lr": 0.0002013658784834362, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6689472198486328, "train_magma_inten_loss": 0.5242443084716797, "train_frag_loss": 4.390625953674316, "train_loss": 0.9633069038391113}} +{"step": 1500, "epoch": 0, "elapsed_seconds": 429.4212876500096, "train_loss": 0.9436354398727417, "lr": 0.00021105337890359413, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6039475202560425, "train_magma_inten_loss": 0.45305919647216797, "train_frag_loss": 4.0744404792785645, "train_loss": 0.8605032563209534}} +{"step": 1600, "epoch": 0, "elapsed_seconds": 454.4215085240139, "train_loss": 0.9325923508405686, "lr": 0.0002202684143531114, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.7124615907669067, "train_magma_inten_loss": 0.5447826385498047, "train_frag_loss": 4.4547119140625, "train_loss": 0.9902538061141968}} +{"step": 1700, "epoch": 0, "elapsed_seconds": 481.37086256500334, "train_loss": 0.9033738940954208, "lr": 0.00022903402722050932, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6055444478988647, "train_magma_inten_loss": 0.46985945105552673, "train_frag_loss": 3.728256940841675, "train_loss": 0.8426851630210876}} +{"step": 1800, "epoch": 0, "elapsed_seconds": 508.6904925650015, "train_loss": 0.9003332561254501, "lr": 0.00023737213610376036, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6664231419563293, "train_magma_inten_loss": 0.5739345550537109, "train_frag_loss": 4.3442792892456055, "train_loss": 1.0083625316619873}} +{"step": 1900, "epoch": 0, "elapsed_seconds": 536.5740134950029, "train_loss": 0.9067303723096848, "lr": 0.0002453035906181995, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.588430643081665, "train_magma_inten_loss": 0.46022850275039673, "train_frag_loss": 3.8049869537353516, "train_loss": 0.8407272100448608}} +{"step": 2000, "epoch": 0, "elapsed_seconds": 565.6085497460008, "train_loss": 0.8970537638664245, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5587685108184814, "train_magma_inten_loss": 0.3883253037929535, "train_frag_loss": 4.202614784240723, "train_loss": 0.8085867762565613}} +{"step": 2100, "epoch": 0, "elapsed_seconds": 594.6193814680009, "train_loss": 0.9042337936162949, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6063997745513916, "train_magma_inten_loss": 0.5264608860015869, "train_frag_loss": 3.761025905609131, "train_loss": 0.9025634527206421}} +{"step": 2200, "epoch": 0, "elapsed_seconds": 621.5661709960114, "train_loss": 0.9131686156988144, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6596754193305969, "train_magma_inten_loss": 0.546211302280426, "train_frag_loss": 3.3067831993103027, "train_loss": 0.8768895864486694}} +{"step": 2300, "epoch": 0, "elapsed_seconds": 648.0319577720074, "train_loss": 0.9061290317773819, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6194937825202942, "train_magma_inten_loss": 0.43867814540863037, "train_frag_loss": 3.1146087646484375, "train_loss": 0.7501389980316162}} +{"step": 2400, "epoch": 0, "elapsed_seconds": 675.5292027130054, "train_loss": 0.9035771489143372, "lr": 0.0004, "magma_weight": 1, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5118075609207153, "train_magma_inten_loss": 0.4387442469596863, "train_frag_loss": 3.7470555305480957, "train_loss": 0.8134498000144958}} +{"step": 2500, "epoch": 0, "elapsed_seconds": 702.5536346470035, "train_loss": 0.8907369977235794, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6771305203437805, "train_magma_inten_loss": 0.5388566851615906, "train_frag_loss": 3.6477723121643066, "train_loss": 0.9036339521408081}} +{"step": 2600, "epoch": 0, "elapsed_seconds": 729.2406541210075, "train_loss": 0.8820588076114655, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6931072473526001, "train_magma_inten_loss": 0.5690451860427856, "train_frag_loss": 4.050909042358398, "train_loss": 0.9741361141204834}} +{"step": 2700, "epoch": 0, "elapsed_seconds": 756.2606375810137, "train_loss": 0.8838279139995575, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6103824377059937, "train_magma_inten_loss": 0.5051906704902649, "train_frag_loss": 3.871802806854248, "train_loss": 0.8923709392547607}} +{"step": 2800, "epoch": 0, "elapsed_seconds": 783.5094552090013, "train_loss": 0.8721032053232193, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.705944299697876, "train_magma_inten_loss": 0.625037431716919, "train_frag_loss": 4.007741928100586, "train_loss": 1.0258116722106934}} +{"step": 2900, "epoch": 0, "elapsed_seconds": 809.2109922800009, "train_loss": 0.8733614856004714, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5457860827445984, "train_magma_inten_loss": 0.4082549810409546, "train_frag_loss": 3.161565065383911, "train_loss": 0.7244114875793457}} +{"step": 3000, "epoch": 0, "elapsed_seconds": 834.4096545780048, "train_loss": 0.8632345056533813, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6639077663421631, "train_magma_inten_loss": 0.5540250539779663, "train_frag_loss": 3.354001998901367, "train_loss": 0.8894252777099609}} +{"step": 3100, "epoch": 0, "elapsed_seconds": 861.8942504639999, "train_loss": 0.8620349937677383, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5632625222206116, "train_magma_inten_loss": 0.463964581489563, "train_frag_loss": 3.731602430343628, "train_loss": 0.8371248245239258}} +{"step": 3200, "epoch": 0, "elapsed_seconds": 888.6614823840064, "train_loss": 0.8542520081996918, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5574287176132202, "train_magma_inten_loss": 0.4642412066459656, "train_frag_loss": 3.8284912109375, "train_loss": 0.8470903635025024}} +{"step": 3300, "epoch": 0, "elapsed_seconds": 924.8189349560125, "train_loss": 0.8449605232477189, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6272735595703125, "train_magma_inten_loss": 0.5204660892486572, "train_frag_loss": 3.255053997039795, "train_loss": 0.8459714651107788}} +{"step": 3400, "epoch": 0, "elapsed_seconds": 955.5352597550082, "train_loss": 0.8419636309146881, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5657567381858826, "train_magma_inten_loss": 0.4573209285736084, "train_frag_loss": 3.541259288787842, "train_loss": 0.8114469051361084}} +{"step": 3500, "epoch": 0, "elapsed_seconds": 978.585357724005, "train_loss": 0.8368889373540879, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6427655220031738, "train_magma_inten_loss": 0.501253604888916, "train_frag_loss": 3.415069818496704, "train_loss": 0.8427605628967285}} +{"step": 3600, "epoch": 0, "elapsed_seconds": 1000.4916145110037, "train_loss": 0.8431505668163299, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.618914008140564, "train_magma_inten_loss": 0.4783475995063782, "train_frag_loss": 3.641188144683838, "train_loss": 0.842466413974762}} +{"step": 3700, "epoch": 0, "elapsed_seconds": 1023.6811727750028, "train_loss": 0.8425351762771607, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5161404609680176, "train_magma_inten_loss": 0.357238233089447, "train_frag_loss": 3.8258509635925293, "train_loss": 0.7398233413696289}} +{"step": 3800, "epoch": 0, "elapsed_seconds": 1061.34362426601, "train_loss": 0.8362457275390625, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5866566896438599, "train_magma_inten_loss": 0.4754754304885864, "train_frag_loss": 3.5095624923706055, "train_loss": 0.8264316916465759}} +{"step": 3900, "epoch": 0, "elapsed_seconds": 1104.4022229780094, "train_loss": 0.8335784661769867, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5868145227432251, "train_magma_inten_loss": 0.4721660017967224, "train_frag_loss": 3.9600393772125244, "train_loss": 0.868169903755188}} +{"step": 4000, "epoch": 0, "elapsed_seconds": 1133.8073968900135, "train_loss": 0.8315533912181854, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.63348388671875, "train_magma_inten_loss": 0.5230832099914551, "train_frag_loss": 3.7538375854492188, "train_loss": 0.898466944694519}} +{"step": 4100, "epoch": 0, "elapsed_seconds": 1155.7687591180002, "train_loss": 0.8212388229370117, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.544044017791748, "train_magma_inten_loss": 0.4665061831474304, "train_frag_loss": 3.700039863586426, "train_loss": 0.836510181427002}} +{"step": 4200, "epoch": 0, "elapsed_seconds": 1191.711156718011, "train_loss": 0.8267246019840241, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6845045685768127, "train_magma_inten_loss": 0.5161151885986328, "train_frag_loss": 3.535600185394287, "train_loss": 0.8696752190589905}} +{"step": 4300, "epoch": 0, "elapsed_seconds": 1230.3231720920012, "train_loss": 0.8300324153900146, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6905551552772522, "train_magma_inten_loss": 0.5918607711791992, "train_frag_loss": 3.3640573024749756, "train_loss": 0.9282665252685547}} +{"step": 4400, "epoch": 0, "elapsed_seconds": 1267.855110207005, "train_loss": 0.8345859259366989, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5922882556915283, "train_magma_inten_loss": 0.5098319053649902, "train_frag_loss": 3.4548912048339844, "train_loss": 0.8553210496902466}} +{"step": 4500, "epoch": 0, "elapsed_seconds": 1287.7157055260031, "train_loss": 0.8237324351072312, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6332887411117554, "train_magma_inten_loss": 0.5473529696464539, "train_frag_loss": 4.165038108825684, "train_loss": 0.9638568162918091}} +{"step": 4600, "epoch": 0, "elapsed_seconds": 1308.3312366870086, "train_loss": 0.8209161567687988, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5396663546562195, "train_magma_inten_loss": 0.4151736795902252, "train_frag_loss": 3.4569039344787598, "train_loss": 0.7608640789985657}} +{"step": 4700, "epoch": 0, "elapsed_seconds": 1329.0486926890007, "train_loss": 0.8196816599369049, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5638896822929382, "train_magma_inten_loss": 0.4360616207122803, "train_frag_loss": 4.006328105926514, "train_loss": 0.8366944789886475}} +{"step": 4800, "epoch": 0, "elapsed_seconds": 1349.2497868490027, "train_loss": 0.802842047214508, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.547728419303894, "train_magma_inten_loss": 0.403282105922699, "train_frag_loss": 3.5453529357910156, "train_loss": 0.7578173875808716}} +{"step": 4900, "epoch": 0, "elapsed_seconds": 1369.3387774840085, "train_loss": 0.8133794963359833, "lr": 0.0004, "magma_weight": 1.0, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5096898078918457, "train_magma_inten_loss": 0.3967832326889038, "train_frag_loss": 3.1779682636260986, "train_loss": 0.7145800590515137}} +{"step": 5000, "epoch": 0, "elapsed_seconds": 1389.25467673401, "train_loss": 0.8198991769552231, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5887308120727539, "train_magma_inten_loss": 0.4468494653701782, "train_frag_loss": 3.6772897243499756, "train_loss": 0.7919937372207642}} +{"step": 5100, "epoch": 0, "elapsed_seconds": 1493.9653840300016, "train_loss": 0.7968058830499649, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5666792988777161, "train_magma_inten_loss": 0.46364086866378784, "train_frag_loss": 3.2403008937835693, "train_loss": 0.7655717730522156, "val_loss": 0.6688986420631409}} +{"step": 5200, "epoch": 0, "elapsed_seconds": 1514.8401636420022, "train_loss": 0.7781729388237, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48673880100250244, "train_magma_inten_loss": 0.397665411233902, "train_frag_loss": 3.5421905517578125, "train_loss": 0.725369930267334, "val_loss": 0.6688986420631409}} +{"step": 5300, "epoch": 0, "elapsed_seconds": 1535.529840266012, "train_loss": 0.7814850026369095, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5584940910339355, "train_magma_inten_loss": 0.38764509558677673, "train_frag_loss": 3.113213539123535, "train_loss": 0.6849192380905151, "val_loss": 0.6688986420631409}} +{"step": 5400, "epoch": 0, "elapsed_seconds": 1555.2696177410107, "train_loss": 0.7758226025104523, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.61184161901474, "train_magma_inten_loss": 0.5446096062660217, "train_frag_loss": 3.3856735229492188, "train_loss": 0.8560433983802795, "val_loss": 0.6688986420631409}} +{"step": 5500, "epoch": 0, "elapsed_seconds": 1576.1989779050054, "train_loss": 0.7671005928516388, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48823943734169006, "train_magma_inten_loss": 0.40683138370513916, "train_frag_loss": 3.0991249084472656, "train_loss": 0.6938934326171875, "val_loss": 0.6688986420631409}} +{"step": 5600, "epoch": 0, "elapsed_seconds": 1596.5243714320095, "train_loss": 0.7634423810243607, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5800948739051819, "train_magma_inten_loss": 0.4977468252182007, "train_frag_loss": 3.465259552001953, "train_loss": 0.8178550004959106, "val_loss": 0.6688986420631409}} +{"step": 5700, "epoch": 0, "elapsed_seconds": 1617.1104190250044, "train_loss": 0.7742018264532089, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.6436386108398438, "train_magma_inten_loss": 0.5359054803848267, "train_frag_loss": 3.4319329261779785, "train_loss": 0.8555527925491333, "val_loss": 0.6688986420631409}} +{"step": 5800, "epoch": 0, "elapsed_seconds": 1637.4176816730032, "train_loss": 0.7746387618780136, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5454732179641724, "train_magma_inten_loss": 0.4744509160518646, "train_frag_loss": 3.630310535430908, "train_loss": 0.8082810640335083, "val_loss": 0.6688986420631409}} +{"step": 5900, "epoch": 0, "elapsed_seconds": 1658.3079342510027, "train_loss": 0.7681959390640258, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5223145484924316, "train_magma_inten_loss": 0.42777830362319946, "train_frag_loss": 3.318910837173462, "train_loss": 0.7359338998794556, "val_loss": 0.6688986420631409}} +{"step": 6000, "epoch": 1, "elapsed_seconds": 1747.6703468490014, "train_loss": 0.7565089273452759, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5316979885101318, "train_magma_inten_loss": 0.4134830832481384, "train_frag_loss": 3.3700525760650635, "train_loss": 0.7286093235015869, "val_loss": 0.6688986420631409}} +{"step": 6100, "epoch": 1, "elapsed_seconds": 1768.395951864004, "train_loss": 0.7572216469049454, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4992067813873291, "train_magma_inten_loss": 0.45039910078048706, "train_frag_loss": 3.3739888668060303, "train_loss": 0.7589389085769653, "val_loss": 0.6688986420631409}} +{"step": 6200, "epoch": 1, "elapsed_seconds": 1787.9068686980027, "train_loss": 0.7571384406089783, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4762117266654968, "train_magma_inten_loss": 0.3927617073059082, "train_frag_loss": 3.2475993633270264, "train_loss": 0.6933906078338623, "val_loss": 0.6688986420631409}} +{"step": 6300, "epoch": 1, "elapsed_seconds": 1808.0982085320138, "train_loss": 0.754341892004013, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4040256142616272, "train_magma_inten_loss": 0.3232806324958801, "train_frag_loss": 3.552271842956543, "train_loss": 0.651059627532959, "val_loss": 0.6688986420631409}} +{"step": 6400, "epoch": 1, "elapsed_seconds": 1828.6806079890084, "train_loss": 0.7734231740236283, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48862797021865845, "train_magma_inten_loss": 0.3991715908050537, "train_frag_loss": 3.4848694801330566, "train_loss": 0.7217555046081543, "val_loss": 0.6688986420631409}} +{"step": 6500, "epoch": 1, "elapsed_seconds": 1849.2107314120076, "train_loss": 0.7676567679643631, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46877002716064453, "train_magma_inten_loss": 0.33685073256492615, "train_frag_loss": 3.410001039505005, "train_loss": 0.6569427251815796, "val_loss": 0.6688986420631409}} +{"step": 6600, "epoch": 1, "elapsed_seconds": 1869.3528701780015, "train_loss": 0.7588414996862411, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43197157979011536, "train_magma_inten_loss": 0.3651445508003235, "train_frag_loss": 3.221792697906494, "train_loss": 0.6617885828018188, "val_loss": 0.6688986420631409}} +{"step": 6700, "epoch": 1, "elapsed_seconds": 1889.8866419650003, "train_loss": 0.7482755869626999, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4315933585166931, "train_magma_inten_loss": 0.38652968406677246, "train_frag_loss": 3.148684024810791, "train_loss": 0.6744176149368286, "val_loss": 0.6688986420631409}} +{"step": 6800, "epoch": 1, "elapsed_seconds": 1910.4938693990116, "train_loss": 0.7591897171735763, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41993409395217896, "train_magma_inten_loss": 0.34211277961730957, "train_frag_loss": 3.1831350326538086, "train_loss": 0.6363770961761475, "val_loss": 0.6688986420631409}} +{"step": 6900, "epoch": 1, "elapsed_seconds": 1931.1479557790008, "train_loss": 0.7563842701911926, "lr": 0.0004, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5695245862007141, "train_magma_inten_loss": 0.48270541429519653, "train_frag_loss": 3.0235676765441895, "train_loss": 0.7635084390640259, "val_loss": 0.6688986420631409}} +{"step": 7000, "epoch": 1, "elapsed_seconds": 1950.8442085730057, "train_loss": 0.7452669471502305, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4981977641582489, "train_magma_inten_loss": 0.4286131262779236, "train_frag_loss": 3.5396366119384766, "train_loss": 0.7541388869285583, "val_loss": 0.6688986420631409}} +{"step": 7100, "epoch": 1, "elapsed_seconds": 1972.1152081239998, "train_loss": 0.7455371445417405, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5414891839027405, "train_magma_inten_loss": 0.46525391936302185, "train_frag_loss": 3.5583512783050537, "train_loss": 0.7931290864944458, "val_loss": 0.6688986420631409}} +{"step": 7200, "epoch": 1, "elapsed_seconds": 1993.8200532760093, "train_loss": 0.7475646775960922, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5316568613052368, "train_magma_inten_loss": 0.4291773736476898, "train_frag_loss": 3.2539725303649902, "train_loss": 0.732282817363739, "val_loss": 0.6688986420631409}} +{"step": 7300, "epoch": 1, "elapsed_seconds": 2015.0839787290024, "train_loss": 0.7526470762491226, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49825382232666016, "train_magma_inten_loss": 0.4128924310207367, "train_frag_loss": 3.033632278442383, "train_loss": 0.6944555044174194, "val_loss": 0.6688986420631409}} +{"step": 7400, "epoch": 1, "elapsed_seconds": 2036.656267658007, "train_loss": 0.7401868283748627, "lr": 0.00036, "magma_weight": 0.9, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.536993682384491, "train_magma_inten_loss": 0.48230743408203125, "train_frag_loss": 3.7536895275115967, "train_loss": 0.8256081342697144, "val_loss": 0.6688986420631409}} +{"step": 7500, "epoch": 1, "elapsed_seconds": 2059.3100203150098, "train_loss": 0.7471847409009933, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5930982828140259, "train_magma_inten_loss": 0.5085192918777466, "train_frag_loss": 3.607659339904785, "train_loss": 0.8168097138404846, "val_loss": 0.6688986420631409}} +{"step": 7600, "epoch": 1, "elapsed_seconds": 2080.784622060004, "train_loss": 0.7179597246646882, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.492023766040802, "train_magma_inten_loss": 0.4112340807914734, "train_frag_loss": 3.36065673828125, "train_loss": 0.698797345161438, "val_loss": 0.6688986420631409}} +{"step": 7700, "epoch": 1, "elapsed_seconds": 2101.269130738001, "train_loss": 0.7060106480121613, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.518216609954834, "train_magma_inten_loss": 0.4230251908302307, "train_frag_loss": 3.737992763519287, "train_loss": 0.7438889741897583, "val_loss": 0.6688986420631409}} +{"step": 7800, "epoch": 1, "elapsed_seconds": 2123.4567260520125, "train_loss": 0.7189135301113129, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4424758553504944, "train_magma_inten_loss": 0.3469266891479492, "train_frag_loss": 3.409101963043213, "train_loss": 0.6412183046340942, "val_loss": 0.6688986420631409}} +{"step": 7900, "epoch": 1, "elapsed_seconds": 2146.523919178013, "train_loss": 0.714047247171402, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4734421670436859, "train_magma_inten_loss": 0.38168564438819885, "train_frag_loss": 3.3969902992248535, "train_loss": 0.6742756366729736, "val_loss": 0.6688986420631409}} +{"step": 8000, "epoch": 1, "elapsed_seconds": 2168.675395653001, "train_loss": 0.7150724130868912, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5535145998001099, "train_magma_inten_loss": 0.44528576731681824, "train_frag_loss": 3.1974105834960938, "train_loss": 0.7248395085334778, "val_loss": 0.6688986420631409}} +{"step": 8100, "epoch": 1, "elapsed_seconds": 2191.8829494920064, "train_loss": 0.7049242317676544, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5514010190963745, "train_magma_inten_loss": 0.5102192759513855, "train_frag_loss": 3.522911310195923, "train_loss": 0.8033996224403381, "val_loss": 0.6688986420631409}} +{"step": 8200, "epoch": 1, "elapsed_seconds": 2212.763932508009, "train_loss": 0.7108853244781494, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5011420249938965, "train_magma_inten_loss": 0.41692426800727844, "train_frag_loss": 3.4309616088867188, "train_loss": 0.7108335494995117, "val_loss": 0.6688986420631409}} +{"step": 8300, "epoch": 1, "elapsed_seconds": 2233.5096300350124, "train_loss": 0.7073366808891296, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5361970067024231, "train_magma_inten_loss": 0.45139819383621216, "train_frag_loss": 3.695492744445801, "train_loss": 0.7668448686599731, "val_loss": 0.6688986420631409}} +{"step": 8400, "epoch": 1, "elapsed_seconds": 2254.385306539014, "train_loss": 0.713377902507782, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5960181951522827, "train_magma_inten_loss": 0.4986923635005951, "train_frag_loss": 3.8799843788146973, "train_loss": 0.8314629793167114, "val_loss": 0.6688986420631409}} +{"step": 8500, "epoch": 1, "elapsed_seconds": 2275.2744505630108, "train_loss": 0.7114146536588669, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46676474809646606, "train_magma_inten_loss": 0.4106409549713135, "train_frag_loss": 3.383082628250122, "train_loss": 0.6953341960906982, "val_loss": 0.6688986420631409}} +{"step": 8600, "epoch": 1, "elapsed_seconds": 2295.7996756290086, "train_loss": 0.6988618379831314, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5025535821914673, "train_magma_inten_loss": 0.44231316447257996, "train_frag_loss": 3.0393638610839844, "train_loss": 0.6999472975730896, "val_loss": 0.6688986420631409}} +{"step": 8700, "epoch": 1, "elapsed_seconds": 2316.5948100960086, "train_loss": 0.699281341433525, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5418184399604797, "train_magma_inten_loss": 0.4802696704864502, "train_frag_loss": 3.024742364883423, "train_loss": 0.7369681000709534, "val_loss": 0.6688986420631409}} +{"step": 8800, "epoch": 1, "elapsed_seconds": 2337.674327918008, "train_loss": 0.6996990072727204, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5497233867645264, "train_magma_inten_loss": 0.4347609281539917, "train_frag_loss": 2.9676618576049805, "train_loss": 0.6969844102859497, "val_loss": 0.6688986420631409}} +{"step": 8900, "epoch": 1, "elapsed_seconds": 2358.7797510110104, "train_loss": 0.6916336047649384, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.47478601336479187, "train_magma_inten_loss": 0.42766326665878296, "train_frag_loss": 3.6529035568237305, "train_loss": 0.732501745223999, "val_loss": 0.6688986420631409}} +{"step": 9000, "epoch": 1, "elapsed_seconds": 2380.701003634007, "train_loss": 0.6898642855882645, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5463628768920898, "train_magma_inten_loss": 0.4748128056526184, "train_frag_loss": 3.3664004802703857, "train_loss": 0.7610857486724854, "val_loss": 0.6688986420631409}} +{"step": 9100, "epoch": 1, "elapsed_seconds": 2402.056817626013, "train_loss": 0.6969963562488556, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.408163458108902, "train_magma_inten_loss": 0.3245201110839844, "train_frag_loss": 3.5135369300842285, "train_loss": 0.6250088214874268, "val_loss": 0.6688986420631409}} +{"step": 9200, "epoch": 1, "elapsed_seconds": 2423.5465405310097, "train_loss": 0.6978344535827636, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5470241904258728, "train_magma_inten_loss": 0.45104068517684937, "train_frag_loss": 3.6650843620300293, "train_loss": 0.7661494016647339, "val_loss": 0.6688986420631409}} +{"step": 9300, "epoch": 1, "elapsed_seconds": 2445.312165951007, "train_loss": 0.6880137825012207, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5128260850906372, "train_magma_inten_loss": 0.47138649225234985, "train_frag_loss": 3.1648879051208496, "train_loss": 0.7356159687042236, "val_loss": 0.6688986420631409}} +{"step": 9400, "epoch": 1, "elapsed_seconds": 2467.236137207001, "train_loss": 0.6916979897022247, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.472615510225296, "train_magma_inten_loss": 0.40526148676872253, "train_frag_loss": 3.4097635746002197, "train_loss": 0.6942496299743652, "val_loss": 0.6688986420631409}} +{"step": 9500, "epoch": 1, "elapsed_seconds": 2489.527043023001, "train_loss": 0.6874958372116089, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4445357322692871, "train_magma_inten_loss": 0.38847625255584717, "train_frag_loss": 3.4590201377868652, "train_loss": 0.6793081760406494, "val_loss": 0.6688986420631409}} +{"step": 9600, "epoch": 1, "elapsed_seconds": 2511.5862184240104, "train_loss": 0.691454649567604, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4891691207885742, "train_magma_inten_loss": 0.42356717586517334, "train_frag_loss": 3.4269204139709473, "train_loss": 0.7136120796203613, "val_loss": 0.6688986420631409}} +{"step": 9700, "epoch": 1, "elapsed_seconds": 2532.865441588001, "train_loss": 0.6951497650146484, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.536846935749054, "train_magma_inten_loss": 0.45155367255210876, "train_frag_loss": 3.540905237197876, "train_loss": 0.7545727491378784, "val_loss": 0.6688986420631409}} +{"step": 9800, "epoch": 1, "elapsed_seconds": 2554.691869303002, "train_loss": 0.6925404274463653, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5268007516860962, "train_magma_inten_loss": 0.4766683578491211, "train_frag_loss": 3.086900234222412, "train_loss": 0.7362323999404907, "val_loss": 0.6688986420631409}} +{"step": 9900, "epoch": 1, "elapsed_seconds": 2576.9092497300007, "train_loss": 0.695023655295372, "lr": 0.00036, "magma_weight": 0.81, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4649936556816101, "train_magma_inten_loss": 0.37533921003341675, "train_frag_loss": 2.7583281993865967, "train_loss": 0.6157981157302856, "val_loss": 0.6688986420631409}} +{"step": 10000, "epoch": 1, "elapsed_seconds": 2598.7173113880126, "train_loss": 0.6863355672359467, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5917558670043945, "train_magma_inten_loss": 0.49291089177131653, "train_frag_loss": 3.6769979000091553, "train_loss": 0.7877509593963623, "val_loss": 0.6688986420631409}} +{"step": 10100, "epoch": 1, "elapsed_seconds": 2631.65975011501, "train_loss": 0.6697693240642547, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5256770849227905, "train_magma_inten_loss": 0.44940701127052307, "train_frag_loss": 3.481647491455078, "train_loss": 0.7238882780075073, "val_loss": 0.61579430103302}} +{"step": 10200, "epoch": 1, "elapsed_seconds": 2655.418375322013, "train_loss": 0.6732337808609009, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42374223470687866, "train_magma_inten_loss": 0.37187013030052185, "train_frag_loss": 3.5766704082489014, "train_loss": 0.6466667056083679, "val_loss": 0.61579430103302}} +{"step": 10300, "epoch": 1, "elapsed_seconds": 2677.634441098009, "train_loss": 0.6684723526239396, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5007898807525635, "train_magma_inten_loss": 0.41822904348373413, "train_frag_loss": 2.9271645545959473, "train_loss": 0.6539933085441589, "val_loss": 0.61579430103302}} +{"step": 10400, "epoch": 1, "elapsed_seconds": 2700.103622544004, "train_loss": 0.6569058102369308, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49422287940979004, "train_magma_inten_loss": 0.4117666482925415, "train_frag_loss": 3.6930654048919678, "train_loss": 0.7033367156982422, "val_loss": 0.61579430103302}} +{"step": 10500, "epoch": 1, "elapsed_seconds": 2722.1131755820097, "train_loss": 0.6574275016784668, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5326677560806274, "train_magma_inten_loss": 0.4579973518848419, "train_frag_loss": 3.1455636024475098, "train_loss": 0.7075446248054504, "val_loss": 0.61579430103302}} +{"step": 10600, "epoch": 1, "elapsed_seconds": 2744.168650798005, "train_loss": 0.6572533297538757, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4448246657848358, "train_magma_inten_loss": 0.3719705045223236, "train_frag_loss": 3.4154717922210693, "train_loss": 0.6407018303871155, "val_loss": 0.61579430103302}} +{"step": 10700, "epoch": 1, "elapsed_seconds": 2765.727312834002, "train_loss": 0.6517624926567077, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4117943346500397, "train_magma_inten_loss": 0.34030115604400635, "train_frag_loss": 3.181182622909546, "train_loss": 0.5915839672088623, "val_loss": 0.61579430103302}} +{"step": 10800, "epoch": 1, "elapsed_seconds": 2787.772699773006, "train_loss": 0.6607393771409988, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49951091408729553, "train_magma_inten_loss": 0.4299427568912506, "train_frag_loss": 3.091648817062378, "train_loss": 0.6741769313812256, "val_loss": 0.61579430103302}} +{"step": 10900, "epoch": 1, "elapsed_seconds": 2810.141895996014, "train_loss": 0.6661687570810318, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.512148916721344, "train_magma_inten_loss": 0.4394596815109253, "train_frag_loss": 3.1103193759918213, "train_loss": 0.6859006881713867, "val_loss": 0.61579430103302}} +{"step": 11000, "epoch": 1, "elapsed_seconds": 2833.856475561013, "train_loss": 0.6587764620780945, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43817776441574097, "train_magma_inten_loss": 0.37170612812042236, "train_frag_loss": 3.0456080436706543, "train_loss": 0.61174476146698, "val_loss": 0.61579430103302}} +{"step": 11100, "epoch": 1, "elapsed_seconds": 2856.1900700140104, "train_loss": 0.6596160387992859, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4781331717967987, "train_magma_inten_loss": 0.41366511583328247, "train_frag_loss": 3.121623992919922, "train_loss": 0.6587023138999939, "val_loss": 0.61579430103302}} +{"step": 11200, "epoch": 1, "elapsed_seconds": 2877.855098208005, "train_loss": 0.6597282582521439, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5676745176315308, "train_magma_inten_loss": 0.48475515842437744, "train_frag_loss": 3.6065726280212402, "train_loss": 0.7701454162597656, "val_loss": 0.61579430103302}} +{"step": 11300, "epoch": 1, "elapsed_seconds": 2900.317206414009, "train_loss": 0.6615208756923675, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5061986446380615, "train_magma_inten_loss": 0.45742613077163696, "train_frag_loss": 3.533235549926758, "train_loss": 0.728216290473938, "val_loss": 0.61579430103302}} +{"step": 11400, "epoch": 1, "elapsed_seconds": 2921.7237453480047, "train_loss": 0.6613386681675911, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4933391511440277, "train_magma_inten_loss": 0.4072325527667999, "train_frag_loss": 3.319265365600586, "train_loss": 0.6725418567657471, "val_loss": 0.61579430103302}} +{"step": 11500, "epoch": 1, "elapsed_seconds": 2944.192230841014, "train_loss": 0.6551892477273941, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5603952407836914, "train_magma_inten_loss": 0.4642987847328186, "train_frag_loss": 3.2818422317504883, "train_loss": 0.729587197303772, "val_loss": 0.61579430103302}} +{"step": 11600, "epoch": 1, "elapsed_seconds": 2966.170103335011, "train_loss": 0.663880884051323, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3498295545578003, "train_magma_inten_loss": 0.28756076097488403, "train_frag_loss": 2.7271084785461426, "train_loss": 0.503241777420044, "val_loss": 0.61579430103302}} +{"step": 11700, "epoch": 1, "elapsed_seconds": 2987.6555848940043, "train_loss": 0.6642058333754539, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42135149240493774, "train_magma_inten_loss": 0.3508960008621216, "train_frag_loss": 3.4488635063171387, "train_loss": 0.6214115619659424, "val_loss": 0.61579430103302}} +{"step": 11800, "epoch": 1, "elapsed_seconds": 3009.905699505005, "train_loss": 0.6740891522169113, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5305957794189453, "train_magma_inten_loss": 0.49751317501068115, "train_frag_loss": 3.0372157096862793, "train_loss": 0.7278915643692017, "val_loss": 0.61579430103302}} +{"step": 11900, "epoch": 2, "elapsed_seconds": 3120.5896571420017, "train_loss": 0.6533581984043121, "lr": 0.00036, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4849260151386261, "train_magma_inten_loss": 0.4315658211708069, "train_frag_loss": 3.6251626014709473, "train_loss": 0.7103007435798645, "val_loss": 0.61579430103302}} +{"step": 12000, "epoch": 2, "elapsed_seconds": 3158.562731531012, "train_loss": 0.6504946514964104, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4473133087158203, "train_magma_inten_loss": 0.3945876359939575, "train_frag_loss": 2.9542336463928223, "train_loss": 0.6242399215698242, "val_loss": 0.61579430103302}} +{"step": 12100, "epoch": 2, "elapsed_seconds": 3196.7469859990088, "train_loss": 0.6486334866285324, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4847308397293091, "train_magma_inten_loss": 0.4015638828277588, "train_frag_loss": 2.84822940826416, "train_loss": 0.631738007068634, "val_loss": 0.61579430103302}} +{"step": 12200, "epoch": 2, "elapsed_seconds": 3235.8539966070093, "train_loss": 0.6462839406728744, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.35890233516693115, "train_magma_inten_loss": 0.30160245299339294, "train_frag_loss": 3.1635141372680664, "train_loss": 0.5477508902549744, "val_loss": 0.61579430103302}} +{"step": 12300, "epoch": 2, "elapsed_seconds": 3273.7671906210016, "train_loss": 0.6372727435827256, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41922831535339355, "train_magma_inten_loss": 0.3868321180343628, "train_frag_loss": 2.626119613647461, "train_loss": 0.5870555639266968, "val_loss": 0.61579430103302}} +{"step": 12400, "epoch": 2, "elapsed_seconds": 3313.555872227007, "train_loss": 0.6475494599342346, "lr": 0.000324, "magma_weight": 0.7290000000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45213496685028076, "train_magma_inten_loss": 0.3808632791042328, "train_frag_loss": 3.198159694671631, "train_loss": 0.6333237290382385, "val_loss": 0.61579430103302}} +{"step": 12500, "epoch": 2, "elapsed_seconds": 3352.4279580300063, "train_loss": 0.6431005614995956, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.37075966596603394, "train_magma_inten_loss": 0.30000489950180054, "train_frag_loss": 2.9892008304595947, "train_loss": 0.5204589366912842, "val_loss": 0.61579430103302}} +{"step": 12600, "epoch": 2, "elapsed_seconds": 3391.4600476520136, "train_loss": 0.6202842101454735, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4800627827644348, "train_magma_inten_loss": 0.428802490234375, "train_frag_loss": 3.0320680141448975, "train_loss": 0.6453648209571838, "val_loss": 0.61579430103302}} +{"step": 12700, "epoch": 2, "elapsed_seconds": 3430.8971003550105, "train_loss": 0.6230629295110702, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4580466151237488, "train_magma_inten_loss": 0.3673707842826843, "train_frag_loss": 3.321986198425293, "train_loss": 0.616509735584259, "val_loss": 0.61579430103302}} +{"step": 12800, "epoch": 2, "elapsed_seconds": 3470.643599396004, "train_loss": 0.6158722651004791, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4245452880859375, "train_magma_inten_loss": 0.3480778932571411, "train_frag_loss": 3.0905814170837402, "train_loss": 0.5771480798721313, "val_loss": 0.61579430103302}} +{"step": 12900, "epoch": 2, "elapsed_seconds": 3512.386630508001, "train_loss": 0.6153339222073555, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4536682367324829, "train_magma_inten_loss": 0.34603700041770935, "train_frag_loss": 3.162785530090332, "train_loss": 0.5905617475509644, "val_loss": 0.61579430103302}} +{"step": 13000, "epoch": 2, "elapsed_seconds": 3551.7367664880003, "train_loss": 0.6229253840446473, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4163613021373749, "train_magma_inten_loss": 0.3537181615829468, "train_frag_loss": 2.9059853553771973, "train_loss": 0.5659228563308716, "val_loss": 0.61579430103302}} +{"step": 13100, "epoch": 2, "elapsed_seconds": 3591.7669551770086, "train_loss": 0.6136514401435852, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4070523977279663, "train_magma_inten_loss": 0.361575186252594, "train_frag_loss": 3.3392739295959473, "train_loss": 0.5963045358657837, "val_loss": 0.61579430103302}} +{"step": 13200, "epoch": 2, "elapsed_seconds": 3631.019010203003, "train_loss": 0.6208086746931076, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4379883408546448, "train_magma_inten_loss": 0.3875463902950287, "train_frag_loss": 3.7586183547973633, "train_loss": 0.6514962911605835, "val_loss": 0.61579430103302}} +{"step": 13300, "epoch": 2, "elapsed_seconds": 3671.027018812005, "train_loss": 0.6190425354242325, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5710666179656982, "train_magma_inten_loss": 0.4337236285209656, "train_frag_loss": 3.433547019958496, "train_loss": 0.706230878829956, "val_loss": 0.61579430103302}} +{"step": 13400, "epoch": 2, "elapsed_seconds": 3711.9965478970116, "train_loss": 0.6314315435290336, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4553307890892029, "train_magma_inten_loss": 0.3573499023914337, "train_frag_loss": 3.2991204261779785, "train_loss": 0.6075007915496826, "val_loss": 0.61579430103302}} +{"step": 13500, "epoch": 2, "elapsed_seconds": 3754.01057898601, "train_loss": 0.6260371351242066, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4159596860408783, "train_magma_inten_loss": 0.3423011302947998, "train_frag_loss": 3.40885329246521, "train_loss": 0.5912871360778809, "val_loss": 0.61579430103302}} +{"step": 13600, "epoch": 2, "elapsed_seconds": 3798.3069813060138, "train_loss": 0.6032421708106994, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5809347629547119, "train_magma_inten_loss": 0.4960777163505554, "train_frag_loss": 3.3469045162200928, "train_loss": 0.7448503971099854, "val_loss": 0.61579430103302}} +{"step": 13700, "epoch": 2, "elapsed_seconds": 3846.482618893002, "train_loss": 0.6108228784799575, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4100287854671478, "train_magma_inten_loss": 0.36366569995880127, "train_frag_loss": 3.331268310546875, "train_loss": 0.5981744527816772, "val_loss": 0.61579430103302}} +{"step": 13800, "epoch": 2, "elapsed_seconds": 3900.6625769210077, "train_loss": 0.6092208248376846, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.37980571389198303, "train_magma_inten_loss": 0.3139209747314453, "train_frag_loss": 2.9945502281188965, "train_loss": 0.5330511331558228, "val_loss": 0.61579430103302}} +{"step": 13900, "epoch": 2, "elapsed_seconds": 3956.577984626012, "train_loss": 0.6121221685409546, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4666672945022583, "train_magma_inten_loss": 0.401999831199646, "train_frag_loss": 3.2881836891174316, "train_loss": 0.6399766802787781, "val_loss": 0.61579430103302}} +{"step": 14000, "epoch": 2, "elapsed_seconds": 3982.999641174014, "train_loss": 0.6195598179101944, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4607563614845276, "train_magma_inten_loss": 0.41764527559280396, "train_frag_loss": 3.4881505966186523, "train_loss": 0.6613287329673767, "val_loss": 0.61579430103302}} +{"step": 14100, "epoch": 2, "elapsed_seconds": 4003.3451963290136, "train_loss": 0.6137485399842262, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42934590578079224, "train_magma_inten_loss": 0.3827371299266815, "train_frag_loss": 3.004409074783325, "train_loss": 0.595885157585144, "val_loss": 0.61579430103302}} +{"step": 14200, "epoch": 2, "elapsed_seconds": 4023.023428613, "train_loss": 0.6067247104644775, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43552058935165405, "train_magma_inten_loss": 0.37390631437301636, "train_frag_loss": 3.3729891777038574, "train_loss": 0.6163972616195679, "val_loss": 0.61579430103302}} +{"step": 14300, "epoch": 2, "elapsed_seconds": 4043.4179972560087, "train_loss": 0.6143117368221283, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4216436445713043, "train_magma_inten_loss": 0.3480364680290222, "train_frag_loss": 3.0064563751220703, "train_loss": 0.5706035494804382, "val_loss": 0.61579430103302}} +{"step": 14400, "epoch": 2, "elapsed_seconds": 4064.2117194950115, "train_loss": 0.605269470512867, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43016767501831055, "train_magma_inten_loss": 0.34340447187423706, "train_frag_loss": 3.195702075958252, "train_loss": 0.5829123258590698, "val_loss": 0.61579430103302}} +{"step": 14500, "epoch": 2, "elapsed_seconds": 4086.439238325009, "train_loss": 0.615781016945839, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42636731266975403, "train_magma_inten_loss": 0.34978219866752625, "train_frag_loss": 2.761096954345703, "train_loss": 0.5572754144668579, "val_loss": 0.61579430103302}} +{"step": 14600, "epoch": 2, "elapsed_seconds": 4107.289479372004, "train_loss": 0.6156546360254288, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.44689488410949707, "train_magma_inten_loss": 0.38417407870292664, "train_frag_loss": 3.287411689758301, "train_loss": 0.6214308142662048, "val_loss": 0.61579430103302}} +{"step": 14700, "epoch": 2, "elapsed_seconds": 4128.749665413008, "train_loss": 0.6201842039823532, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4369027018547058, "train_magma_inten_loss": 0.38996484875679016, "train_frag_loss": 3.1599016189575195, "train_loss": 0.6134278774261475, "val_loss": 0.61579430103302}} +{"step": 14800, "epoch": 2, "elapsed_seconds": 4150.326052348013, "train_loss": 0.5986117923259735, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45564210414886475, "train_magma_inten_loss": 0.3780401945114136, "train_frag_loss": 2.703038215637207, "train_loss": 0.5820738077163696, "val_loss": 0.61579430103302}} +{"step": 14900, "epoch": 2, "elapsed_seconds": 4171.918125817014, "train_loss": 0.6075421532988549, "lr": 0.000324, "magma_weight": 0.6561, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5126523971557617, "train_magma_inten_loss": 0.4529127776622772, "train_frag_loss": 3.0667402744293213, "train_loss": 0.6746660470962524, "val_loss": 0.61579430103302}} +{"step": 15000, "epoch": 2, "elapsed_seconds": 4194.173495211013, "train_loss": 0.5951674658060074, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4798049330711365, "train_magma_inten_loss": 0.3913322389125824, "train_frag_loss": 2.8893518447875977, "train_loss": 0.5981760025024414, "val_loss": 0.61579430103302}} +{"step": 15100, "epoch": 2, "elapsed_seconds": 4228.692621668, "train_loss": 0.5951590073108673, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.44763487577438354, "train_magma_inten_loss": 0.35222333669662476, "train_frag_loss": 2.7706186771392822, "train_loss": 0.5548975467681885, "val_loss": 0.5952695608139038}} +{"step": 15200, "epoch": 2, "elapsed_seconds": 4251.081613201008, "train_loss": 0.6036492109298706, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4454800486564636, "train_magma_inten_loss": 0.39355742931365967, "train_frag_loss": 3.2104227542877197, "train_loss": 0.6043925285339355, "val_loss": 0.5952695608139038}} +{"step": 15300, "epoch": 2, "elapsed_seconds": 4273.9631339920015, "train_loss": 0.583668640255928, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4263126254081726, "train_magma_inten_loss": 0.36763355135917664, "train_frag_loss": 3.476719856262207, "train_loss": 0.5969600081443787, "val_loss": 0.5952695608139038}} +{"step": 15400, "epoch": 2, "elapsed_seconds": 4296.491242698001, "train_loss": 0.5866444775462151, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.49795058369636536, "train_magma_inten_loss": 0.42618268728256226, "train_frag_loss": 3.0366616249084473, "train_loss": 0.6348841786384583, "val_loss": 0.5952695608139038}} +{"step": 15500, "epoch": 2, "elapsed_seconds": 4317.617892537004, "train_loss": 0.5786579295992851, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4396396279335022, "train_magma_inten_loss": 0.3713604211807251, "train_frag_loss": 3.226914167404175, "train_loss": 0.5898674726486206, "val_loss": 0.5952695608139038}} +{"step": 15600, "epoch": 2, "elapsed_seconds": 4339.744841215012, "train_loss": 0.5782511594891548, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4331585764884949, "train_magma_inten_loss": 0.37838026881217957, "train_frag_loss": 3.424368381500244, "train_loss": 0.603018045425415, "val_loss": 0.5952695608139038}} +{"step": 15700, "epoch": 2, "elapsed_seconds": 4362.654450138012, "train_loss": 0.5729796004295349, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48056232929229736, "train_magma_inten_loss": 0.38607296347618103, "train_frag_loss": 3.367304801940918, "train_loss": 0.6236032843589783, "val_loss": 0.5952695608139038}} +{"step": 15800, "epoch": 2, "elapsed_seconds": 4386.087695370006, "train_loss": 0.5923942491412163, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.47118306159973145, "train_magma_inten_loss": 0.3891414701938629, "train_frag_loss": 3.435797691345215, "train_loss": 0.6256186962127686, "val_loss": 0.5952695608139038}} +{"step": 15900, "epoch": 2, "elapsed_seconds": 4408.145950213002, "train_loss": 0.57921875, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4984177350997925, "train_magma_inten_loss": 0.3826181888580322, "train_frag_loss": 3.108260154724121, "train_loss": 0.6135789155960083, "val_loss": 0.5952695608139038}} +{"step": 16000, "epoch": 2, "elapsed_seconds": 4431.6660386540025, "train_loss": 0.586729082763195, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34692782163619995, "train_magma_inten_loss": 0.30024418234825134, "train_frag_loss": 2.8240668773651123, "train_loss": 0.48611992597579956, "val_loss": 0.5952695608139038}} +{"step": 16100, "epoch": 2, "elapsed_seconds": 4455.149755797, "train_loss": 0.5926644104719162, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4079301655292511, "train_magma_inten_loss": 0.3312198519706726, "train_frag_loss": 3.2413127422332764, "train_loss": 0.5540297031402588, "val_loss": 0.5952695608139038}} +{"step": 16200, "epoch": 2, "elapsed_seconds": 4478.552036758003, "train_loss": 0.5881014615297318, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.48087263107299805, "train_magma_inten_loss": 0.4034097194671631, "train_frag_loss": 3.3210959434509277, "train_loss": 0.6312389373779297, "val_loss": 0.5952695608139038}} +{"step": 16300, "epoch": 2, "elapsed_seconds": 4501.537353623004, "train_loss": 0.5778064504265785, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45846623182296753, "train_magma_inten_loss": 0.3993460536003113, "train_frag_loss": 2.9444704055786133, "train_loss": 0.5974243879318237, "val_loss": 0.5952695608139038}} +{"step": 16400, "epoch": 2, "elapsed_seconds": 4523.48461523201, "train_loss": 0.584926632642746, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4915226995944977, "train_magma_inten_loss": 0.4253835678100586, "train_frag_loss": 3.3057870864868164, "train_loss": 0.6476715803146362, "val_loss": 0.5952695608139038}} +{"step": 16500, "epoch": 2, "elapsed_seconds": 4547.326567330005, "train_loss": 0.583662400841713, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4844111502170563, "train_magma_inten_loss": 0.4100382328033447, "train_frag_loss": 3.366593837738037, "train_loss": 0.6392886638641357, "val_loss": 0.5952695608139038}} +{"step": 16600, "epoch": 2, "elapsed_seconds": 4571.637598384012, "train_loss": 0.5777074536681175, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43900883197784424, "train_magma_inten_loss": 0.35925474762916565, "train_frag_loss": 2.710111379623413, "train_loss": 0.5519441962242126, "val_loss": 0.5952695608139038}} +{"step": 16700, "epoch": 2, "elapsed_seconds": 4595.5061055960105, "train_loss": 0.5789548674225807, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4144797921180725, "train_magma_inten_loss": 0.3579689860343933, "train_frag_loss": 2.980309009552002, "train_loss": 0.5570949912071228, "val_loss": 0.5952695608139038}} +{"step": 16800, "epoch": 2, "elapsed_seconds": 4619.242691041014, "train_loss": 0.5832087701559067, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4100090265274048, "train_magma_inten_loss": 0.34036871790885925, "train_frag_loss": 2.754763603210449, "train_loss": 0.5315531492233276, "val_loss": 0.5952695608139038}} +{"step": 16900, "epoch": 2, "elapsed_seconds": 4643.436620573004, "train_loss": 0.5915324482321739, "lr": 0.000324, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4811815023422241, "train_magma_inten_loss": 0.3772857189178467, "train_frag_loss": 3.4403605461120605, "train_loss": 0.6229819059371948, "val_loss": 0.5952695608139038}} +{"step": 17000, "epoch": 2, "elapsed_seconds": 4667.739899784006, "train_loss": 0.5748086893558502, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46025338768959045, "train_magma_inten_loss": 0.3547385632991791, "train_frag_loss": 3.002920627593994, "train_loss": 0.5752673745155334, "val_loss": 0.5952695608139038}} +{"step": 17100, "epoch": 2, "elapsed_seconds": 4690.8790772810025, "train_loss": 0.5766446596384048, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.44046029448509216, "train_magma_inten_loss": 0.3554432988166809, "train_frag_loss": 3.1536672115325928, "train_loss": 0.5764794945716858, "val_loss": 0.5952695608139038}} +{"step": 17200, "epoch": 2, "elapsed_seconds": 4715.3324964560015, "train_loss": 0.58038301050663, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4082764983177185, "train_magma_inten_loss": 0.3670802116394043, "train_frag_loss": 3.1580984592437744, "train_loss": 0.5704330205917358, "val_loss": 0.5952695608139038}} +{"step": 17300, "epoch": 2, "elapsed_seconds": 4739.439942383004, "train_loss": 0.591830849647522, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4008195996284485, "train_magma_inten_loss": 0.3516123592853546, "train_frag_loss": 2.9876549243927, "train_loss": 0.5481812357902527, "val_loss": 0.5952695608139038}} +{"step": 17400, "epoch": 2, "elapsed_seconds": 4766.122578362003, "train_loss": 0.5745501011610031, "lr": 0.00029160000000000004, "magma_weight": 0.5904900000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.599360466003418, "train_magma_inten_loss": 0.5038077235221863, "train_frag_loss": 3.641932487487793, "train_loss": 0.7579900026321411, "val_loss": 0.5952695608139038}} +{"step": 17500, "epoch": 2, "elapsed_seconds": 4792.678863053006, "train_loss": 0.5813635101914406, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4638456404209137, "train_magma_inten_loss": 0.4247763752937317, "train_frag_loss": 3.2804675102233887, "train_loss": 0.6174201369285583, "val_loss": 0.5952695608139038}} +{"step": 17600, "epoch": 2, "elapsed_seconds": 4817.897699630004, "train_loss": 0.5613427063822747, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4433729946613312, "train_magma_inten_loss": 0.3739479184150696, "train_frag_loss": 3.357743263244629, "train_loss": 0.5849218964576721, "val_loss": 0.5952695608139038}} +{"step": 17700, "epoch": 2, "elapsed_seconds": 4842.645058815004, "train_loss": 0.5563985219597817, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4020707905292511, "train_magma_inten_loss": 0.3614608645439148, "train_frag_loss": 2.937270164489746, "train_loss": 0.5365875959396362, "val_loss": 0.5952695608139038}} +{"step": 17800, "epoch": 3, "elapsed_seconds": 4949.669997720004, "train_loss": 0.5633919012546539, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3925650715827942, "train_magma_inten_loss": 0.28974032402038574, "train_frag_loss": 2.929507255554199, "train_loss": 0.4936057925224304, "val_loss": 0.5952695608139038}} +{"step": 17900, "epoch": 3, "elapsed_seconds": 4973.166403059004, "train_loss": 0.546410066485405, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5153811573982239, "train_magma_inten_loss": 0.4251328110694885, "train_frag_loss": 2.9895806312561035, "train_loss": 0.6262980699539185, "val_loss": 0.5952695608139038}} +{"step": 18000, "epoch": 3, "elapsed_seconds": 4996.642849163007, "train_loss": 0.5480683061480522, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5054477453231812, "train_magma_inten_loss": 0.455072820186615, "train_frag_loss": 3.411628007888794, "train_loss": 0.6599843502044678, "val_loss": 0.5952695608139038}} +{"step": 18100, "epoch": 3, "elapsed_seconds": 5019.887019080008, "train_loss": 0.5531265988945961, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31649985909461975, "train_magma_inten_loss": 0.2941892147064209, "train_frag_loss": 2.945356607437134, "train_loss": 0.46117138862609863, "val_loss": 0.5952695608139038}} +{"step": 18200, "epoch": 3, "elapsed_seconds": 5044.171856674002, "train_loss": 0.5472635129094123, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3841848075389862, "train_magma_inten_loss": 0.3002606928348541, "train_frag_loss": 2.5656487941741943, "train_loss": 0.4759331941604614, "val_loss": 0.5952695608139038}} +{"step": 18300, "epoch": 3, "elapsed_seconds": 5068.737182790006, "train_loss": 0.5573219901323319, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5164636969566345, "train_magma_inten_loss": 0.4469154179096222, "train_frag_loss": 2.4776697158813477, "train_loss": 0.6111763715744019, "val_loss": 0.5952695608139038}} +{"step": 18400, "epoch": 3, "elapsed_seconds": 5092.4780522390065, "train_loss": 0.5497276183962821, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.25535255670547485, "train_magma_inten_loss": 0.2653501331806183, "train_frag_loss": 2.7647252082824707, "train_loss": 0.4075945019721985, "val_loss": 0.5952695608139038}} +{"step": 18500, "epoch": 3, "elapsed_seconds": 5115.581922573008, "train_loss": 0.5543649786710739, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.37489113211631775, "train_magma_inten_loss": 0.32974961400032043, "train_frag_loss": 3.074512243270874, "train_loss": 0.5142932534217834, "val_loss": 0.5952695608139038}} +{"step": 18600, "epoch": 3, "elapsed_seconds": 5138.8285392270045, "train_loss": 0.5582933983206749, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34805482625961304, "train_magma_inten_loss": 0.3064213693141937, "train_frag_loss": 2.90293288230896, "train_loss": 0.480202853679657, "val_loss": 0.5952695608139038}} +{"step": 18700, "epoch": 3, "elapsed_seconds": 5162.506647365008, "train_loss": 0.5495400685071945, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4617009460926056, "train_magma_inten_loss": 0.42880499362945557, "train_frag_loss": 2.6822009086608887, "train_loss": 0.5867618322372437, "val_loss": 0.5952695608139038}} +{"step": 18800, "epoch": 3, "elapsed_seconds": 5185.165836537009, "train_loss": 0.5503090760111808, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3643353581428528, "train_magma_inten_loss": 0.35611429810523987, "train_frag_loss": 2.8331243991851807, "train_loss": 0.5105301737785339, "val_loss": 0.5952695608139038}} +{"step": 18900, "epoch": 3, "elapsed_seconds": 5207.130895122013, "train_loss": 0.5524270436167718, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5791780948638916, "train_magma_inten_loss": 0.469466894865036, "train_frag_loss": 3.4634153842926025, "train_loss": 0.7049331665039062, "val_loss": 0.5952695608139038}} +{"step": 19000, "epoch": 3, "elapsed_seconds": 5228.521099470003, "train_loss": 0.5615537965297699, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41600501537323, "train_magma_inten_loss": 0.37639784812927246, "train_frag_loss": 3.2348899841308594, "train_loss": 0.5668714046478271, "val_loss": 0.5952695608139038}} +{"step": 19100, "epoch": 3, "elapsed_seconds": 5250.407367691005, "train_loss": 0.5538702070713043, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5016759037971497, "train_magma_inten_loss": 0.40335938334465027, "train_frag_loss": 3.7042479515075684, "train_loss": 0.6462854146957397, "val_loss": 0.5952695608139038}} +{"step": 19200, "epoch": 3, "elapsed_seconds": 5271.5395280240045, "train_loss": 0.5564878499507904, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4129515290260315, "train_magma_inten_loss": 0.33447760343551636, "train_frag_loss": 2.9630377292633057, "train_loss": 0.5287152528762817, "val_loss": 0.5952695608139038}} +{"step": 19300, "epoch": 3, "elapsed_seconds": 5293.168527809001, "train_loss": 0.5421694841980934, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45497775077819824, "train_magma_inten_loss": 0.40018126368522644, "train_frag_loss": 2.907759189605713, "train_loss": 0.5803868770599365, "val_loss": 0.5952695608139038}} +{"step": 19400, "epoch": 3, "elapsed_seconds": 5315.545072152003, "train_loss": 0.5484256383776664, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38212019205093384, "train_magma_inten_loss": 0.3315883278846741, "train_frag_loss": 2.7785212993621826, "train_loss": 0.5029275417327881, "val_loss": 0.5952695608139038}} +{"step": 19500, "epoch": 3, "elapsed_seconds": 5337.109162814013, "train_loss": 0.5491273260116577, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3712180554866791, "train_magma_inten_loss": 0.2931092381477356, "train_frag_loss": 2.748431921005249, "train_loss": 0.4757707417011261, "val_loss": 0.5952695608139038}} +{"step": 19600, "epoch": 3, "elapsed_seconds": 5359.894262433008, "train_loss": 0.5514552301168442, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3728051781654358, "train_magma_inten_loss": 0.32701587677001953, "train_frag_loss": 3.1449530124664307, "train_loss": 0.5156065821647644, "val_loss": 0.5952695608139038}} +{"step": 19700, "epoch": 3, "elapsed_seconds": 5383.091212374013, "train_loss": 0.5462146010994912, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4659057557582855, "train_magma_inten_loss": 0.3736609220504761, "train_frag_loss": 3.4986109733581543, "train_loss": 0.6028136014938354, "val_loss": 0.5952695608139038}} +{"step": 19800, "epoch": 3, "elapsed_seconds": 5406.210181970004, "train_loss": 0.5536201989650726, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39378100633621216, "train_magma_inten_loss": 0.3444766402244568, "train_frag_loss": 2.6825966835021973, "train_loss": 0.5101428031921387, "val_loss": 0.5952695608139038}} +{"step": 19900, "epoch": 3, "elapsed_seconds": 5429.8077640970005, "train_loss": 0.54038837403059, "lr": 0.00029160000000000004, "magma_weight": 0.531441, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3365654945373535, "train_magma_inten_loss": 0.306190550327301, "train_frag_loss": 3.381748914718628, "train_loss": 0.5001429915428162, "val_loss": 0.5952695608139038}} +{"step": 20000, "epoch": 3, "elapsed_seconds": 5454.6822577970015, "train_loss": 0.5497938936948776, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4972878396511078, "train_magma_inten_loss": 0.43333137035369873, "train_frag_loss": 3.0775585174560547, "train_loss": 0.613896369934082, "val_loss": 0.5952695608139038}} +{"step": 20100, "epoch": 3, "elapsed_seconds": 5490.63551444601, "train_loss": 0.5350264167785644, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45407724380493164, "train_magma_inten_loss": 0.4139079451560974, "train_frag_loss": 3.166243076324463, "train_loss": 0.5863048434257507, "val_loss": 0.5829952955245972}} +{"step": 20200, "epoch": 3, "elapsed_seconds": 5514.082140952014, "train_loss": 0.5382986140251159, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5013777613639832, "train_magma_inten_loss": 0.4413284659385681, "train_frag_loss": 3.0524234771728516, "train_loss": 0.6186528205871582, "val_loss": 0.5829952955245972}} +{"step": 20300, "epoch": 3, "elapsed_seconds": 5539.060462996, "train_loss": 0.5352771747112274, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4387708902359009, "train_magma_inten_loss": 0.3688249886035919, "train_frag_loss": 2.8474807739257812, "train_loss": 0.5415101051330566, "val_loss": 0.5829952955245972}} +{"step": 20400, "epoch": 3, "elapsed_seconds": 5565.0237387320085, "train_loss": 0.5338018655776977, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38171106576919556, "train_magma_inten_loss": 0.325630247592926, "train_frag_loss": 2.699441909790039, "train_loss": 0.4840012788772583, "val_loss": 0.5829952955245972}} +{"step": 20500, "epoch": 3, "elapsed_seconds": 5590.874709668002, "train_loss": 0.5418372923135757, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3792690932750702, "train_magma_inten_loss": 0.28992924094200134, "train_frag_loss": 2.6868209838867188, "train_loss": 0.4650479555130005, "val_loss": 0.5829952955245972}} +{"step": 20600, "epoch": 3, "elapsed_seconds": 5615.976529191001, "train_loss": 0.5313064652681351, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4720538854598999, "train_magma_inten_loss": 0.4217342734336853, "train_frag_loss": 3.144399642944336, "train_loss": 0.5983818769454956, "val_loss": 0.5829952955245972}} +{"step": 20700, "epoch": 3, "elapsed_seconds": 5640.58066466001, "train_loss": 0.53906642973423, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4670778214931488, "train_magma_inten_loss": 0.44917094707489014, "train_frag_loss": 2.9783895015716553, "train_loss": 0.6009684801101685, "val_loss": 0.5829952955245972}} +{"step": 20800, "epoch": 3, "elapsed_seconds": 5664.70034465201, "train_loss": 0.5479735487699509, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.47799378633499146, "train_magma_inten_loss": 0.42015156149864197, "train_frag_loss": 3.1479029655456543, "train_loss": 0.6008912920951843, "val_loss": 0.5829952955245972}} +{"step": 20900, "epoch": 3, "elapsed_seconds": 5688.383104264009, "train_loss": 0.5250854235887528, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4803369641304016, "train_magma_inten_loss": 0.40418124198913574, "train_frag_loss": 2.929497718811035, "train_loss": 0.5840288996696472, "val_loss": 0.5829952955245972}} +{"step": 21000, "epoch": 3, "elapsed_seconds": 5711.100409168008, "train_loss": 0.534863460958004, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4621858596801758, "train_magma_inten_loss": 0.38043490052223206, "train_frag_loss": 3.4778647422790527, "train_loss": 0.5894298553466797, "val_loss": 0.5829952955245972}} +{"step": 21100, "epoch": 3, "elapsed_seconds": 5735.159911168012, "train_loss": 0.5358199813961982, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43557336926460266, "train_magma_inten_loss": 0.3786427676677704, "train_frag_loss": 2.814058303833008, "train_loss": 0.5429391860961914, "val_loss": 0.5829952955245972}} +{"step": 21200, "epoch": 3, "elapsed_seconds": 5758.893378344001, "train_loss": 0.5318128091096878, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39572465419769287, "train_magma_inten_loss": 0.30402010679244995, "train_frag_loss": 2.716702461242676, "train_loss": 0.48180168867111206, "val_loss": 0.5829952955245972}} +{"step": 21300, "epoch": 3, "elapsed_seconds": 5782.570727211001, "train_loss": 0.525596738755703, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2990971803665161, "train_magma_inten_loss": 0.23694366216659546, "train_frag_loss": 2.379005193710327, "train_loss": 0.3831564486026764, "val_loss": 0.5829952955245972}} +{"step": 21400, "epoch": 3, "elapsed_seconds": 5807.433705544012, "train_loss": 0.5321675902605056, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.389045774936676, "train_magma_inten_loss": 0.34181272983551025, "train_frag_loss": 3.2847461700439453, "train_loss": 0.5235627889633179, "val_loss": 0.5829952955245972}} +{"step": 21500, "epoch": 3, "elapsed_seconds": 5832.524500152009, "train_loss": 0.5253894492983818, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39939385652542114, "train_magma_inten_loss": 0.327226459980011, "train_frag_loss": 2.8840556144714355, "train_loss": 0.5028198957443237, "val_loss": 0.5829952955245972}} +{"step": 21600, "epoch": 3, "elapsed_seconds": 5857.430399517005, "train_loss": 0.5349864986538887, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4416084587574005, "train_magma_inten_loss": 0.3769310712814331, "train_frag_loss": 3.2860097885131836, "train_loss": 0.5678423047065735, "val_loss": 0.5829952955245972}} +{"step": 21700, "epoch": 3, "elapsed_seconds": 5882.511969528001, "train_loss": 0.5297562235593796, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4836696982383728, "train_magma_inten_loss": 0.41147181391716003, "train_frag_loss": 3.038097381591797, "train_loss": 0.5944489240646362, "val_loss": 0.5829952955245972}} +{"step": 21800, "epoch": 3, "elapsed_seconds": 5905.199622466011, "train_loss": 0.5243812051415443, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2898182272911072, "train_magma_inten_loss": 0.255260169506073, "train_frag_loss": 2.753215789794922, "train_loss": 0.40497466921806335, "val_loss": 0.5829952955245972}} +{"step": 21900, "epoch": 3, "elapsed_seconds": 5926.505220488005, "train_loss": 0.5242372748255729, "lr": 0.00029160000000000004, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3685697019100189, "train_magma_inten_loss": 0.3122211694717407, "train_frag_loss": 2.7960636615753174, "train_loss": 0.4753532409667969, "val_loss": 0.5829952955245972}} +{"step": 22000, "epoch": 3, "elapsed_seconds": 5948.158380977009, "train_loss": 0.5311940371990204, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5017718076705933, "train_magma_inten_loss": 0.43686985969543457, "train_frag_loss": 3.1048903465270996, "train_loss": 0.6192353367805481, "val_loss": 0.5829952955245972}} +{"step": 22100, "epoch": 3, "elapsed_seconds": 5969.6462027840025, "train_loss": 0.5284198129177093, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.427571564912796, "train_magma_inten_loss": 0.3570014238357544, "train_frag_loss": 3.0548698902130127, "train_loss": 0.5399315357208252, "val_loss": 0.5829952955245972}} +{"step": 22200, "epoch": 3, "elapsed_seconds": 5990.573177717, "train_loss": 0.519411847293377, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3954550325870514, "train_magma_inten_loss": 0.3121108412742615, "train_frag_loss": 2.749965190887451, "train_loss": 0.4871217608451843, "val_loss": 0.5829952955245972}} +{"step": 22300, "epoch": 3, "elapsed_seconds": 6011.480147329014, "train_loss": 0.521393566429615, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4176757335662842, "train_magma_inten_loss": 0.361550509929657, "train_frag_loss": 2.8686671257019043, "train_loss": 0.5280386805534363, "val_loss": 0.5829952955245972}} +{"step": 22400, "epoch": 3, "elapsed_seconds": 6032.52299427001, "train_loss": 0.5324063071608544, "lr": 0.00026244, "magma_weight": 0.4782969000000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46832001209259033, "train_magma_inten_loss": 0.39658278226852417, "train_frag_loss": 3.0440988540649414, "train_loss": 0.5796066522598267, "val_loss": 0.5829952955245972}} +{"step": 22500, "epoch": 3, "elapsed_seconds": 6052.92943800801, "train_loss": 0.5177898690104484, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3518070578575134, "train_magma_inten_loss": 0.27138274908065796, "train_frag_loss": 2.6340370178222656, "train_loss": 0.4305737018585205, "val_loss": 0.5829952955245972}} +{"step": 22600, "epoch": 3, "elapsed_seconds": 6073.5733759880095, "train_loss": 0.520568106174469, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43177029490470886, "train_magma_inten_loss": 0.3586731255054474, "train_frag_loss": 3.1002206802368164, "train_loss": 0.5337586998939514, "val_loss": 0.5829952955245972}} +{"step": 22700, "epoch": 3, "elapsed_seconds": 6094.275246608013, "train_loss": 0.518006876707077, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4145379960536957, "train_magma_inten_loss": 0.38910865783691406, "train_frag_loss": 3.2590291500091553, "train_loss": 0.5438820123672485, "val_loss": 0.5829952955245972}} +{"step": 22800, "epoch": 3, "elapsed_seconds": 6114.681754111007, "train_loss": 0.5070218780636787, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4211164116859436, "train_magma_inten_loss": 0.3786015510559082, "train_frag_loss": 2.727572202682495, "train_loss": 0.5202282071113586, "val_loss": 0.5829952955245972}} +{"step": 22900, "epoch": 3, "elapsed_seconds": 6134.6901159710105, "train_loss": 0.5063502743840218, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.44857123494148254, "train_magma_inten_loss": 0.3620150685310364, "train_frag_loss": 2.5268912315368652, "train_loss": 0.5200859904289246, "val_loss": 0.5829952955245972}} +{"step": 23000, "epoch": 3, "elapsed_seconds": 6155.455147629007, "train_loss": 0.5099847596883774, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5241941213607788, "train_magma_inten_loss": 0.45984941720962524, "train_frag_loss": 3.1331584453582764, "train_loss": 0.6313680410385132, "val_loss": 0.5829952955245972}} +{"step": 23100, "epoch": 3, "elapsed_seconds": 6176.5099676220125, "train_loss": 0.5093811789155006, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.39271509647369385, "train_magma_inten_loss": 0.34515219926834106, "train_frag_loss": 3.025731086730957, "train_loss": 0.5024886131286621, "val_loss": 0.5829952955245972}} +{"step": 23200, "epoch": 3, "elapsed_seconds": 6197.025178491007, "train_loss": 0.5117972224950791, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38930147886276245, "train_magma_inten_loss": 0.3222109377384186, "train_frag_loss": 2.827406406402588, "train_loss": 0.4821317791938782, "val_loss": 0.5829952955245972}} +{"step": 23300, "epoch": 3, "elapsed_seconds": 6217.973959496012, "train_loss": 0.5048848143219948, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4160839021205902, "train_magma_inten_loss": 0.41735154390335083, "train_frag_loss": 2.790320634841919, "train_loss": 0.5367437601089478, "val_loss": 0.5829952955245972}} +{"step": 23400, "epoch": 3, "elapsed_seconds": 6238.666440787012, "train_loss": 0.5104065462946892, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4358843266963959, "train_magma_inten_loss": 0.3810236155986786, "train_frag_loss": 2.8147740364074707, "train_loss": 0.5334353446960449, "val_loss": 0.5829952955245972}} +{"step": 23500, "epoch": 3, "elapsed_seconds": 6258.889964174014, "train_loss": 0.5235951206088066, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42505642771720886, "train_magma_inten_loss": 0.3757573366165161, "train_frag_loss": 2.860142707824707, "train_loss": 0.5269545316696167, "val_loss": 0.5829952955245972}} +{"step": 23600, "epoch": 3, "elapsed_seconds": 6278.240687993006, "train_loss": 0.5067495656013489, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4754575192928314, "train_magma_inten_loss": 0.3957310914993286, "train_frag_loss": 3.601229429244995, "train_loss": 0.596159040927887, "val_loss": 0.5829952955245972}} +{"step": 23700, "epoch": 4, "elapsed_seconds": 6371.066719800001, "train_loss": 0.5024984794855117, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5037468671798706, "train_magma_inten_loss": 0.4179709255695343, "train_frag_loss": 3.8011136054992676, "train_loss": 0.6304486393928528, "val_loss": 0.5829952955245972}} +{"step": 23800, "epoch": 4, "elapsed_seconds": 6392.428793778003, "train_loss": 0.5045085734128952, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4410545229911804, "train_magma_inten_loss": 0.4357282221317291, "train_frag_loss": 2.978853225708008, "train_loss": 0.5669915676116943, "val_loss": 0.5829952955245972}} +{"step": 23900, "epoch": 4, "elapsed_seconds": 6414.559993392002, "train_loss": 0.5055653718113899, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4431145191192627, "train_magma_inten_loss": 0.34106534719467163, "train_frag_loss": 3.165163516998291, "train_loss": 0.5354356169700623, "val_loss": 0.5829952955245972}} +{"step": 24000, "epoch": 4, "elapsed_seconds": 6435.560496835009, "train_loss": 0.49406748265028, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3549307584762573, "train_magma_inten_loss": 0.32480376958847046, "train_frag_loss": 2.8524928092956543, "train_loss": 0.46475255489349365, "val_loss": 0.5829952955245972}} +{"step": 24100, "epoch": 4, "elapsed_seconds": 6457.060909970009, "train_loss": 0.5068229013681411, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.29735618829727173, "train_magma_inten_loss": 0.24082931876182556, "train_frag_loss": 2.672032594680786, "train_loss": 0.3880454897880554, "val_loss": 0.5829952955245972}} +{"step": 24200, "epoch": 4, "elapsed_seconds": 6477.882322473, "train_loss": 0.5062485706806182, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3117702603340149, "train_magma_inten_loss": 0.25881779193878174, "train_frag_loss": 2.7186176776885986, "train_loss": 0.40600356459617615, "val_loss": 0.5829952955245972}} +{"step": 24300, "epoch": 4, "elapsed_seconds": 6499.707075040002, "train_loss": 0.5127255719900131, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3106629252433777, "train_magma_inten_loss": 0.27142974734306335, "train_frag_loss": 2.8247451782226562, "train_loss": 0.4153703451156616, "val_loss": 0.5829952955245972}} +{"step": 24400, "epoch": 4, "elapsed_seconds": 6521.668918210009, "train_loss": 0.5130756664276123, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40920278429985046, "train_magma_inten_loss": 0.3366113305091858, "train_frag_loss": 3.271118640899658, "train_loss": 0.5187654495239258, "val_loss": 0.5829952955245972}} +{"step": 24500, "epoch": 4, "elapsed_seconds": 6545.333140506002, "train_loss": 0.5045737606287003, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.46027785539627075, "train_magma_inten_loss": 0.38846373558044434, "train_frag_loss": 3.0945546627044678, "train_loss": 0.5625746846199036, "val_loss": 0.5829952955245972}} +{"step": 24600, "epoch": 4, "elapsed_seconds": 6568.379556140004, "train_loss": 0.5044561514258384, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4446721076965332, "train_magma_inten_loss": 0.36888206005096436, "train_frag_loss": 2.42423677444458, "train_loss": 0.5164024233818054, "val_loss": 0.5829952955245972}} +{"step": 24700, "epoch": 4, "elapsed_seconds": 6592.307970420006, "train_loss": 0.5008773675560951, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.454365611076355, "train_magma_inten_loss": 0.42475491762161255, "train_frag_loss": 3.1335840225219727, "train_loss": 0.5765097141265869, "val_loss": 0.5829952955245972}} +{"step": 24800, "epoch": 4, "elapsed_seconds": 6615.867130791012, "train_loss": 0.5022371870279312, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42606160044670105, "train_magma_inten_loss": 0.3859371542930603, "train_frag_loss": 3.0858211517333984, "train_loss": 0.5416238307952881, "val_loss": 0.5829952955245972}} +{"step": 24900, "epoch": 4, "elapsed_seconds": 6640.794122779, "train_loss": 0.5043444865942002, "lr": 0.00026244, "magma_weight": 0.4304672100000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38963747024536133, "train_magma_inten_loss": 0.3365858197212219, "train_frag_loss": 2.68804931640625, "train_loss": 0.4825121760368347, "val_loss": 0.5829952955245972}} +{"step": 25000, "epoch": 4, "elapsed_seconds": 6665.403467688011, "train_loss": 0.5027768307924271, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41700929403305054, "train_magma_inten_loss": 0.3789510726928711, "train_frag_loss": 3.337981700897217, "train_loss": 0.5315850377082825, "val_loss": 0.5829952955245972}} +{"step": 25100, "epoch": 4, "elapsed_seconds": 6701.954820290004, "train_loss": 0.4996342906355858, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3569234609603882, "train_magma_inten_loss": 0.27976149320602417, "train_frag_loss": 2.797318935394287, "train_loss": 0.4354032278060913, "val_loss": 0.570682168006897}} +{"step": 25200, "epoch": 4, "elapsed_seconds": 6728.362999238001, "train_loss": 0.49265767991542814, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3072839379310608, "train_magma_inten_loss": 0.28422755002975464, "train_frag_loss": 2.9452977180480957, "train_loss": 0.41245827078819275, "val_loss": 0.570682168006897}} +{"step": 25300, "epoch": 4, "elapsed_seconds": 6752.424752301013, "train_loss": 0.48780798524618146, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3126460313796997, "train_magma_inten_loss": 0.30860084295272827, "train_frag_loss": 2.769970655441284, "train_loss": 0.41839319467544556, "val_loss": 0.570682168006897}} +{"step": 25400, "epoch": 4, "elapsed_seconds": 6775.295187129013, "train_loss": 0.5006729212403297, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3231332302093506, "train_magma_inten_loss": 0.27755412459373474, "train_frag_loss": 2.819054126739502, "train_loss": 0.41469091176986694, "val_loss": 0.570682168006897}} +{"step": 25500, "epoch": 4, "elapsed_seconds": 6799.576439147, "train_loss": 0.4904879578948021, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3970073163509369, "train_magma_inten_loss": 0.3464755415916443, "train_frag_loss": 2.475203275680542, "train_loss": 0.473324716091156, "val_loss": 0.570682168006897}} +{"step": 25600, "epoch": 4, "elapsed_seconds": 6824.888466434, "train_loss": 0.49509489834308623, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38400453329086304, "train_magma_inten_loss": 0.3437035083770752, "train_frag_loss": 2.4740960597991943, "train_loss": 0.4642426371574402, "val_loss": 0.570682168006897}} +{"step": 25700, "epoch": 4, "elapsed_seconds": 6849.392181779011, "train_loss": 0.4856211069226265, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3754245638847351, "train_magma_inten_loss": 0.33251094818115234, "train_frag_loss": 2.9438066482543945, "train_loss": 0.4728480577468872, "val_loss": 0.570682168006897}} +{"step": 25800, "epoch": 4, "elapsed_seconds": 6873.59345719601, "train_loss": 0.486709831058979, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45849889516830444, "train_magma_inten_loss": 0.41551926732063293, "train_frag_loss": 2.7636642456054688, "train_loss": 0.5489177107810974, "val_loss": 0.570682168006897}} +{"step": 25900, "epoch": 4, "elapsed_seconds": 6905.5932446610095, "train_loss": 0.4906411308050156, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2642987072467804, "train_magma_inten_loss": 0.2683248817920685, "train_frag_loss": 2.4100780487060547, "train_loss": 0.3592298924922943, "val_loss": 0.570682168006897}} +{"step": 26000, "epoch": 4, "elapsed_seconds": 6928.797644623002, "train_loss": 0.5026348602771759, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4064697027206421, "train_magma_inten_loss": 0.3506064713001251, "train_frag_loss": 2.7588422298431396, "train_loss": 0.4917103350162506, "val_loss": 0.570682168006897}} +{"step": 26100, "epoch": 4, "elapsed_seconds": 6952.824262951006, "train_loss": 0.49388667225837707, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40218764543533325, "train_magma_inten_loss": 0.3640773892402649, "train_frag_loss": 3.1900241374969482, "train_loss": 0.511011004447937, "val_loss": 0.570682168006897}} +{"step": 26200, "epoch": 4, "elapsed_seconds": 6976.671979256003, "train_loss": 0.4865147763490677, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.36157163977622986, "train_magma_inten_loss": 0.3624646067619324, "train_frag_loss": 2.8564300537109375, "train_loss": 0.47258153557777405, "val_loss": 0.570682168006897}} +{"step": 26300, "epoch": 4, "elapsed_seconds": 6999.167875538013, "train_loss": 0.49381547957658767, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.30254384875297546, "train_magma_inten_loss": 0.2535781264305115, "train_frag_loss": 3.215733051300049, "train_loss": 0.4081575870513916, "val_loss": 0.570682168006897}} +{"step": 26400, "epoch": 4, "elapsed_seconds": 7020.669952540004, "train_loss": 0.48897396087646483, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4762706458568573, "train_magma_inten_loss": 0.40301722288131714, "train_frag_loss": 3.1986613273620605, "train_loss": 0.5718134641647339, "val_loss": 0.570682168006897}} +{"step": 26500, "epoch": 4, "elapsed_seconds": 7043.387352450009, "train_loss": 0.48658364444971086, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38141098618507385, "train_magma_inten_loss": 0.3345435559749603, "train_frag_loss": 2.8388309478759766, "train_loss": 0.47323572635650635, "val_loss": 0.570682168006897}} +{"step": 26600, "epoch": 4, "elapsed_seconds": 7065.832438984013, "train_loss": 0.481635017991066, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43839341402053833, "train_magma_inten_loss": 0.388692706823349, "train_frag_loss": 3.266361951828003, "train_loss": 0.5456839203834534, "val_loss": 0.570682168006897}} +{"step": 26700, "epoch": 4, "elapsed_seconds": 7087.04878343, "train_loss": 0.4890833404660225, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3901352286338806, "train_magma_inten_loss": 0.35575801134109497, "train_frag_loss": 2.8159677982330322, "train_loss": 0.48591315746307373, "val_loss": 0.570682168006897}} +{"step": 26800, "epoch": 4, "elapsed_seconds": 7108.489799777002, "train_loss": 0.4827581807971001, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34512320160865784, "train_magma_inten_loss": 0.32121485471725464, "train_frag_loss": 3.0953941345214844, "train_loss": 0.45578253269195557, "val_loss": 0.570682168006897}} +{"step": 26900, "epoch": 4, "elapsed_seconds": 7129.775434096009, "train_loss": 0.4847931778430939, "lr": 0.00026244, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.44515419006347656, "train_magma_inten_loss": 0.3846035599708557, "train_frag_loss": 3.042379856109619, "train_loss": 0.5395636558532715, "val_loss": 0.570682168006897}} +{"step": 27000, "epoch": 4, "elapsed_seconds": 7150.479388852007, "train_loss": 0.4904621878266335, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.42799997329711914, "train_magma_inten_loss": 0.37888768315315247, "train_frag_loss": 3.1560873985290527, "train_loss": 0.5312461853027344, "val_loss": 0.570682168006897}} +{"step": 27100, "epoch": 4, "elapsed_seconds": 7173.794023059003, "train_loss": 0.48453994035720827, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5275269150733948, "train_magma_inten_loss": 0.42835479974746704, "train_frag_loss": 3.1203694343566895, "train_loss": 0.6099951267242432, "val_loss": 0.570682168006897}} +{"step": 27200, "epoch": 4, "elapsed_seconds": 7197.211793161012, "train_loss": 0.48964187145233157, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4129800796508789, "train_magma_inten_loss": 0.36451074481010437, "train_frag_loss": 2.9847965240478516, "train_loss": 0.5098392367362976, "val_loss": 0.570682168006897}} +{"step": 27300, "epoch": 4, "elapsed_seconds": 7219.251373522013, "train_loss": 0.49372239381074906, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.409212589263916, "train_magma_inten_loss": 0.3460431396961212, "train_frag_loss": 3.089661121368408, "train_loss": 0.5044392347335815, "val_loss": 0.570682168006897}} +{"step": 27400, "epoch": 4, "elapsed_seconds": 7242.791693442006, "train_loss": 0.4932749962806702, "lr": 0.00023619600000000004, "magma_weight": 0.3874204890000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4575953483581543, "train_magma_inten_loss": 0.39386284351348877, "train_frag_loss": 2.8994131088256836, "train_loss": 0.5452332496643066, "val_loss": 0.570682168006897}} +{"step": 27500, "epoch": 4, "elapsed_seconds": 7265.936123222011, "train_loss": 0.47998892396688464, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.32163023948669434, "train_magma_inten_loss": 0.2987324297428131, "train_frag_loss": 3.3673899173736572, "train_loss": 0.43105989694595337, "val_loss": 0.570682168006897}} +{"step": 27600, "epoch": 4, "elapsed_seconds": 7289.714175126006, "train_loss": 0.46964187294244764, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45533251762390137, "train_magma_inten_loss": 0.3901991844177246, "train_frag_loss": 2.5815279483795166, "train_loss": 0.5226342678070068, "val_loss": 0.570682168006897}} +{"step": 27700, "epoch": 4, "elapsed_seconds": 7313.464695087008, "train_loss": 0.4826860499382019, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.45807206630706787, "train_magma_inten_loss": 0.4176539480686188, "train_frag_loss": 3.326793909072876, "train_loss": 0.5599772930145264, "val_loss": 0.570682168006897}} +{"step": 27800, "epoch": 4, "elapsed_seconds": 7337.0209832830005, "train_loss": 0.47304805129766464, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3578583300113678, "train_magma_inten_loss": 0.2943945825099945, "train_frag_loss": 2.944387674331665, "train_loss": 0.43839430809020996, "val_loss": 0.570682168006897}} +{"step": 27900, "epoch": 4, "elapsed_seconds": 7360.872638744011, "train_loss": 0.46823367595672605, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4312974214553833, "train_magma_inten_loss": 0.3668608069419861, "train_frag_loss": 3.655240058898926, "train_loss": 0.53628009557724, "val_loss": 0.570682168006897}} +{"step": 28000, "epoch": 4, "elapsed_seconds": 7383.951380308004, "train_loss": 0.46812877506017686, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.2819795608520508, "train_magma_inten_loss": 0.28226161003112793, "train_frag_loss": 2.8899054527282715, "train_loss": 0.38284268975257874, "val_loss": 0.570682168006897}} +{"step": 28100, "epoch": 4, "elapsed_seconds": 7408.187529897012, "train_loss": 0.4772930744290352, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3896667957305908, "train_magma_inten_loss": 0.2864508628845215, "train_frag_loss": 2.828909397125244, "train_loss": 0.4523155689239502, "val_loss": 0.570682168006897}} +{"step": 28200, "epoch": 4, "elapsed_seconds": 7431.875532856007, "train_loss": 0.47335904598236084, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4047251343727112, "train_magma_inten_loss": 0.354458212852478, "train_frag_loss": 3.10670804977417, "train_loss": 0.49552232027053833, "val_loss": 0.570682168006897}} +{"step": 28300, "epoch": 4, "elapsed_seconds": 7456.055814909007, "train_loss": 0.4729775506258011, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.41559547185897827, "train_magma_inten_loss": 0.3551759123802185, "train_frag_loss": 3.2629246711730957, "train_loss": 0.5082995891571045, "val_loss": 0.570682168006897}} +{"step": 28400, "epoch": 4, "elapsed_seconds": 7479.934586394011, "train_loss": 0.48545008212327956, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.38288214802742004, "train_magma_inten_loss": 0.3288381099700928, "train_frag_loss": 3.0327582359313965, "train_loss": 0.4697839021682739, "val_loss": 0.570682168006897}} +{"step": 28500, "epoch": 4, "elapsed_seconds": 7503.657482096009, "train_loss": 0.47587032586336137, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3795454204082489, "train_magma_inten_loss": 0.3159329295158386, "train_frag_loss": 2.890378952026367, "train_loss": 0.4581463932991028, "val_loss": 0.570682168006897}} +{"step": 28600, "epoch": 4, "elapsed_seconds": 7527.783173971009, "train_loss": 0.47524522453546525, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3674951195716858, "train_magma_inten_loss": 0.3129616379737854, "train_frag_loss": 2.1323001384735107, "train_loss": 0.42282918095588684, "val_loss": 0.570682168006897}} +{"step": 28700, "epoch": 4, "elapsed_seconds": 7552.12356329801, "train_loss": 0.4836806383728981, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3799706697463989, "train_magma_inten_loss": 0.3345317840576172, "train_frag_loss": 2.8597371578216553, "train_loss": 0.46383997797966003, "val_loss": 0.570682168006897}} +{"step": 28800, "epoch": 4, "elapsed_seconds": 7573.104773173007, "train_loss": 0.4742775011062622, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.40480369329452515, "train_magma_inten_loss": 0.3319423496723175, "train_frag_loss": 2.998765230178833, "train_loss": 0.4839589595794678, "val_loss": 0.570682168006897}} +{"step": 28900, "epoch": 4, "elapsed_seconds": 7594.873770503007, "train_loss": 0.47368269026279447, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.5039132833480835, "train_magma_inten_loss": 0.4596644341945648, "train_frag_loss": 3.1594674587249756, "train_loss": 0.5986484885215759, "val_loss": 0.570682168006897}} +{"step": 29000, "epoch": 4, "elapsed_seconds": 7616.380925956008, "train_loss": 0.4753099688887596, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.32629406452178955, "train_magma_inten_loss": 0.2723841667175293, "train_frag_loss": 2.8014469146728516, "train_loss": 0.4051772654056549, "val_loss": 0.570682168006897}} +{"step": 29100, "epoch": 4, "elapsed_seconds": 7637.273971980001, "train_loss": 0.46891053169965746, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.43772977590560913, "train_magma_inten_loss": 0.35512590408325195, "train_frag_loss": 2.920015811920166, "train_loss": 0.5107421875, "val_loss": 0.570682168006897}} +{"step": 29200, "epoch": 4, "elapsed_seconds": 7658.711067718003, "train_loss": 0.4746877619624138, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4529046416282654, "train_magma_inten_loss": 0.36138176918029785, "train_frag_loss": 3.090183973312378, "train_loss": 0.528740644454956, "val_loss": 0.570682168006897}} +{"step": 29300, "epoch": 4, "elapsed_seconds": 7680.265332310009, "train_loss": 0.4744506493210793, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3943590521812439, "train_magma_inten_loss": 0.3509126603603363, "train_frag_loss": 2.7545888423919678, "train_loss": 0.4752567708492279, "val_loss": 0.570682168006897}} +{"step": 29400, "epoch": 4, "elapsed_seconds": 7701.358267054005, "train_loss": 0.47058797419071197, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3233529329299927, "train_magma_inten_loss": 0.2779809534549713, "train_frag_loss": 2.7349977493286133, "train_loss": 0.4028961658477783, "val_loss": 0.570682168006897}} +{"step": 29500, "epoch": 4, "elapsed_seconds": 7724.232663209012, "train_loss": 0.47761728495359423, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3810325860977173, "train_magma_inten_loss": 0.35806164145469666, "train_frag_loss": 3.100149154663086, "train_loss": 0.4811186194419861, "val_loss": 0.570682168006897}} +{"step": 29600, "epoch": 5, "elapsed_seconds": 7828.777753289003, "train_loss": 0.4764391604065895, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.31424424052238464, "train_magma_inten_loss": 0.26938870549201965, "train_frag_loss": 2.523566961288452, "train_loss": 0.3865954279899597, "val_loss": 0.570682168006897}} +{"step": 29700, "epoch": 5, "elapsed_seconds": 7852.671985985013, "train_loss": 0.463359988629818, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.37151333689689636, "train_magma_inten_loss": 0.3468295931816101, "train_frag_loss": 2.9122731685638428, "train_loss": 0.46445131301879883, "val_loss": 0.570682168006897}} +{"step": 29800, "epoch": 5, "elapsed_seconds": 7874.758620593013, "train_loss": 0.4760179165005684, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.4078291654586792, "train_magma_inten_loss": 0.33717697858810425, "train_frag_loss": 2.9619922637939453, "train_loss": 0.48647254705429077, "val_loss": 0.570682168006897}} +{"step": 29900, "epoch": 5, "elapsed_seconds": 7897.990277299003, "train_loss": 0.4703507649898529, "lr": 0.00023619600000000004, "magma_weight": 0.3486784401000001, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.3933590054512024, "train_magma_inten_loss": 0.34966975450515747, "train_frag_loss": 2.953606605529785, "train_loss": 0.4811113774776459, "val_loss": 0.570682168006897}} +{"step": 30000, "epoch": 5, "elapsed_seconds": 7921.792526577003, "train_loss": 0.4678606262803078, "lr": 0.00023619600000000004, "magma_weight": 0.31381059609000006, "skipped": 0, "metrics": {"train_end_to_end_inten_loss": 0.34423691034317017, "train_magma_inten_loss": 0.2852066457271576, "train_frag_loss": 2.941709041595459, "train_loss": 0.41802653670310974, "val_loss": 0.570682168006897}} diff --git a/shared/package-files/b1/b1474f57957340d74d1573e55a9e62249e94b3e36912f92a91880ba87f428d12/replay-published-erha2fhz-val-tiny.log b/shared/package-files/b1/b1474f57957340d74d1573e55a9e62249e94b3e36912f92a91880ba87f428d12/replay-published-erha2fhz-val-tiny.log new file mode 100644 index 0000000000000000000000000000000000000000..ae2b326804bf1eacdd6437466016c119751b01b1 --- /dev/null +++ b/shared/package-files/b1/b1474f57957340d74d1573e55a9e62249e94b3e36912f92a91880ba87f428d12/replay-published-erha2fhz-val-tiny.log @@ -0,0 +1,15 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 5, "inverse_members": 5, "library": true, "ion": true, "workers": 14} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.6378152790130116} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 1.6615192830213346} +{"event": "candidate_store", "pools": 40, "pairs": 9390, "merged_spectra": 164, "seconds": 1.2703059240011498} +{"event": "intact_ion", "scored": 180, "seconds": 0.006665373977739364} +{"event": "library", "scored": 180, "search_seconds": 0.9920521610183641, "seconds": 1.4459370159893297} +{"event": "inverse_annotated", "pools": 40, "pairs": 9390, "formulae": 1921, "unsupported_candidates": 75, "seconds": 7.209298200905323e-05} +{"event": "inverse", "scored": 180, "seconds": 2.133724479994271} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 62.464628332993016} +{"event": "consensus", "scored": 168, "pools": 40, "answers": 400, "search_seconds": 0.02297639800235629, "seconds": 0.05499835801310837} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 0.32241854997118935, "total_seconds": 82.92230463703163} +{"event": "measured", "exit_code": 0, "wall_seconds": 84.7, "user_seconds": 189.5, "system_seconds": 10.6, "max_rss_gib": 2.75} +{"event": "replay_checked", "exit_code": 0, "package_files": 2403, "package_unchanged": true, "processes_left": 0, "rankings": 180} diff --git a/shared/package-files/b1/b15b98c753f238e3bebe19a66f8d644104a363613b6af7aec901cb556b7147a7/config.json b/shared/package-files/b1/b15b98c753f238e3bebe19a66f8d644104a363613b6af7aec901cb556b7147a7/config.json new file mode 100644 index 0000000000000000000000000000000000000000..177300f46f898f8f94736ab900ca1bf02f33cfc8 --- /dev/null +++ b/shared/package-files/b1/b15b98c753f238e3bebe19a66f8d644104a363613b6af7aec901cb556b7147a7/config.json @@ -0,0 +1,36 @@ +{ + "hidden_size": 256, + "graphormer_layers": 5, + "graphormer_dropout": 0.1, + "frag_decoder_layers": 4, + "frag_encoder_layers": 0, + "frag_dropout": 0.1, + "inten_decoder_layers": 4, + "inten_encoder_layers": 3, + "inten_dropout": 0.1, + "max_breakpoints": 200, + "max_broken_bonds": 6, + "multi_hop_max_dist": 10, + "num_edge_dis": 10, + "pe_embed_k": 14, + "embed_elem_group": true, + "embed_adduct": true, + "embed_collision": true, + "embed_instrument": true, + "encode_forms": true, + "num_bins": 150000, + "enable_aux_loss": true, + "enable_decoder_norm": false, + "sk_tau": 0.05, + "linsat_tau": 15, + "inten_weight": 1, + "frag_weight": 0.1, + "warmup": 2000, + "magma_warmup_steps": 2500, + "magma_decay_rate": 0.9, + "magma_decay_steps": 2500, + "inten_loss_fn": "cosine", + "lr": 0.0004, + "lr_decay_rate": 0.9, + "weight_decay": 0 +} diff --git a/shared/package-files/b4/b426a0e518ea1a746f73e8d7914ec4bda6d34e319e790dada8fabe49523c7819/replay-5Ms-I9b+I13-L-ion-val-sub.log b/shared/package-files/b4/b426a0e518ea1a746f73e8d7914ec4bda6d34e319e790dada8fabe49523c7819/replay-5Ms-I9b+I13-L-ion-val-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..63c104c1b310d7ccb0b593fd5373502cb2d792b1 --- /dev/null +++ b/shared/package-files/b4/b426a0e518ea1a746f73e8d7914ec4bda6d34e319e790dada8fabe49523c7819/replay-5Ms-I9b+I13-L-ion-val-sub.log @@ -0,0 +1,18 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 5, "inverse_members": 2, "library": true, "ion": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 5.040317206992768} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 5.345603014982771} +{"event": "candidate_store", "pools": 413, "pairs": 119929, "seconds": 7.678908639994916} +{"event": "intact_ion", "scored": 2147, "seconds": 0.06151179102016613} +{"event": "library", "scored": 2147, "search_seconds": 8.911694273992907, "seconds": 9.74443668301683} +{"event": "inverse_annotated", "pools": 413, "pairs": 119929, "formulae": 19543, "unsupported_candidates": 938, "seconds": 0.0001263220328837633} +{"event": "inverse", "scored": 2147, "seconds": 2.870418901962694} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 96.1540410949965, "per_second": 665.5986505733073} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 201.94408264697995, "per_second": 633.8388246995968} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 316.8574137020041, "per_second": 605.9507895263288} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 453.50831017200835, "per_second": 564.4880022218409} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 599.498002874956} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 2.522444866015576, "total_seconds": 639.6689939589705} +{"event": "measured", "exit_code": 0, "wall_seconds": 641.6, "user_seconds": 1603.1, "system_seconds": 36.9, "max_rss_gib": 3.4} +{"event": "replay_checked", "exit_code": 0, "package_files": 276, "package_unchanged": true, "processes_left": 0, "rankings": 2147} diff --git a/shared/package-files/b4/b44ffc83aa3103c9352dc3e6c3ef647d40d14a2d37d2400f0e040f48ff8ff3cb/domain_strata.py b/shared/package-files/b4/b44ffc83aa3103c9352dc3e6c3ef647d40d14a2d37d2400f0e040f48ff8ff3cb/domain_strata.py new file mode 100644 index 0000000000000000000000000000000000000000..d0971cc3f5cf04926e3522b487c2225c5af6a4a0 --- /dev/null +++ b/shared/package-files/b4/b44ffc83aa3103c9352dc3e6c3ef647d40d14a2d37d2400f0e040f48ff8ff3cb/domain_strata.py @@ -0,0 +1,33 @@ +import json, sys, pickle +import numpy as np +sys.path.insert(0, '/workspace/research/allcond/analysis') +import fused_eval as fe +lab = fe.Fuser() +inv = lab.inverse(fe.RELEASED.split(',')) +ref = lab.ranks(inv) +ev = lab.ev +q = lab.queries +fwd = ev.ranks(lab.forward, 1.0); invr = ev.ranks(inv, 1.0) +inst = np.array([x.get('instrument_type') or 'None' for x in q]) +add = np.array([x['adduct'] for x in q]) +ce = np.array([x.get('collision_energy') is not None for x in q]) +cev = np.array([float(x['collision_energy']) if x.get('collision_energy') is not None else np.nan for x in q]) +mz = np.array([float(x['precursor_mz']) for x in q]) +npk = np.array([len(x['mzs']) if isinstance(x.get('mzs'), list) else len(str(x['mzs']).split(',')) for x in q]) +pool = np.array([x['candidate_pool_id'] for x in q]) +size = np.array([len(ev.by_pool[p]) for p in pool]) +def show(name, s): + if s.sum() == 0: return + first = np.array([ev.by_pool[p][0] for p in set(pool[s])]) + print(f'{name:38s} n {int(s.sum()):5d} pools {len(first):4d} | fused {np.mean(ref[0][s]==0):.3f} (macro {np.mean(ref[0][first]==0):.3f}) top5 {np.mean(ref[0][s]<5):.3f} | forward pool {np.mean(fwd[s]==0):.3f} inverse pool {np.mean(invr[s]==0):.3f} | fused per spectrum {np.mean(ref[1][s]==0):.3f}') +for name_i in ('Orbitrap', 'QTOF'): + base = (inst == name_i) & (add == '[M+H]+') & ce + show(name_i + ' domain', base) + for lo, hi in ((0, 300), (300, 400), (400, 500), (500, 700), (700, 1001)): + show(f' mz [{lo},{hi})', base & (mz >= lo) & (mz < hi)) + for lo, hi in ((0, 15), (15, 25), (25, 35), (35, 50), (50, 200)): + show(f' CE [{lo},{hi})', base & (cev >= lo) & (cev < hi)) + for lo, hi in ((0, 5), (5, 10), (10, 20), (20, 50), (50, 10000)): + show(f' peaks [{lo},{hi})', base & (npk >= lo) & (npk < hi)) + for lo, hi in ((1, 2), (2, 4), (4, 8), (8, 16), (16, 1000)): + show(f' pool size [{lo},{hi})', base & (size >= lo) & (size < hi)) diff --git a/shared/package-files/b4/b46b473cfb2d3178b4c001a08d6c8770fdafd5d9fd38eb384538a3685df68a75/eval-score-I8.log b/shared/package-files/b4/b46b473cfb2d3178b4c001a08d6c8770fdafd5d9fd38eb384538a3685df68a75/eval-score-I8.log new file mode 100644 index 0000000000000000000000000000000000000000..5789aaee647d72a0aa3cd7f08a45b89fcaa65cf8 --- /dev/null +++ b/shared/package-files/b4/b46b473cfb2d3178b4c001a08d6c8770fdafd5d9fd38eb384538a3685df68a75/eval-score-I8.log @@ -0,0 +1,41 @@ +19429 queries, 1 members, 101.3 s +cos pool rule all=0.5511 dom=0.7846 non=0.3167 h5=0.6794 macro=0.6488 +cen pool rule all=0.5292 dom=0.7556 non=0.3018 h5=0.6621 macro=0.6193 +cos_pm pool rule all=0.5511 dom=0.7846 non=0.3167 h5=0.6794 macro=0.6488 +dot pool rule all=0.5405 dom=0.7502 non=0.3300 h5=0.6871 macro=0.6406 +geo pool rule all=0.5251 dom=0.7551 non=0.2942 h5=0.6582 macro=0.6338 +idf05 pool rule all=0.5599 dom=0.7881 non=0.3308 h5=0.6904 macro=0.6503 +idf1 pool rule all=0.5704 dom=0.7922 non=0.3477 h5=0.6977 macro=0.6545 +lin pool rule all=0.4904 dom=0.7089 non=0.2711 h5=0.6181 macro=0.5883 +log01 pool rule all=0.5532 dom=0.7815 non=0.3241 h5=0.6953 macro=0.6539 +log05 pool rule all=0.5637 dom=0.7943 non=0.3322 h5=0.6996 macro=0.6651 +log20 pool rule all=0.5654 dom=0.8005 non=0.3293 h5=0.6877 macro=0.6618 +nll02 pool rule all=0.3948 dom=0.6404 non=0.1482 h5=0.5384 macro=0.4956 +nll10 pool rule all=0.3526 dom=0.5718 non=0.1325 h5=0.4887 macro=0.4312 +poolcen pool rule all=0.5322 dom=0.7448 non=0.3188 h5=0.6740 macro=0.6172 +pow020 pool rule all=0.5104 dom=0.7254 non=0.2945 h5=0.6823 macro=0.6051 +pow030 pool rule all=0.5280 dom=0.7484 non=0.3067 h5=0.6869 macro=0.6181 +pow040 pool rule all=0.5443 dom=0.7662 non=0.3216 h5=0.6941 macro=0.6412 +pow05 pool rule all=0.5553 dom=0.7883 non=0.3214 h5=0.7024 macro=0.6571 +pow05idf025 pool rule all=0.5573 dom=0.7858 non=0.3278 h5=0.7032 macro=0.6598 +pow05idf05 pool rule all=0.5570 dom=0.7843 non=0.3288 h5=0.7080 macro=0.6586 +pow05m pool rule all=0.5553 dom=0.7883 non=0.3214 h5=0.7024 macro=0.6571 +pow05s pool rule all=0.5484 dom=0.7856 non=0.3103 h5=0.6903 macro=0.6556 +pow060 pool rule all=0.5604 dom=0.7932 non=0.3267 h5=0.6922 macro=0.6598 +pow060idf025 pool rule all=0.5672 dom=0.7915 non=0.3420 h5=0.7014 macro=0.6627 +pow060idf050 pool rule all=0.5643 dom=0.7905 non=0.3372 h5=0.7038 macro=0.6636 +pow060m pool rule all=0.5604 dom=0.7932 non=0.3267 h5=0.6922 macro=0.6598 +pow065 pool rule all=0.5575 dom=0.7932 non=0.3208 h5=0.6925 macro=0.6589 +pow070 pool rule all=0.5575 dom=0.7955 non=0.3186 h5=0.6921 macro=0.6586 +pow070idf025 pool rule all=0.5646 dom=0.7952 non=0.3331 h5=0.7024 macro=0.6601 +pow070idf050 pool rule all=0.5688 dom=0.7937 non=0.3430 h5=0.7068 macro=0.6613 +pow070m pool rule all=0.5575 dom=0.7955 non=0.3186 h5=0.6921 macro=0.6586 +pow075 pool rule all=0.5570 dom=0.7963 non=0.3167 h5=0.6864 macro=0.6577 +pow080 pool rule all=0.5571 dom=0.7934 non=0.3198 h5=0.6829 macro=0.6556 +pow080m pool rule all=0.5571 dom=0.7934 non=0.3198 h5=0.6829 macro=0.6556 +pow085 pool rule all=0.5548 dom=0.7912 non=0.3175 h5=0.6821 macro=0.6533 +pow085idf025 pool rule all=0.5642 dom=0.7942 non=0.3332 h5=0.6894 macro=0.6583 +pow085idf050 pool rule all=0.5671 dom=0.7952 non=0.3382 h5=0.6977 macro=0.6595 +pow090 pool rule all=0.5526 dom=0.7879 non=0.3165 h5=0.6777 macro=0.6509 +pow2 pool rule all=0.5100 dom=0.7287 non=0.2905 h5=0.6362 macro=0.6093 +tani pool rule all=0.5208 dom=0.7469 non=0.2939 h5=0.6676 macro=0.6264 diff --git a/shared/package-files/b4/b46f2f8a26cb41a83b644fcd7aa20714ee19e4e2c52bfc5589d544c5294d230f/gap-B30k.log b/shared/package-files/b4/b46f2f8a26cb41a83b644fcd7aa20714ee19e4e2c52bfc5589d544c5294d230f/gap-B30k.log new file mode 100644 index 0000000000000000000000000000000000000000..b194b988763cb3ae73ea1d56b2ca39d478699fd4 --- /dev/null +++ b/shared/package-files/b4/b46f2f8a26cb41a83b644fcd7aa20714ee19e4e2c52bfc5589d544c5294d230f/gap-B30k.log @@ -0,0 +1,8 @@ +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"split": "train", "stratum": "all", "rows": 2048, "e2e": 0.3107, "magma": 0.2632, "e2e_median": 0.2058, "magma_median": 0.1665} +{"split": "train", "stratum": "domain", "rows": 1112, "e2e": 0.2322, "magma": 0.195, "e2e_median": 0.1659, "magma_median": 0.1394} +{"split": "train", "stratum": "other", "rows": 936, "e2e": 0.404, "magma": 0.3441, "e2e_median": 0.2901, "magma_median": 0.2329} +{"split": "validation", "stratum": "all", "rows": 2048, "e2e": 0.5669, "magma": 0.4994, "e2e_median": 0.5505, "magma_median": 0.4472} +{"split": "validation", "stratum": "domain", "rows": 1105, "e2e": 0.4272, "magma": 0.3625, "e2e_median": 0.3956, "magma_median": 0.3304} +{"split": "validation", "stratum": "other", "rows": 943, "e2e": 0.7306, "magma": 0.6597, "e2e_median": 0.9185, "magma_median": 0.7532} diff --git a/shared/package-files/b4/b47c5e8a80e20f22782e35d712cd28d7907195e5587913023985daf0058af16e/train.py b/shared/package-files/b4/b47c5e8a80e20f22782e35d712cd28d7907195e5587913023985daf0058af16e/train.py new file mode 100644 index 0000000000000000000000000000000000000000..5070bc36dfdf77da1109a2957f1284165aa1ab2b --- /dev/null +++ b/shared/package-files/b4/b47c5e8a80e20f22782e35d712cd28d7907195e5587913023985daf0058af16e/train.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python3 +"""Train native GLACIER from random initialization on all acquisition conditions. + +Plain PyTorch loop around the pinned ``JointModel`` (same losses, optimizer, +LR and MAGMa schedules as the native recipe). Differences from the starter +wrapper: native batch size 32 without gradient accumulation, several loader +workers, every adduct/instrument/collision-energy condition, optional EMA +weights and optional warm start from one of OUR OWN train-fold checkpoints. +No test input is read. Validation rows are used for a monitoring loss only. +""" + +import argparse +import functools +import hashlib +import json +import math +import os +from pathlib import Path +import random +import shutil +import sys +import time + + +def sha256(path): + h = hashlib.sha256() + with Path(path).open('rb') as f: + for block in iter(lambda: f.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + + +def seed_worker(base, worker): + import numpy as np + random.seed(base + worker) + np.random.seed((base + worker) % 2**32) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--data-root', type=Path, required=True) + p.add_argument('--source-root', type=Path, default=Path('/workspace/research/ms-pred')) + p.add_argument('--config', type=Path, default=Path(__file__).with_name('config.json')) + p.add_argument('--work-dir', type=Path, required=True) + p.add_argument('--subset', choices=['all', 'released', 'other'], default='all') + p.add_argument('--batch-size', type=int, default=32) + p.add_argument('--workers', type=int, default=5) + p.add_argument('--max-steps', type=int, required=True) + p.add_argument('--max-seconds', type=float, default=1e9) + p.add_argument('--checkpoint-every', type=int, default=5000) + p.add_argument('--resume-every', type=int, default=1000) + p.add_argument('--validate-every', type=int, default=5000) + p.add_argument('--validation-rows', type=int, default=2048) + p.add_argument('--ema-decay', type=float, default=0.999) + p.add_argument('--seed', type=int, default=1) + p.add_argument('--init', type=Path, help='warm start from our own exported train-fold checkpoint') + p.add_argument('--override', action='append', default=[], help='config override key=value (JSON value)') + p.add_argument('--limit-train', type=int) + args = p.parse_args() + args.work_dir = args.work_dir.resolve() + args.work_dir.mkdir(parents=True, exist_ok=True) + source = args.source_root.resolve() / 'src' + sys.path.insert(0, str(source)) + sys.path.insert(0, str(Path(__file__).resolve().parent)) + import numpy as np + import torch + from torch.utils.data import DataLoader, Sampler + from ms_pred.glacier.joint_model import JointModel + from dataset_all import AllConditionDataset + + config = json.loads(args.config.read_text()) + for item in args.override: + key, value = item.split('=', 1) + config[key] = json.loads(value) + manifest_path = args.data_root / 'manifest.json' + source_digest = hashlib.sha256() + for path in sorted((source / 'ms_pred').rglob('*.py')): + source_digest.update(str(path.relative_to(source)).encode()) + source_digest.update(path.read_bytes()) + identity = { + 'initialization': 'random' if not args.init else f'own-checkpoint:{sha256(args.init)}', + 'data_manifest_sha256': sha256(manifest_path), 'subset': args.subset, + 'config': config, 'source_sha256': source_digest.hexdigest(), 'seed': args.seed, + 'batch_size': args.batch_size, 'ema_decay': args.ema_decay, 'limit_train': args.limit_train, + 'trainer': 'allcond-plain-loop-v1', + } + recipe = args.work_dir / 'recipe.json' + last_path = args.work_dir / 'last.ckpt' + if recipe.exists() and json.loads(recipe.read_text()) != identity: + raise ValueError('recipe changed; use a new work directory') + recipe.write_text(json.dumps(identity, indent=2) + '\n') + if not (args.work_dir / 'training-source').exists(): + shutil.copytree(Path(__file__).parent, args.work_dir / 'training-source', + ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + + random.seed(args.seed) + np.random.seed(args.seed) + torch.manual_seed(args.seed) + torch.cuda.manual_seed_all(args.seed) + + train = AllConditionDataset(args.data_root, 'train', config, subset=args.subset, limit=args.limit_train) + validation = AllConditionDataset(args.data_root, 'validation', config, subset=args.subset, + limit=args.validation_rows) + model = JointModel(**dict(config, node_feats=train.processor.get_node_feats(), + edge_feats=train.processor.get_edge_feats())) + logged = {} + model.log = lambda name, value, **kwargs: logged.__setitem__(name, float(value)) + if args.init: + saved = torch.load(args.init, map_location='cpu', weights_only=False) + if saved.get('task_training', {}).get('pretrained_assets', []) != []: + raise ValueError('warm start must come from our own random-initialized train-fold run') + model.load_state_dict(saved['state_dict']) + device = torch.device('cuda') + model.to(device) + optim_config = model.configure_optimizers() + optimizer = optim_config['optimizer'] + scheduler = optim_config['lr_scheduler']['scheduler'] + ema = {k: v.detach().clone() for k, v in model.state_dict().items() if v.dtype.is_floating_point} + + state = {'step': 0, 'epoch': 0, 'batch_in_epoch': 0, 'elapsed': 0.0, 'skipped': 0} + if last_path.exists(): + saved = torch.load(last_path, map_location='cpu', weights_only=False) + model.load_state_dict(saved['state_dict']) + optimizer.load_state_dict(saved['optimizer']) + scheduler.load_state_dict(saved['scheduler']) + ema = {k: v.to(device) for k, v in saved['ema_state_dict'].items()} + state = saved['loop_state'] + model.step = saved['magma_step'] + print(json.dumps({'event': 'resumed', **state}), flush=True) + + class EpochSampler(Sampler): + """Deterministic per-epoch permutation that can restart mid-epoch.""" + + def __init__(self, size, epoch, start): + self.size, self.epoch, self.start = size, epoch, start + + def __iter__(self): + generator = torch.Generator().manual_seed(args.seed * 1000003 + self.epoch) + order = torch.randperm(self.size, generator=generator).tolist() + usable = (self.size // args.batch_size) * args.batch_size + return iter(order[self.start * args.batch_size:usable]) + + def __len__(self): + return (self.size // args.batch_size) * args.batch_size - self.start * args.batch_size + + def loader_for(epoch, start): + return DataLoader(train, batch_size=args.batch_size, sampler=EpochSampler(len(train), epoch, start), + num_workers=args.workers, collate_fn=train.collate_fn, drop_last=True, + multiprocessing_context='spawn' if args.workers else None, + prefetch_factor=4 if args.workers else None, + worker_init_fn=functools.partial(seed_worker, args.seed * 7919 + epoch * 131)) + + def to_device(batch): + out = {} + for key, value in batch.items(): + if torch.is_tensor(value): + out[key] = value.to(device, non_blocking=True) + elif isinstance(value, dict): + out[key] = to_device(value) + else: + out[key] = value + return out + + validation_batches = None + + def validate(weights=None): + nonlocal validation_batches + if validation_batches is None: + validation_batches = [validation.collate_fn([validation[i] for i in range(s, min(s + 64, len(validation)))]) + for s in range(0, len(validation), 64)] + backup = None + if weights is not None: + backup = {k: v.detach().clone() for k, v in model.state_dict().items() if k in weights} + model.load_state_dict(weights, strict=False) + model.eval() + total, count = 0.0, 0 + with torch.no_grad(): + for batch in validation_batches: + size = len(batch['names']) + loss = model.validation_step(to_device(batch), 0)['loss'] + total += float(loss) * size + count += size + model.train() + if backup is not None: + model.load_state_dict(backup, strict=False) + return total / max(count, 1) + + def export(path, weights, kind): + state_dict = dict(model.state_dict()) + state_dict.update(weights) + payload = { + 'state_dict': {k: v.detach().cpu() for k, v in state_dict.items()}, + 'hyper_parameters': dict(model.hparams), 'global_step': state['step'], 'weights': kind, + 'task_training': dict(identity, elapsed_seconds=state['elapsed'], pretrained_assets=[], + data='MassSpecGym v1.5 train fold'), + } + temporary = Path(str(path) + '.tmp') + torch.save(payload, temporary) + os.replace(temporary, path) + + def save_resume(): + payload = { + 'state_dict': model.state_dict(), 'optimizer': optimizer.state_dict(), + 'scheduler': scheduler.state_dict(), 'ema_state_dict': ema, 'loop_state': state, + 'magma_step': model.step, 'identity': identity, + } + temporary = Path(str(last_path) + '.tmp') + torch.save(payload, temporary) + os.replace(temporary, last_path) + + checkpoints = args.work_dir / 'checkpoints' + checkpoints.mkdir(exist_ok=True) + print(json.dumps({'parameters': sum(p.numel() for p in model.parameters()), 'train_rows': len(train), + 'validation_rows': len(validation), 'steps_per_epoch': len(train) // args.batch_size, + 'identity': identity['initialization'], 'gpu': torch.cuda.get_device_name()}), flush=True) + model.train() + started = time.monotonic() + base_elapsed = state['elapsed'] + window = [] + done = state['step'] >= args.max_steps + while not done: + loader = loader_for(state['epoch'], state['batch_in_epoch']) + for batch in loader: + batch = to_device(batch) + loss = model.training_step(batch, state['step'])['loss'] + if not torch.isfinite(loss): + state['skipped'] += 1 + optimizer.zero_grad(set_to_none=True) + else: + optimizer.zero_grad(set_to_none=True) + loss.backward() + torch.nn.utils.clip_grad_value_(model.parameters(), 5) + optimizer.step() + window.append(float(loss)) + scheduler.step() + state['step'] += 1 + state['batch_in_epoch'] += 1 + with torch.no_grad(): + decay = min(args.ema_decay, (1 + state['step']) / (10 + state['step'])) + for key, value in model.state_dict().items(): + if key in ema: + ema[key].mul_(decay).add_(value.detach(), alpha=1 - decay) + state['elapsed'] = base_elapsed + time.monotonic() - started + step = state['step'] + if step % 100 == 0: + record = {'step': step, 'epoch': state['epoch'], 'elapsed_seconds': state['elapsed'], + 'train_loss': float(np.mean(window)) if window else None, + 'lr': scheduler.get_last_lr()[0], 'magma_weight': model.magma_weight_scheduler(), + 'skipped': state['skipped'], 'metrics': dict(logged)} + window = [] + with (args.work_dir / 'metrics.jsonl').open('a') as f: + f.write(json.dumps(record) + '\n') + if step % args.validate_every == 0 or step == args.max_steps: + record = {'step': step, 'elapsed_seconds': state['elapsed'], 'validation_loss': validate(), + 'validation_loss_ema': validate(ema)} + print(json.dumps(record), flush=True) + with (args.work_dir / 'validation.jsonl').open('a') as f: + f.write(json.dumps(record) + '\n') + if step % args.checkpoint_every == 0 or step == args.max_steps: + export(checkpoints / f'step-{step:07d}.ckpt', {}, 'raw') + export(checkpoints / f'step-{step:07d}-ema.ckpt', ema, 'ema') + if step % args.resume_every == 0 or step == args.max_steps: + save_resume() + if step >= args.max_steps or state['elapsed'] >= args.max_seconds: + done = True + break + else: + state['epoch'] += 1 + state['batch_in_epoch'] = 0 + del loader + save_resume() + (args.work_dir / 'result.json').write_text(json.dumps({ + 'global_step': state['step'], 'elapsed_seconds': state['elapsed'], 'skipped_batches': state['skipped'], + 'hardware': torch.cuda.get_device_name(), + 'peak_cuda_allocated_bytes': torch.cuda.max_memory_allocated(), + }, indent=2) + '\n') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/b4/b4889f6464af966c659695e24042db2468c9e4829a7f3695f0df5f22a072cb75/metrics.jsonl b/shared/package-files/b4/b4889f6464af966c659695e24042db2468c9e4829a7f3695f0df5f22a072cb75/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..aeee4adac0f6aac93ea49a02641c793b4811f823 --- /dev/null +++ b/shared/package-files/b4/b4889f6464af966c659695e24042db2468c9e4829a7f3695f0df5f22a072cb75/metrics.jsonl @@ -0,0 +1,250 @@ +{"step": 200, "loss": 0.3297590694576502, "loss_real": 0.3284384514018893, "loss_synth": 0.3297311312519014, "lr": 5.999770185426209e-05, "elapsed": 18.20477121300064, "steps_per_second": 44.5310669388914, "loss_extra": 0.33001631250604985} +{"step": 400, "loss": 0.0484263750910759, "loss_real": 0.04431880589574575, "loss_synth": 0.04890069572255015, "lr": 0.0001199815230572914, "elapsed": 22.26886623702012, "steps_per_second": 46.754422142271736, "loss_extra": 0.048667665366083385} +{"step": 600, "loss": 0.0455551484040916, "loss_real": 0.03986922334879637, "loss_synth": 0.04609185613691807, "lr": 0.00017993754018322624, "elapsed": 26.622278374969028, "steps_per_second": 46.4800898182388, "loss_extra": 0.046008522752672434} +{"step": 800, "loss": 0.04327655421569943, "loss_real": 0.036144845858216285, "loss_synth": 0.043911746609956025, "lr": 0.0002398518371215969, "elapsed": 30.770512713002972, "steps_per_second": 46.90160051109662, "loss_extra": 0.04388303514569998} +{"step": 1000, "loss": 0.0421371041983366, "loss_real": 0.03444035035558045, "loss_synth": 0.04280260657891631, "lr": 0.0002997105087403322, "elapsed": 34.7165422529215, "steps_per_second": 47.61220710963136, "loss_extra": 0.04281156802549958} +{"step": 1200, "loss": 0.04123446993529797, "loss_real": 0.03366744201630354, "loss_synth": 0.041738052796572445, "lr": 0.00035949966454633923, "elapsed": 38.72547239600681, "steps_per_second": 47.977073754087805, "loss_extra": 0.042047630343586204} +{"step": 1400, "loss": 0.04033455597236753, "loss_real": 0.032793572610244154, "loss_synth": 0.04077757334336638, "lr": 0.0004192054323428467, "elapsed": 42.79875810095109, "steps_per_second": 48.13439351938239, "loss_extra": 0.04120349975302815} +{"step": 1600, "loss": 0.039625712800771, "loss_real": 0.03180887714028358, "loss_synth": 0.04010819185525179, "lr": 0.0004788139618827038, "elapsed": 46.94130369799677, "steps_per_second": 48.1524831881029, "loss_extra": 0.04050328597426414} +{"step": 1800, "loss": 0.03891889547929168, "loss_real": 0.031273104231804606, "loss_synth": 0.039383169077336785, "lr": 0.000538311428516825, "elapsed": 51.52139818598516, "steps_per_second": 47.60912999478663, "loss_extra": 0.03978488264605403} +{"step": 2000, "loss": 0.03836703913286328, "loss_real": 0.031088699912652375, "loss_synth": 0.0387523733265698, "lr": 0.0005976840368369773, "elapsed": 56.31584232102614, "steps_per_second": 46.94580432657764, "loss_extra": 0.03924779390916228} +{"step": 2200, "loss": 0.03771803382784128, "loss_real": 0.030433834297582507, "loss_synth": 0.03800407605245709, "lr": 0.0005971982039200904, "elapsed": 60.29097183991689, "steps_per_second": 47.233161163602304, "loss_extra": 0.038698677513748406} +{"step": 2400, "loss": 0.037014004159718755, "loss_real": 0.029688206436112523, "loss_synth": 0.03728978116065264, "lr": 0.000596666387431128, "elapsed": 64.23711349396035, "steps_per_second": 47.502564274806026, "loss_extra": 0.03801209608092904} +{"step": 2600, "loss": 0.036441736500710246, "loss_real": 0.029724550871178507, "loss_synth": 0.0366959572955966, "lr": 0.0005960886713500785, "elapsed": 68.18007498700172, "steps_per_second": 47.73572108803564, "loss_extra": 0.03735556066036225} +{"step": 2800, "loss": 0.03591913409531117, "loss_real": 0.029021181464195252, "loss_synth": 0.036105772200971845, "lr": 0.0005954651469050082, "elapsed": 72.11194226099178, "steps_per_second": 47.94650585269631, "loss_extra": 0.03693165903910994} +{"step": 3000, "loss": 0.03537500035017729, "loss_real": 0.02859304977580905, "loss_synth": 0.035554582439363006, "lr": 0.0005947959125576553, "elapsed": 76.0487453090027, "steps_per_second": 48.12688609544646, "loss_extra": 0.03637439854443073} +{"step": 3200, "loss": 0.034839537758380175, "loss_real": 0.027985600093379616, "loss_synth": 0.03504501899704337, "lr": 0.000594081073987881, "elapsed": 79.98758786998224, "steps_per_second": 48.28434995075655, "loss_extra": 0.03582565212622285} +{"step": 3400, "loss": 0.03446085188537836, "loss_real": 0.02792464418336749, "loss_synth": 0.03459933714941144, "lr": 0.0005933207440769824, "elapsed": 83.9329830709612, "steps_per_second": 48.41962823430857, "loss_extra": 0.03545847965404391} +{"step": 3600, "loss": 0.03405622625723481, "loss_real": 0.027873298916965723, "loss_synth": 0.034155040849000215, "lr": 0.0005925150428898661, "elapsed": 87.88498544099275, "steps_per_second": 48.53618883051492, "loss_extra": 0.03503198174759745} +{"step": 3800, "loss": 0.03373318949714303, "loss_real": 0.027353813657537102, "loss_synth": 0.0338575667142868, "lr": 0.0005916640976560898, "elapsed": 91.82607629091945, "steps_per_second": 48.647752274725725, "loss_extra": 0.034717619400471446} +{"step": 4000, "loss": 0.03337740542367101, "loss_real": 0.027193015525117516, "loss_synth": 0.033458595760166646, "lr": 0.0005907680427497705, "elapsed": 95.74949980701786, "steps_per_second": 48.75909673483192, "loss_extra": 0.034370964895933866} +{"step": 4200, "loss": 0.03303249072283507, "loss_real": 0.026901752650737763, "loss_synth": 0.033106032852083446, "lr": 0.000589827019668365, "elapsed": 99.68251481000334, "steps_per_second": 48.854825790665416, "loss_extra": 0.034024344934150574} +{"step": 4400, "loss": 0.032671601502224805, "loss_real": 0.026487414054572583, "loss_synth": 0.032745886659249664, "lr": 0.0005888411770103267, "elapsed": 103.6455078870058, "steps_per_second": 48.92586503590375, "loss_extra": 0.03367200121283531} +{"step": 4600, "loss": 0.03231091813184321, "loss_real": 0.026335526462644337, "loss_synth": 0.032368927262723446, "lr": 0.0005878106704516395, "elapsed": 107.63569681101944, "steps_per_second": 48.976721445374665, "loss_extra": 0.0332912512216717} +{"step": 4800, "loss": 0.032083369651809336, "loss_real": 0.02600936157628894, "loss_synth": 0.03211004697717726, "lr": 0.0005867356627212351, "elapsed": 111.59697857592255, "steps_per_second": 49.037909181451795, "loss_extra": 0.03311203439719975} +{"step": 5000, "loss": 0.0317900853138417, "loss_real": 0.026012408528476954, "loss_synth": 0.031732539869844915, "lr": 0.000585616323575296, "elapsed": 115.54603649000637, "steps_per_second": 49.10023310714905, "loss_extra": 0.03285113501362503} +{"step": 5200, "loss": 0.03157236933708191, "loss_real": 0.025851188069209455, "loss_synth": 0.03161770789884031, "lr": 0.000584452829770449, "elapsed": 120.4338203589432, "steps_per_second": 48.725502787648644, "loss_extra": 0.03252115610986948} +{"step": 5400, "loss": 0.03132182266563177, "loss_real": 0.025735908914357425, "loss_synth": 0.031283475225791335, "lr": 0.0005832453650358537, "elapsed": 124.37152571894694, "steps_per_second": 48.799002541404825, "loss_extra": 0.032330440590158105} +{"step": 5600, "loss": 0.031084082908928393, "loss_real": 0.02535596043802798, "loss_synth": 0.031034653279930352, "lr": 0.0005819941200441891, "elapsed": 128.31163878994994, "steps_per_second": 48.866424207381286, "loss_extra": 0.03212844181805849} +{"step": 5800, "loss": 0.030806725528091192, "loss_real": 0.025265940157696606, "loss_synth": 0.030700608380138873, "lr": 0.0005806992923815441, "elapsed": 132.26750549999997, "steps_per_second": 48.922861804696744, "loss_extra": 0.03187498614192009} +{"step": 6000, "loss": 0.03060430344194174, "loss_real": 0.025313110686838627, "loss_synth": 0.03052147675305605, "lr": 0.0005793610865162167, "elapsed": 136.22946984693408, "steps_per_second": 48.97321769257619, "loss_extra": 0.031606010533869265} +{"step": 6200, "loss": 0.030407548286020755, "loss_real": 0.02508273035287857, "loss_synth": 0.030329056056216358, "lr": 0.0005779797137664262, "elapsed": 140.14593096694443, "steps_per_second": 49.038061138482654, "loss_extra": 0.03141078139655292} +{"step": 6400, "loss": 0.03027852674946189, "loss_real": 0.02493589747697115, "loss_synth": 0.0301498307287693, "lr": 0.0005765553922669433, "elapsed": 144.03410954691935, "steps_per_second": 49.10966344827786, "loss_extra": 0.03133484499529004} +{"step": 6600, "loss": 0.030072442088276148, "loss_real": 0.024757496463134885, "loss_synth": 0.030006893398240208, "lr": 0.0005750883469346437, "elapsed": 147.93402882292867, "steps_per_second": 49.17281539008947, "loss_extra": 0.031061071278527377} +{"step": 6800, "loss": 0.029866881305351853, "loss_real": 0.024712673034518958, "loss_synth": 0.029803635254502296, "lr": 0.000573578809432992, "elapsed": 151.82217624399345, "steps_per_second": 49.23659666686429, "loss_extra": 0.030825292691588402} +{"step": 7000, "loss": 0.029633159581571818, "loss_real": 0.02417806560173631, "loss_synth": 0.029600170012563466, "lr": 0.000572027018135459, "elapsed": 155.71595376299229, "steps_per_second": 49.29493189130886, "loss_extra": 0.03061371517367661} +{"step": 7200, "loss": 0.02949294414371252, "loss_real": 0.024456268334761264, "loss_synth": 0.02934184522368014, "lr": 0.0005704332180878793, "elapsed": 159.65986996795982, "steps_per_second": 49.333198838720826, "loss_extra": 0.030518417255952956} +{"step": 7400, "loss": 0.029328408874571322, "loss_real": 0.024216757426038384, "loss_synth": 0.029105985201895238, "lr": 0.0005687976609697565, "elapsed": 163.54100534098689, "steps_per_second": 49.39013881802181, "loss_extra": 0.030437930207699537} +{"step": 7600, "loss": 0.029207696104422212, "loss_real": 0.024270216282457114, "loss_synth": 0.029063318138942123, "lr": 0.0005671206050545193, "elapsed": 167.57330845901743, "steps_per_second": 49.39562427918297, "loss_extra": 0.03020924356766045} +{"step": 7800, "loss": 0.02904934826306999, "loss_real": 0.024029373219236733, "loss_synth": 0.02882847398519516, "lr": 0.000565402315168738, "elapsed": 171.45194873900618, "steps_per_second": 49.448953974484866, "loss_extra": 0.030141400191932916} +{"step": 8000, "loss": 0.02887510367669165, "loss_real": 0.024076468208804727, "loss_synth": 0.028587583107873796, "lr": 0.0005636430626503045, "elapsed": 175.22253850498237, "steps_per_second": 49.53283957047523, "loss_extra": 0.0299950662907213} +{"step": 8200, "loss": 0.028796283276751638, "loss_real": 0.0238009178917855, "loss_synth": 0.028585430569946765, "lr": 0.0005618431253055855, "elapsed": 178.99346606701147, "steps_per_second": 49.61279635754859, "loss_extra": 0.029874079963192343} +{"step": 8400, "loss": 0.0285965892765671, "loss_real": 0.023444289779290556, "loss_synth": 0.028469005357474087, "lr": 0.000560002787365553, "elapsed": 182.80467401898932, "steps_per_second": 49.67734919931546, "loss_extra": 0.029618734288960696} +{"step": 8600, "loss": 0.028435042034834622, "loss_real": 0.023591219997033477, "loss_synth": 0.028206432061269878, "lr": 0.0005581223394409018, "elapsed": 186.90793195797596, "steps_per_second": 49.65518336160361, "loss_extra": 0.029504193626344204} +{"step": 8800, "loss": 0.02838711137883365, "loss_real": 0.023636077428236604, "loss_synth": 0.02818322703242302, "lr": 0.0005562020784761579, "elapsed": 191.35482206894085, "steps_per_second": 49.53803087091132, "loss_extra": 0.029415522729977966} +{"step": 9000, "loss": 0.02818543031811714, "loss_real": 0.02335476907901466, "loss_synth": 0.027913879565894605, "lr": 0.0005542423077027882, "elapsed": 195.14421820396092, "steps_per_second": 49.6057194025455, "loss_extra": 0.029295054422691466} +{"step": 9200, "loss": 0.028129523396492006, "loss_real": 0.023642422063276172, "loss_synth": 0.027868593791499734, "lr": 0.0005522433365913161, "elapsed": 198.91767933696974, "steps_per_second": 49.67491194271504, "loss_extra": 0.029168885163962842} +{"step": 9400, "loss": 0.02795465024188161, "loss_real": 0.02312016054056585, "loss_synth": 0.02773633352480829, "lr": 0.0005502054808024529, "elapsed": 202.69575720396824, "steps_per_second": 49.740126070760766, "loss_extra": 0.029011931158602237} +{"step": 9600, "loss": 0.0278834418579936, "loss_real": 0.023383927503600715, "loss_synth": 0.027634682906791566, "lr": 0.0005481290621372514, "elapsed": 206.47370139998384, "steps_per_second": 49.802818391260814, "loss_extra": 0.028912841342389584} +{"step": 9800, "loss": 0.027769885063171386, "loss_real": 0.023025342207401992, "loss_synth": 0.02750210211612284, "lr": 0.000546014408486289, "elapsed": 210.2613497049315, "steps_per_second": 49.86063860157993, "loss_extra": 0.028860796196386217} +{"step": 10000, "loss": 0.027582612810656427, "loss_real": 0.022822572914883495, "loss_synth": 0.027332398351281883, "lr": 0.0005438618537778916, "elapsed": 214.04068029101472, "steps_per_second": 49.91834504250683, "loss_extra": 0.028658722508698702} +{"step": 10200, "loss": 0.027563450038433076, "loss_real": 0.023027364015579223, "loss_synth": 0.02724981144070625, "lr": 0.0005416717379254006, "elapsed": 229.8856389200082, "steps_per_second": 47.184624651525134, "loss_extra": 0.028663807613775134} +{"step": 10400, "loss": 0.027355884592980148, "loss_real": 0.022657077070325615, "loss_synth": 0.027076455792412163, "lr": 0.0005394444067734975, "elapsed": 233.65356040094048, "steps_per_second": 47.28561599260271, "loss_extra": 0.028450446482747794} +{"step": 10600, "loss": 0.027218448305502532, "loss_real": 0.022673186901956795, "loss_synth": 0.02693895695731044, "lr": 0.0005371802120435915, "elapsed": 239.21048017393332, "steps_per_second": 47.00728685848545, "loss_extra": 0.028286397596821188} +{"step": 10800, "loss": 0.027104914784431458, "loss_real": 0.022648669416084885, "loss_synth": 0.026905152918770908, "lr": 0.0005348795112782779, "elapsed": 245.93393038399518, "steps_per_second": 46.507541130085684, "loss_extra": 0.028078007306903602} +{"step": 11000, "loss": 0.027047468908131124, "loss_real": 0.022206849278882147, "loss_synth": 0.02675358494743705, "lr": 0.0005325426677848778, "elapsed": 251.00865913298912, "steps_per_second": 46.35577586717323, "loss_extra": 0.02818106179125607} +{"step": 11200, "loss": 0.027055075224488974, "loss_real": 0.02275040223263204, "loss_synth": 0.026775395506992938, "lr": 0.0005301700505780687, "elapsed": 255.4988767299801, "steps_per_second": 46.32207853849324, "loss_extra": 0.02808141474612057} +{"step": 11400, "loss": 0.026962035959586503, "loss_real": 0.02220046000555158, "loss_synth": 0.026806362010538577, "lr": 0.0005277620343216117, "elapsed": 259.7882860819809, "steps_per_second": 46.32738442475293, "loss_extra": 0.027944272281602026} +{"step": 11600, "loss": 0.026828880682587625, "loss_real": 0.022255771150812505, "loss_synth": 0.026459384560585022, "lr": 0.0005253189992691882, "elapsed": 264.0742266239831, "steps_per_second": 46.333150339408654, "loss_extra": 0.027991291033104063} +{"step": 11800, "loss": 0.02680801580660045, "loss_real": 0.02232897959649563, "loss_synth": 0.0264358769915998, "lr": 0.0005228413312043536, "elapsed": 268.32645986799616, "steps_per_second": 46.34485697982836, "loss_extra": 0.027956714602187276} +{"step": 12000, "loss": 0.026668727518990635, "loss_real": 0.022033937545493244, "loss_synth": 0.02637154812924564, "lr": 0.0005203294213796174, "elapsed": 272.607666151016, "steps_per_second": 46.35099117849639, "loss_extra": 0.027769843079149724} +{"step": 12200, "loss": 0.02659348794259131, "loss_real": 0.022288052514195442, "loss_synth": 0.026259879805147646, "lr": 0.0005177836664546598, "elapsed": 276.83973469992634, "steps_per_second": 46.36558276083076, "loss_extra": 0.027673659371212123} +{"step": 12400, "loss": 0.026479592239484193, "loss_real": 0.021874253051355482, "loss_synth": 0.026175751788541674, "lr": 0.000515204468433695, "elapsed": 281.0189289560076, "steps_per_second": 46.38888652134249, "loss_extra": 0.02758222452364862} +{"step": 12600, "loss": 0.02639518548734486, "loss_real": 0.02183656787034124, "loss_synth": 0.026089163990691305, "lr": 0.0005125922346019892, "elapsed": 285.1963108209893, "steps_per_second": 46.41178266107251, "loss_extra": 0.027491872701793908} +{"step": 12800, "loss": 0.026391728250309825, "loss_real": 0.021804714566096662, "loss_synth": 0.02608013932593167, "lr": 0.0005099473774615467, "elapsed": 289.2835104149999, "steps_per_second": 46.44918071580681, "loss_extra": 0.027498892201110722} +{"step": 13000, "loss": 0.026236975006759165, "loss_real": 0.021552786016836762, "loss_synth": 0.025797906443476678, "lr": 0.00050727031466597, "elapsed": 293.117435897002, "steps_per_second": 46.527623797557645, "loss_extra": 0.027487960858270526} +{"step": 13200, "loss": 0.026101661007851364, "loss_real": 0.021653726203367113, "loss_synth": 0.025741940112784505, "lr": 0.000504561468954508, "elapsed": 296.91893034696113, "steps_per_second": 46.60928006318835, "loss_extra": 0.02723259140737355} +{"step": 13400, "loss": 0.0260611467435956, "loss_real": 0.021457021995447575, "loss_synth": 0.025704554449766874, "lr": 0.0005018212680853004, "elapsed": 300.7545986849582, "steps_per_second": 46.683214640891606, "loss_extra": 0.027216096380725502} +{"step": 13600, "loss": 0.025967728858813644, "loss_real": 0.021716431733220815, "loss_synth": 0.025712931836023925, "lr": 0.0004990501447678302, "elapsed": 304.55423987901304, "steps_per_second": 46.760991015209775, "loss_extra": 0.026960018184036018} +{"step": 13800, "loss": 0.025899658119305967, "loss_real": 0.021360221281647683, "loss_synth": 0.02559624412097037, "lr": 0.0004962485365945929, "elapsed": 308.3477560109459, "steps_per_second": 46.837735070993475, "loss_extra": 0.026990416795015335} +{"step": 14000, "loss": 0.025945517076179384, "loss_real": 0.021528224162757396, "loss_synth": 0.025675055840983986, "lr": 0.0004934168859719962, "elapsed": 312.14326554199215, "steps_per_second": 46.912214679090084, "loss_extra": 0.02698224252089858} +{"step": 14200, "loss": 0.025773805659264327, "loss_real": 0.021011708532460035, "loss_synth": 0.025454035196453333, "lr": 0.0004905556400504991, "elapsed": 315.93323196901474, "steps_per_second": 46.98568533460328, "loss_extra": 0.026919533889740707} +{"step": 14400, "loss": 0.02576653251424432, "loss_real": 0.021364722102880478, "loss_synth": 0.02551471909508109, "lr": 0.0004876652506540011, "elapsed": 321.73758259101305, "steps_per_second": 46.74959535894582, "loss_extra": 0.026781999217346312} +{"step": 14600, "loss": 0.02560603654012084, "loss_real": 0.02121675034984946, "loss_synth": 0.025290217055007815, "lr": 0.00048474617420849446, "elapsed": 331.84646539296955, "steps_per_second": 45.8927643161436, "loss_extra": 0.026683062510564924} +{"step": 14800, "loss": 0.02557389092631638, "loss_real": 0.0211915887799114, "loss_synth": 0.02532014080323279, "lr": 0.000481798871669989, "elapsed": 340.49016707693227, "steps_per_second": 45.29087499390018, "loss_extra": 0.02658789722248912} +{"step": 15000, "loss": 0.025505782999098302, "loss_real": 0.02098116548731923, "loss_synth": 0.025167695553973315, "lr": 0.00047882380845172155, "elapsed": 347.3068053959869, "steps_per_second": 44.964934650573646, "loss_extra": 0.02662849338725209} +{"step": 15200, "loss": 0.02542385912500322, "loss_real": 0.02089142472948879, "loss_synth": 0.025168796898797155, "lr": 0.0004758214543506626, "elapsed": 353.6809145259904, "steps_per_second": 44.7101707937902, "loss_extra": 0.026465254193171858} +{"step": 15400, "loss": 0.025406981967389584, "loss_real": 0.02094095347914845, "loss_synth": 0.025049010198563336, "lr": 0.0004727922834733288, "elapsed": 358.7399222769309, "steps_per_second": 44.63426595652117, "loss_extra": 0.02653931378386915} +{"step": 15600, "loss": 0.025397557560354472, "loss_real": 0.02074187726713717, "loss_synth": 0.025091354930773378, "lr": 0.0004697367741609171, "elapsed": 363.52905943698715, "steps_per_second": 44.59493222801779, "loss_extra": 0.026511287670582532} +{"step": 15800, "loss": 0.025248009776696563, "loss_real": 0.020766948414966464, "loss_synth": 0.02491655996069312, "lr": 0.0004666554089137685, "elapsed": 368.17140305100475, "steps_per_second": 44.57511323678744, "loss_extra": 0.02635654365643859} +{"step": 16000, "loss": 0.02527817206457257, "loss_real": 0.02093754564411938, "loss_synth": 0.025006252396851777, "lr": 0.00046354867431517584, "elapsed": 372.9573441479588, "steps_per_second": 44.53799675666266, "loss_extra": 0.026303030410781504} +{"step": 16200, "loss": 0.025083325086161495, "loss_real": 0.020600545927882196, "loss_synth": 0.02476532492786646, "lr": 0.0004604170609545466, "elapsed": 377.74339194898494, "steps_per_second": 44.50184317155486, "loss_extra": 0.02617876499891281} +{"step": 16400, "loss": 0.02505345773883164, "loss_real": 0.020422638822346927, "loss_synth": 0.024706645496189596, "lr": 0.00045726106334993325, "elapsed": 382.4051230889745, "steps_per_second": 44.48162131608382, "loss_extra": 0.026203305963426828} +{"step": 16600, "loss": 0.02507233784534037, "loss_real": 0.020638858885504305, "loss_synth": 0.02467195943929255, "lr": 0.0004540811798699431, "elapsed": 387.0608189209597, "steps_per_second": 44.46262320221875, "loss_extra": 0.02624124187976122} +{"step": 16800, "loss": 0.02493718690238893, "loss_real": 0.020533387591131033, "loss_synth": 0.024583820588886737, "lr": 0.00045087791265504006, "elapsed": 391.5759081459837, "steps_per_second": 44.460631169033, "loss_extra": 0.026054121991619467} +{"step": 17000, "loss": 0.024967413432896136, "loss_real": 0.020507739437744022, "loss_synth": 0.02453443704172969, "lr": 0.0004476517675382507, "elapsed": 396.09400900197215, "steps_per_second": 44.45833603058955, "loss_extra": 0.026173328161239625} +{"step": 17200, "loss": 0.02480456670746207, "loss_real": 0.02046517421491444, "loss_synth": 0.024514017682522534, "lr": 0.00044440325396528766, "elapsed": 400.38092940300703, "steps_per_second": 44.48267388506842, "loss_extra": 0.025847761426120996} +{"step": 17400, "loss": 0.024842421431094407, "loss_real": 0.02051477844826877, "loss_synth": 0.02447941552847624, "lr": 0.00044113288491410207, "elapsed": 404.4441625889158, "steps_per_second": 44.531957235646004, "loss_extra": 0.025955724604427813} +{"step": 17600, "loss": 0.024731620429083705, "loss_real": 0.02017077895347029, "loss_synth": 0.024461315367370843, "lr": 0.00043784117681387844, "elapsed": 408.2890847410308, "steps_per_second": 44.604891553519174, "loss_extra": 0.025793128795921803} +{"step": 17800, "loss": 0.02471220998093486, "loss_real": 0.02020254489034414, "loss_synth": 0.024274032805114986, "lr": 0.00043452864946348456, "elapsed": 412.13118227396626, "steps_per_second": 44.67673489834634, "loss_extra": 0.02593198835849762} +{"step": 18000, "loss": 0.02465006396174431, "loss_real": 0.020346387019380928, "loss_synth": 0.024306446639820935, "lr": 0.00043119582594938896, "elapsed": 415.99201596796047, "steps_per_second": 44.74512173092978, "loss_extra": 0.02573989731259644} +{"step": 18200, "loss": 0.024557920340448618, "loss_real": 0.020244811931625008, "loss_synth": 0.024223788632079957, "lr": 0.0004278432325630599, "elapsed": 420.19702085701283, "steps_per_second": 44.77426569579608, "loss_extra": 0.025639946749433876} +{"step": 18400, "loss": 0.024655288411304356, "loss_real": 0.020193641101941467, "loss_synth": 0.02429068423807621, "lr": 0.00042447139871785766, "elapsed": 424.0121854689205, "steps_per_second": 44.84538172688133, "loss_extra": 0.025793463783338667} +{"step": 18600, "loss": 0.024495802354067564, "loss_real": 0.019835303518921137, "loss_synth": 0.024092766605317593, "lr": 0.0004210808568654337, "elapsed": 427.8195665689418, "steps_per_second": 44.91603160022425, "loss_extra": 0.025706792473793028} +{"step": 18800, "loss": 0.024458567844703794, "loss_real": 0.019857681239955127, "loss_synth": 0.02410201884806156, "lr": 0.00041767214241165117, "elapsed": 431.6055571389152, "steps_per_second": 44.98769683352729, "loss_extra": 0.025612911749631165} +{"step": 19000, "loss": 0.02438163761049509, "loss_real": 0.01943617618177086, "loss_synth": 0.024099200181663036, "lr": 0.00041424579363203725, "elapsed": 441.57551424601115, "steps_per_second": 44.40684269329056, "loss_extra": 0.025522046685218812} +{"step": 19200, "loss": 0.024378261724486948, "loss_real": 0.019684951868839562, "loss_synth": 0.024084041193127632, "lr": 0.00041080235158678376, "elapsed": 451.88083213195205, "steps_per_second": 43.81887862714986, "loss_extra": 0.025486597800627352} +{"step": 19400, "loss": 0.024305771850049496, "loss_real": 0.02007395775988698, "loss_synth": 0.023964731292799114, "lr": 0.00040734236003530744, "elapsed": 460.61506875092164, "steps_per_second": 43.41000902988764, "loss_extra": 0.025380554497241973} +{"step": 19600, "loss": 0.024280791096389295, "loss_real": 0.020193027378991247, "loss_synth": 0.02387398243881762, "lr": 0.0004038663653503835, "elapsed": 468.0163605469279, "steps_per_second": 43.143028204739124, "loss_extra": 0.02539603754878044} +{"step": 19800, "loss": 0.024232966294512152, "loss_real": 0.01978725067805499, "loss_synth": 0.023868140960112215, "lr": 0.000400374916431868, "elapsed": 474.3036434330279, "steps_per_second": 42.98833008435572, "loss_extra": 0.02536859368905425} +{"step": 20000, "loss": 0.02416521467268467, "loss_real": 0.019752384210005403, "loss_synth": 0.023773399526253344, "lr": 0.00039686856462001896, "elapsed": 479.9048621719703, "steps_per_second": 42.900840177642905, "loss_extra": 0.025322004733607174} +{"step": 20200, "loss": 0.024143745228648185, "loss_real": 0.019536674804985523, "loss_synth": 0.023820661390200257, "lr": 0.00039334786360843476, "elapsed": 498.06821034499444, "steps_per_second": 41.70497500268379, "loss_extra": 0.025265840301290154} +{"step": 20400, "loss": 0.024107043985277413, "loss_real": 0.019674855060875417, "loss_synth": 0.02368662723340094, "lr": 0.00038981336935661813, "elapsed": 502.9585328649264, "steps_per_second": 41.69689975055244, "loss_extra": 0.025295677408576012} +{"step": 20600, "loss": 0.02409271658398211, "loss_real": 0.01956677995156497, "loss_synth": 0.023710928224027157, "lr": 0.00038626564000218466, "elapsed": 508.032734081964, "steps_per_second": 41.67347671434694, "loss_extra": 0.02525917187333107} +{"step": 20800, "loss": 0.02397919401526451, "loss_real": 0.019486078433692454, "loss_synth": 0.023599051106721163, "lr": 0.00038270523577272616, "elapsed": 512.8977271859767, "steps_per_second": 41.66798539964143, "loss_extra": 0.02513830881565809} +{"step": 21000, "loss": 0.023924412997439505, "loss_real": 0.019275855012238025, "loss_synth": 0.02359918875619769, "lr": 0.0003791327188973438, "elapsed": 517.789685320924, "steps_per_second": 41.66037139067652, "loss_extra": 0.025055847084149718} +{"step": 21200, "loss": 0.02390590977855027, "loss_real": 0.019434472927823663, "loss_synth": 0.023509049545973538, "lr": 0.00037554865351786614, "elapsed": 522.5364387169247, "steps_per_second": 41.66479039666116, "loss_extra": 0.02507790505886078} +{"step": 21400, "loss": 0.023908504070714116, "loss_real": 0.01947361835744232, "loss_synth": 0.023553210031241178, "lr": 0.00037195360559976446, "elapsed": 527.2506813809741, "steps_per_second": 41.67176568094822, "loss_extra": 0.025032759103924038} +{"step": 21600, "loss": 0.023854557760059833, "loss_real": 0.019285353748127818, "loss_synth": 0.023475589184090494, "lr": 0.0003683481428427801, "elapsed": 531.7781942259753, "steps_per_second": 41.69363658909857, "loss_extra": 0.02502572209574282} +{"step": 21800, "loss": 0.023843722725287078, "loss_real": 0.01931721147149801, "loss_synth": 0.023471337743103504, "lr": 0.0003647328345912784, "elapsed": 536.021948608919, "steps_per_second": 41.73779143235079, "loss_extra": 0.025000914223492144} +{"step": 22000, "loss": 0.023822772866114974, "loss_real": 0.01920476593542844, "loss_synth": 0.023510911595076324, "lr": 0.0003611082517443419, "elapsed": 539.8232000250136, "steps_per_second": 41.8163761122205, "loss_extra": 0.02493559267371893} +{"step": 22200, "loss": 0.02365263576619327, "loss_real": 0.018970291796140373, "loss_synth": 0.023296508183702828, "lr": 0.00035747496666562, "elapsed": 543.6165716429241, "steps_per_second": 41.89445633369742, "loss_extra": 0.02482071127742529} +{"step": 22400, "loss": 0.023650412783026695, "loss_real": 0.0189919646224007, "loss_synth": 0.023272601114585997, "lr": 0.00035383355309294483, "elapsed": 547.4097559989896, "steps_per_second": 41.97144132686866, "loss_extra": 0.024835929591208696} +{"step": 22600, "loss": 0.02370442374609411, "loss_real": 0.019117254898883402, "loss_synth": 0.02332761975005269, "lr": 0.00035018458604773206, "elapsed": 551.2074708309956, "steps_per_second": 42.04698518780257, "loss_extra": 0.024876553546637297} +{"step": 22800, "loss": 0.023573457468301057, "loss_real": 0.018959567532874644, "loss_synth": 0.02317902254872024, "lr": 0.0003465286417441785, "elapsed": 555.0036516379332, "steps_per_second": 42.12158863520537, "loss_extra": 0.02476778583601117} +{"step": 23000, "loss": 0.023576876670122145, "loss_real": 0.01896512843668461, "loss_synth": 0.023254293873906137, "lr": 0.0003428662974982705, "elapsed": 558.8114961850224, "steps_per_second": 42.194249960985054, "loss_extra": 0.024699285458773375} +{"step": 23200, "loss": 0.023518925197422505, "loss_real": 0.01920572516042739, "loss_synth": 0.02310436226427555, "lr": 0.00033919813163662, "elapsed": 562.6293455649866, "steps_per_second": 42.26513279083129, "loss_extra": 0.024681057734414934} +{"step": 23400, "loss": 0.02346860553137958, "loss_real": 0.018974888087250293, "loss_synth": 0.023113854294642806, "lr": 0.000335524723405139, "elapsed": 566.4037415659986, "steps_per_second": 42.33836486582183, "loss_extra": 0.024602541057392954} +{"step": 23600, "loss": 0.02342443648725748, "loss_real": 0.019154155803844334, "loss_synth": 0.02307595295831561, "lr": 0.00033184665287757097, "elapsed": 570.1922073269961, "steps_per_second": 42.40953121258334, "loss_extra": 0.024513313146308065} +{"step": 23800, "loss": 0.023441422879695892, "loss_real": 0.0189291121577844, "loss_synth": 0.023021264132112265, "lr": 0.0003281645008638895, "elapsed": 573.9714253429556, "steps_per_second": 42.48043628812841, "loss_extra": 0.024643718814477324} +{"step": 24000, "loss": 0.023403405668213962, "loss_real": 0.018834504936821757, "loss_synth": 0.023060907945036888, "lr": 0.0003244788488185826, "elapsed": 577.8056527029257, "steps_per_second": 42.54624175139318, "loss_extra": 0.024538200795650483} +{"step": 24200, "loss": 0.02331735549494624, "loss_real": 0.018691824045963586, "loss_synth": 0.02293743474408984, "lr": 0.00032079027874883385, "elapsed": 581.641418396961, "steps_per_second": 42.611043248272445, "loss_extra": 0.0244992536585778} +{"step": 24400, "loss": 0.02335906684398651, "loss_real": 0.018769739377312362, "loss_synth": 0.022935951156541706, "lr": 0.00031709937312261613, "elapsed": 585.4787127060117, "steps_per_second": 42.674861243102896, "loss_extra": 0.024577687429264188} +{"step": 24600, "loss": 0.023198020169511436, "loss_real": 0.018643696517683564, "loss_synth": 0.022868451280519366, "lr": 0.0003134067147767145, "elapsed": 589.3091806509765, "steps_per_second": 42.738335159945045, "loss_extra": 0.024317408986389635} +{"step": 24800, "loss": 0.023201829437166453, "loss_real": 0.01877543699927628, "loss_synth": 0.02280865080654621, "lr": 0.0003097128868246881, "elapsed": 593.1437028599903, "steps_per_second": 42.800670351105055, "loss_extra": 0.024362333565950394} +{"step": 25000, "loss": 0.02312657680362463, "loss_real": 0.018383547379635275, "loss_synth": 0.02269349222071469, "lr": 0.0003060184725647909, "elapsed": 596.9845311170211, "steps_per_second": 42.86172254774318, "loss_extra": 0.0243818262219429} +{"step": 25200, "loss": 0.023159773983061314, "loss_real": 0.018692576764151453, "loss_synth": 0.0228249722532928, "lr": 0.0003023240553878617, "elapsed": 601.5844384690281, "steps_per_second": 42.86655362073358, "loss_extra": 0.024269237583503127} +{"step": 25400, "loss": 0.023109003361314537, "loss_real": 0.018447792907245457, "loss_synth": 0.02271897272206843, "lr": 0.0002986302186851996, "elapsed": 605.4369275659556, "steps_per_second": 42.92546134950079, "loss_extra": 0.024307167194783687} +{"step": 25600, "loss": 0.023146640276536345, "loss_real": 0.018415081021375953, "loss_synth": 0.02273066188208759, "lr": 0.00029493754575644036, "elapsed": 609.2995758289471, "steps_per_second": 42.98287376796713, "loss_extra": 0.024382863380014896} +{"step": 25800, "loss": 0.023069521635770796, "loss_real": 0.018319178968667985, "loss_synth": 0.02265001486055553, "lr": 0.0002912466197174462, "elapsed": 613.1293416030239, "steps_per_second": 43.04190736392675, "loss_extra": 0.024312521563842893} +{"step": 26000, "loss": 0.022940736403688787, "loss_real": 0.018412163867615162, "loss_synth": 0.022435446167364717, "lr": 0.00028755802340822527, "elapsed": 616.9931438310305, "steps_per_second": 43.097759641444505, "loss_extra": 0.024230628535151483} +{"step": 26200, "loss": 0.022907934123650192, "loss_real": 0.01837219431065023, "loss_synth": 0.02262929929420352, "lr": 0.0002838723393008943, "elapsed": 620.8262522049481, "steps_per_second": 43.15508286249751, "loss_extra": 0.02397337632253766} +{"step": 26400, "loss": 0.023013344686478376, "loss_real": 0.01836732120718807, "loss_synth": 0.022685076827183365, "lr": 0.00028019014940769974, "elapsed": 624.6882500529755, "steps_per_second": 43.209643490004694, "loss_extra": 0.02414736891165376} +{"step": 26600, "loss": 0.0229437336884439, "loss_real": 0.018222657795995474, "loss_synth": 0.022627363447099924, "lr": 0.000276512035189111, "elapsed": 628.5382848050212, "steps_per_second": 43.26436049224703, "loss_extra": 0.024078949298709632} +{"step": 26800, "loss": 0.02286763148382306, "loss_real": 0.01827545533888042, "loss_synth": 0.022472315561026336, "lr": 0.00027283857746200125, "elapsed": 632.4132429090096, "steps_per_second": 43.31665145496671, "loss_extra": 0.024059064975008367} +{"step": 27000, "loss": 0.022916753897443413, "loss_real": 0.01826012572273612, "loss_synth": 0.02249598104506731, "lr": 0.0002691703563079296, "elapsed": 636.2526752030244, "steps_per_second": 43.370766382477505, "loss_extra": 0.024144733548164366} +{"step": 27200, "loss": 0.02278401452116668, "loss_real": 0.018276517097838223, "loss_synth": 0.022462432086467744, "lr": 0.0002655079509815397, "elapsed": 640.1188768299762, "steps_per_second": 43.42236216767425, "loss_extra": 0.023887316007167102} +{"step": 27400, "loss": 0.022727383524179457, "loss_real": 0.01804418371990323, "loss_synth": 0.022428768575191497, "lr": 0.00026185193981908867, "elapsed": 643.9517566369614, "steps_per_second": 43.47562346184082, "loss_extra": 0.023838338954374195} +{"step": 27600, "loss": 0.02272117892280221, "loss_real": 0.017994265602901578, "loss_synth": 0.022335150726139546, "lr": 0.0002582029001471206, "elapsed": 647.7875522739487, "steps_per_second": 43.52804067520133, "loss_extra": 0.023926771581172943} +{"step": 27800, "loss": 0.022722544008865954, "loss_real": 0.01800984005443752, "loss_synth": 0.022355036502704026, "lr": 0.00025456140819130085, "elapsed": 651.6540421219543, "steps_per_second": 43.57773068814212, "loss_extra": 0.023907226296141743} +{"step": 28000, "loss": 0.02269091530703008, "loss_real": 0.018104766355827452, "loss_synth": 0.022328735552728175, "lr": 0.0002509280389854229, "elapsed": 655.4770928280195, "steps_per_second": 43.62977497260858, "loss_extra": 0.023848305642604827} +{"step": 28200, "loss": 0.02265634506009519, "loss_real": 0.01805495619773865, "loss_synth": 0.022292337911203504, "lr": 0.00024730336628060344, "elapsed": 659.3307900589425, "steps_per_second": 43.679129378807254, "loss_extra": 0.02381820285692811} +{"step": 28400, "loss": 0.022597842225804923, "loss_real": 0.01800902107730508, "loss_synth": 0.0222234851308167, "lr": 0.00024368796245468133, "elapsed": 663.3643290619366, "steps_per_second": 43.71579295080312, "loss_extra": 0.023767823008820414} +{"step": 28600, "loss": 0.022646229164674878, "loss_real": 0.017978917970322073, "loss_synth": 0.022233772445470094, "lr": 0.00024008239842183163, "elapsed": 667.3706460489193, "steps_per_second": 43.753826169287166, "loss_extra": 0.023867783918976784} +{"step": 28800, "loss": 0.022557179499417542, "loss_real": 0.01794685243163258, "loss_synth": 0.022207176703959705, "lr": 0.00023648724354241227, "elapsed": 671.407213339, "steps_per_second": 43.789381830516355, "loss_extra": 0.02370664489455521} +{"step": 29000, "loss": 0.022542089438065887, "loss_real": 0.0178364144731313, "loss_synth": 0.022186984876170754, "lr": 0.00023290306553305494, "elapsed": 675.4687180679757, "steps_per_second": 43.822852159206356, "loss_extra": 0.02371320003643632} +{"step": 29200, "loss": 0.02256199558265507, "loss_real": 0.017854337925091387, "loss_synth": 0.02220574589446187, "lr": 0.00022933043037701642, "elapsed": 679.4933287160238, "steps_per_second": 43.858344573086676, "loss_extra": 0.023734590830281378} +{"step": 29400, "loss": 0.022457913644611836, "loss_real": 0.01797081407159567, "loss_synth": 0.022011081334203483, "lr": 0.00022576990223480343, "elapsed": 683.393884385936, "steps_per_second": 43.90154138996006, "loss_extra": 0.023682390172034502} +{"step": 29600, "loss": 0.022428753329440953, "loss_real": 0.017835238967090845, "loss_synth": 0.02211996216326952, "lr": 0.00022222204335508425, "elapsed": 687.2359768570168, "steps_per_second": 43.94805246130423, "loss_extra": 0.023534261332824827} +{"step": 29800, "loss": 0.022471308717504145, "loss_real": 0.018064763154834507, "loss_synth": 0.02205013466067612, "lr": 0.00021868741398590414, "elapsed": 691.0943226299714, "steps_per_second": 43.9929802464943, "loss_extra": 0.02365624117664993} +{"step": 30000, "loss": 0.022483528265729545, "loss_real": 0.017617242769338192, "loss_synth": 0.022193054631352425, "lr": 0.00021516657228621528, "elapsed": 694.9280222170055, "steps_per_second": 44.03899237012489, "loss_extra": 0.023618184328079224} +{"step": 30200, "loss": 0.022382618403062226, "loss_real": 0.01786531800404191, "loss_synth": 0.02202593962661922, "lr": 0.00021166007423773693, "elapsed": 710.8835988549981, "steps_per_second": 43.31798104811265, "loss_extra": 0.023522570114582777} +{"step": 30400, "loss": 0.022363857049494982, "loss_real": 0.017688111462630333, "loss_synth": 0.02193859818391502, "lr": 0.0002081684735571596, "elapsed": 714.7183268739609, "steps_per_second": 43.366322124598554, "loss_extra": 0.023599624885246157} +{"step": 30600, "loss": 0.02237863396294415, "loss_real": 0.017666242625564335, "loss_synth": 0.02204409435391426, "lr": 0.00020469232160870657, "elapsed": 718.702581277932, "steps_per_second": 43.404929157832754, "loss_extra": 0.02353043343871832} +{"step": 30800, "loss": 0.022345525305718185, "loss_real": 0.017384464512579145, "loss_synth": 0.022012693444266915, "lr": 0.00020123216731706737, "elapsed": 722.7056145169772, "steps_per_second": 43.441951617758086, "loss_extra": 0.023538825223222374} +{"step": 31000, "loss": 0.02232311585918069, "loss_real": 0.01764480139128864, "loss_synth": 0.021928959367796777, "lr": 0.00019778855708071612, "elapsed": 726.5641438040184, "steps_per_second": 43.487372004019264, "loss_extra": 0.023528359234333038} +{"step": 31200, "loss": 0.02228473643772304, "loss_real": 0.01751917748246342, "loss_synth": 0.021908483672887086, "lr": 0.00019436203468562864, "elapsed": 730.385741328937, "steps_per_second": 43.534546670817846, "loss_extra": 0.023487309031188487} +{"step": 31400, "loss": 0.02219269567169249, "loss_real": 0.017547359080053865, "loss_synth": 0.021828132439404725, "lr": 0.00019095314121941266, "elapsed": 734.2219293320086, "steps_per_second": 43.58033835349551, "loss_extra": 0.02336274228990078} +{"step": 31600, "loss": 0.02226173285394907, "loss_real": 0.017322403048165142, "loss_synth": 0.021986547773703933, "lr": 0.0001875624149858636, "elapsed": 738.046694085002, "steps_per_second": 43.626333018341704, "loss_extra": 0.02339385519735515} +{"step": 31800, "loss": 0.02213616461493075, "loss_real": 0.017294005821458996, "loss_synth": 0.02176827982068062, "lr": 0.00018419039141996036, "elapsed": 741.8894884689944, "steps_per_second": 43.67076317003767, "loss_extra": 0.023343712482601406} +{"step": 32000, "loss": 0.02214569030329585, "loss_real": 0.01734538048505783, "loss_synth": 0.02184070541523397, "lr": 0.0001808376030033136, "elapsed": 745.7323452479905, "steps_per_second": 43.71472312746277, "loss_extra": 0.023283334309235217} +{"step": 32200, "loss": 0.022138675665482877, "loss_real": 0.01754116770811379, "loss_synth": 0.02173906458541751, "lr": 0.0001775045791800812, "elapsed": 749.5596193339443, "steps_per_second": 43.75915058466189, "loss_extra": 0.023335312390699983} +{"step": 32400, "loss": 0.02206393546424806, "loss_real": 0.017144285179674625, "loss_synth": 0.021743567176163197, "lr": 0.00017419184627336242, "elapsed": 753.4050340999383, "steps_per_second": 43.80204401765429, "loss_extra": 0.02323763061314821} +{"step": 32600, "loss": 0.021969728134572507, "loss_real": 0.01718062115367502, "loss_synth": 0.0215745260193944, "lr": 0.00017089992740208575, "elapsed": 757.2300795159535, "steps_per_second": 43.845694965341494, "loss_extra": 0.023195261117070914} +{"step": 32800, "loss": 0.021990708289667964, "loss_real": 0.017179041793569924, "loss_synth": 0.021635209089145065, "lr": 0.00016762934239840198, "elapsed": 761.0951562899863, "steps_per_second": 43.886548275902314, "loss_extra": 0.023180625485256314} +{"step": 33000, "loss": 0.021953772958368062, "loss_real": 0.01698579475749284, "loss_synth": 0.021615116642788052, "lr": 0.000164380607725597, "elapsed": 764.9959367970005, "steps_per_second": 43.92489366416409, "loss_extra": 0.023154074354097248} +{"step": 33200, "loss": 0.02194216389209032, "loss_real": 0.017188769010826947, "loss_synth": 0.021625875355675818, "lr": 0.00016115423639653619, "elapsed": 768.974046400981, "steps_per_second": 43.95834160466568, "loss_extra": 0.023082912936806678} +{"step": 33400, "loss": 0.022041001534089447, "loss_real": 0.017203486138023437, "loss_synth": 0.021646290756762027, "lr": 0.0001579507378926539, "elapsed": 772.8102929699235, "steps_per_second": 43.99966045342334, "loss_extra": 0.02327445473521948} +{"step": 33600, "loss": 0.021987692471593618, "loss_real": 0.017215178525075318, "loss_synth": 0.021654347851872445, "lr": 0.00015477061808349973, "elapsed": 776.67264793301, "steps_per_second": 44.039056664981466, "loss_extra": 0.023148747123777867} +{"step": 33800, "loss": 0.02203820738941431, "loss_real": 0.017155097713693977, "loss_synth": 0.021724751377478244, "lr": 0.0001516143791468568, "elapsed": 780.4953143009916, "steps_per_second": 44.08033748612055, "loss_extra": 0.023198671424761414} +{"step": 34000, "loss": 0.02188864404335618, "loss_real": 0.017087191669270398, "loss_synth": 0.021531929448246955, "lr": 0.00014848251948944142, "elapsed": 784.3291634810157, "steps_per_second": 44.12056848327341, "loss_extra": 0.023077997397631406} +{"step": 34200, "loss": 0.021903841560706495, "loss_real": 0.016908179000020028, "loss_synth": 0.021626124288886786, "lr": 0.00014537553366819925, "elapsed": 788.1639407739276, "steps_per_second": 44.16034823590401, "loss_extra": 0.02304827157407999} +{"step": 34400, "loss": 0.021896396270021795, "loss_real": 0.016990347132086754, "loss_synth": 0.021559897270053627, "lr": 0.0001422939123122089, "elapsed": 792.0120053580031, "steps_per_second": 44.19898139241765, "loss_extra": 0.023083791229873897} +{"step": 34600, "loss": 0.021879608603194357, "loss_real": 0.01719595950562507, "loss_synth": 0.021495251376181843, "lr": 0.00013923814204520548, "elapsed": 795.8887043609284, "steps_per_second": 44.235614930117, "loss_extra": 0.023076021447777748} +{"step": 34800, "loss": 0.021799236061051486, "loss_real": 0.016997353383339943, "loss_synth": 0.021400609398260714, "lr": 0.00013620870540873793, "elapsed": 799.7288548719371, "steps_per_second": 44.273945722096876, "loss_extra": 0.023030398562550545} +{"step": 35000, "loss": 0.021805860642343758, "loss_real": 0.016878992323763668, "loss_synth": 0.021484112292528154, "lr": 0.00013320608078596944, "elapsed": 803.5862779460149, "steps_per_second": 44.31093479210024, "loss_extra": 0.022982183871790768} +{"step": 35200, "loss": 0.021753819324076176, "loss_real": 0.017068417971022428, "loss_synth": 0.021410940010100604, "lr": 0.00013023074232613552, "elapsed": 808.1980577409267, "steps_per_second": 44.305456689316806, "loss_extra": 0.022909234259277583} +{"step": 35400, "loss": 0.021696792459115388, "loss_real": 0.01666477155406028, "loss_synth": 0.021389775732532142, "lr": 0.0001272831598696703, "elapsed": 812.0562192879152, "steps_per_second": 44.34186008562627, "loss_extra": 0.02287671466358006} +{"step": 35600, "loss": 0.021760470382869244, "loss_real": 0.017086164182983338, "loss_synth": 0.02141479391604662, "lr": 0.00012436379887401295, "elapsed": 815.887153750984, "steps_per_second": 44.37941958721782, "loss_extra": 0.02291674313135445} +{"step": 35800, "loss": 0.021793565098196268, "loss_real": 0.017012209463864565, "loss_synth": 0.021417748732492328, "lr": 0.00012147312034010696, "elapsed": 819.7676520579262, "steps_per_second": 44.413890883603365, "loss_extra": 0.022998447492718697} +{"step": 36000, "loss": 0.021670099841430784, "loss_real": 0.016797959986142814, "loss_synth": 0.021290058661252262, "lr": 0.00011861158073960271, "elapsed": 823.5943391890032, "steps_per_second": 44.450985155953184, "loss_extra": 0.022894960762932896} +{"step": 36200, "loss": 0.02168063087388873, "loss_real": 0.0168863316019997, "loss_synth": 0.021331055844202636, "lr": 0.00011577963194277514, "elapsed": 827.4524781849468, "steps_per_second": 44.48601103246377, "loss_extra": 0.022861631773412227} +{"step": 36400, "loss": 0.02163251885212958, "loss_real": 0.01688809860497713, "loss_synth": 0.02125866395421326, "lr": 0.0001129777211471684, "elapsed": 831.2763112349203, "steps_per_second": 44.52257448836491, "loss_extra": 0.02282903133891523} +{"step": 36600, "loss": 0.0216283789370209, "loss_real": 0.016437004692852496, "loss_synth": 0.021366944843903182, "lr": 0.00011020629080697766, "elapsed": 835.1194682429777, "steps_per_second": 44.55774905572284, "loss_extra": 0.02279059587046504} +{"step": 36800, "loss": 0.02154172428883612, "loss_real": 0.016542818336747585, "loss_synth": 0.021194309880957007, "lr": 0.00010746577856318116, "elapsed": 838.9965750089614, "steps_per_second": 44.59076196969621, "loss_extra": 0.022756120106205344} +{"step": 37000, "loss": 0.0216486488096416, "loss_real": 0.01693169194739312, "loss_synth": 0.02125191882252693, "lr": 0.00010475661717443124, "elapsed": 843.0232850379543, "steps_per_second": 44.615416107220085, "loss_extra": 0.022863168166950346} +{"step": 37200, "loss": 0.021654265010729434, "loss_real": 0.01675821560434997, "loss_synth": 0.021314214365556836, "lr": 0.00010207923444871681, "elapsed": 847.06571721402, "steps_per_second": 44.63898985295681, "loss_extra": 0.022843459201976658} +{"step": 37400, "loss": 0.021592948185279966, "loss_real": 0.01678418686147779, "loss_synth": 0.0212743466347456, "lr": 9.94340531758075e-05, "elapsed": 850.9785495959222, "steps_per_second": 44.66924922430495, "loss_extra": 0.02274561910890043} +{"step": 37600, "loss": 0.02158737590536475, "loss_real": 0.016618287032470105, "loss_synth": 0.021275127464905383, "lr": 9.682149106049004e-05, "elapsed": 854.8776104929857, "steps_per_second": 44.69995890245531, "loss_extra": 0.02276157441549003} +{"step": 37800, "loss": 0.02161001330241561, "loss_real": 0.01671357437502593, "loss_synth": 0.021236225226894022, "lr": 9.424196065660837e-05, "elapsed": 858.8865529629402, "steps_per_second": 44.72456973913831, "loss_extra": 0.022832869635894894} +{"step": 38000, "loss": 0.02156256780959666, "loss_real": 0.016741483784280718, "loss_synth": 0.021188365891575814, "lr": 9.169586930191606e-05, "elapsed": 862.7865207919385, "steps_per_second": 44.7546915706763, "loss_extra": 0.022772744549438357} +{"step": 38200, "loss": 0.021521543497219683, "loss_real": 0.016404156894423066, "loss_synth": 0.021112797250971198, "lr": 8.91836190537533e-05, "elapsed": 866.6919212390203, "steps_per_second": 44.78425268007154, "loss_extra": 0.02281759469769895} +{"step": 38400, "loss": 0.02150515330955386, "loss_real": 0.016648187800310552, "loss_synth": 0.021172484681010247, "lr": 8.670560662555727e-05, "elapsed": 870.6372903039446, "steps_per_second": 44.81145417691517, "loss_extra": 0.022680206643417477} +{"step": 38600, "loss": 0.02145904459990561, "loss_real": 0.016437947349622846, "loss_synth": 0.021078653056174516, "lr": 8.426222332421624e-05, "elapsed": 874.5100855339551, "steps_per_second": 44.84218666939153, "loss_extra": 0.022710133008658887} +{"step": 38800, "loss": 0.02143812892027199, "loss_real": 0.016291913501918318, "loss_synth": 0.02117496045306325, "lr": 8.185385498827815e-05, "elapsed": 878.4367959309602, "steps_per_second": 44.86984605026748, "loss_extra": 0.022594227092340588} +{"step": 39000, "loss": 0.02151766468770802, "loss_real": 0.01652707059402019, "loss_synth": 0.021175666181370616, "lr": 7.948088192702195e-05, "elapsed": 882.3475970029831, "steps_per_second": 44.8980776914085, "loss_extra": 0.022725223312154413} +{"step": 39200, "loss": 0.02139514982700348, "loss_real": 0.016636798735708, "loss_synth": 0.021034467918798327, "lr": 7.714367886040248e-05, "elapsed": 886.2788646569243, "steps_per_second": 44.925002483979334, "loss_extra": 0.02258096537552774} +{"step": 39400, "loss": 0.021344385081902145, "loss_real": 0.016533237220719456, "loss_synth": 0.021008275309577586, "lr": 7.48426148598775e-05, "elapsed": 890.1824364499189, "steps_per_second": 44.95310618332122, "loss_extra": 0.02251490507274866} +{"step": 39600, "loss": 0.021411530962213873, "loss_real": 0.016433067373000085, "loss_synth": 0.021124375518411398, "lr": 7.25780532901276e-05, "elapsed": 894.101525328937, "steps_per_second": 44.98016785690565, "loss_extra": 0.022562371417880058} +{"step": 39800, "loss": 0.02138649922795594, "loss_real": 0.01625647047534585, "loss_synth": 0.021028645662590863, "lr": 7.035035175167622e-05, "elapsed": 898.0203617840307, "steps_per_second": 45.0070024227926, "loss_extra": 0.022634069034829736} +{"step": 40000, "loss": 0.021419632090255616, "loss_real": 0.016554880500771106, "loss_synth": 0.021103670177981256, "lr": 6.81598620244206e-05, "elapsed": 901.9227039329708, "steps_per_second": 45.03443666305509, "loss_extra": 0.022579402085393666} +{"step": 40200, "loss": 0.021408044435083866, "loss_real": 0.016583053590729833, "loss_synth": 0.02107385255396366, "lr": 6.600693001208181e-05, "elapsed": 918.4763540179702, "steps_per_second": 44.4315336075125, "loss_extra": 0.02257905960083008} +{"step": 40400, "loss": 0.021337170517072082, "loss_real": 0.016730248075909913, "loss_synth": 0.020954181402921677, "lr": 6.38918956875819e-05, "elapsed": 922.4548924450064, "steps_per_second": 44.45709361352883, "loss_extra": 0.022518891384825112} +{"step": 40600, "loss": 0.02136356195434928, "loss_real": 0.016506521780975163, "loss_synth": 0.02103430506773293, "lr": 6.181509303935915e-05, "elapsed": 926.4044905370101, "steps_per_second": 44.483841258825066, "loss_extra": 0.022535230731591582} +{"step": 40800, "loss": 0.02135135294869542, "loss_real": 0.016389589882455768, "loss_synth": 0.020981857357546686, "lr": 5.977685001862671e-05, "elapsed": 930.3829836000223, "steps_per_second": 44.50895539959898, "loss_extra": 0.022581283021718263} +{"step": 41000, "loss": 0.02134794351644814, "loss_real": 0.01652799766510725, "loss_synth": 0.020886513870209455, "lr": 5.7777488487585654e-05, "elapsed": 934.3328267959878, "steps_per_second": 44.53523836039687, "loss_extra": 0.022644780771806837} +{"step": 41200, "loss": 0.02133992940187454, "loss_real": 0.016145117711275817, "loss_synth": 0.020926062054932117, "lr": 5.581732416859908e-05, "elapsed": 938.265304564964, "steps_per_second": 44.56213372987838, "loss_extra": 0.02265453092753887} +{"step": 41400, "loss": 0.021330625396221877, "loss_real": 0.01631933859549463, "loss_synth": 0.020975385122001172, "lr": 5.3896666594335835e-05, "elapsed": 942.3308985399781, "steps_per_second": 44.58240950242838, "loss_extra": 0.022554964451119305} +{"step": 41600, "loss": 0.02123041743412614, "loss_real": 0.016318598790094258, "loss_synth": 0.020970074599608778, "lr": 5.20158190588919e-05, "elapsed": 946.3757555889897, "steps_per_second": 44.60350026352479, "loss_extra": 0.022342980811372398} +{"step": 41800, "loss": 0.021226671608164906, "loss_real": 0.016263992204330863, "loss_synth": 0.020889302706345914, "lr": 5.017507856989665e-05, "elapsed": 950.3891060069436, "steps_per_second": 44.62590985572713, "loss_extra": 0.022424770798534156} +{"step": 42000, "loss": 0.02128495725803077, "loss_real": 0.01633338734973222, "loss_synth": 0.020986713636666536, "lr": 4.837473580161169e-05, "elapsed": 954.313401066931, "steps_per_second": 44.65235547401251, "loss_extra": 0.022442167066037653} +{"step": 42200, "loss": 0.021330084912478925, "loss_real": 0.01629144265782088, "loss_synth": 0.021017523175105454, "lr": 4.6615075049030575e-05, "elapsed": 958.2881192429923, "steps_per_second": 44.67619635076084, "loss_extra": 0.022516679083928466} +{"step": 42400, "loss": 0.021256956569850445, "loss_real": 0.016146907610818745, "loss_synth": 0.0208693927526474, "lr": 4.489637418298455e-05, "elapsed": 962.2026433759602, "steps_per_second": 44.70267415181411, "loss_extra": 0.022530640233308075} +{"step": 42600, "loss": 0.021269979840144514, "loss_real": 0.016231868197210134, "loss_synth": 0.020902053201571107, "lr": 4.321890460626433e-05, "elapsed": 966.163912422955, "steps_per_second": 44.72673916215068, "loss_extra": 0.022511611850932242} +{"step": 42800, "loss": 0.02128249774686992, "loss_real": 0.016393397483043373, "loss_synth": 0.02096388392150402, "lr": 4.158293121076186e-05, "elapsed": 970.0675039789639, "steps_per_second": 44.75330368251283, "loss_extra": 0.02244913825765252} +{"step": 43000, "loss": 0.021248346138745548, "loss_real": 0.016352905249223112, "loss_synth": 0.02086008503101766, "lr": 3.99887123356411e-05, "elapsed": 973.9818706660299, "steps_per_second": 44.77914974982768, "loss_extra": 0.02248544055968523} +{"step": 43200, "loss": 0.021216882020235063, "loss_real": 0.016227019000798464, "loss_synth": 0.020861726384609938, "lr": 3.843649972654328e-05, "elapsed": 977.9100147199351, "steps_per_second": 44.80414565351189, "loss_extra": 0.02243741516023874} +{"step": 43400, "loss": 0.021134889917448163, "loss_real": 0.016208991054445506, "loss_synth": 0.02087522456422448, "lr": 3.69265384958331e-05, "elapsed": 981.8088093849365, "steps_per_second": 44.83029795701573, "loss_extra": 0.022249224931001663} +{"step": 43600, "loss": 0.021169775826856495, "loss_real": 0.01602640527766198, "loss_synth": 0.02081508223898709, "lr": 3.545906708389291e-05, "elapsed": 985.8130106040044, "steps_per_second": 44.851376487247826, "loss_extra": 0.022416517417877913} +{"step": 43800, "loss": 0.02122812264598906, "loss_real": 0.016240992243401708, "loss_synth": 0.02085075666196644, "lr": 3.403431722147019e-05, "elapsed": 989.759456109954, "steps_per_second": 44.8749373740939, "loss_extra": 0.02247029708698392} +{"step": 44000, "loss": 0.02126693899743259, "loss_real": 0.016595488390885295, "loss_synth": 0.020864810226485134, "lr": 3.265251389308442e-05, "elapsed": 993.7345363110071, "steps_per_second": 44.896996636133586, "loss_extra": 0.022478928435593844} +{"step": 44200, "loss": 0.021240107957273723, "loss_real": 0.01618594678118825, "loss_synth": 0.020891320519149305, "lr": 3.1313875301499545e-05, "elapsed": 997.6923748339759, "steps_per_second": 44.919664732035194, "loss_extra": 0.02246546981856227} +{"step": 44400, "loss": 0.021190541638061403, "loss_real": 0.016208645575679838, "loss_synth": 0.020896082948893308, "lr": 3.0018612833267117e-05, "elapsed": 1001.6902940209256, "steps_per_second": 44.9403279933957, "loss_extra": 0.022349250772967934} +{"step": 44600, "loss": 0.021124132601544263, "loss_real": 0.016136127104982734, "loss_synth": 0.020713528851047158, "lr": 2.8766931025346027e-05, "elapsed": 1005.636554711964, "steps_per_second": 44.963166205920736, "loss_extra": 0.022399555779993533} +{"step": 44800, "loss": 0.02111143630929291, "loss_real": 0.016201694044284523, "loss_synth": 0.020760456966236233, "lr": 2.755902753280375e-05, "elapsed": 1009.5796402050182, "steps_per_second": 44.98596685524974, "loss_extra": 0.022313891435042022} +{"step": 45000, "loss": 0.021144604431465267, "loss_real": 0.01614566314034164, "loss_synth": 0.020760457776486874, "lr": 2.639509309760422e-05, "elapsed": 1013.5405881019542, "steps_per_second": 45.007783558769006, "loss_extra": 0.022395582823082804} +{"step": 45200, "loss": 0.021129296533763407, "loss_real": 0.016105300267226993, "loss_synth": 0.020796628603711724, "lr": 2.5275311518487436e-05, "elapsed": 1018.336351512, "steps_per_second": 44.99200977842532, "loss_extra": 0.02233336716890335} +{"step": 45400, "loss": 0.021159644294530152, "loss_real": 0.01601193392649293, "loss_synth": 0.020860808016732336, "lr": 2.4199859621945708e-05, "elapsed": 1022.3003313529771, "steps_per_second": 45.01347802396327, "loss_extra": 0.02235151925124228} +{"step": 45600, "loss": 0.021100428113713862, "loss_real": 0.016208297722041607, "loss_synth": 0.020731376381590963, "lr": 2.316890723430054e-05, "elapsed": 1026.2105205230182, "steps_per_second": 45.03717073040086, "loss_extra": 0.022317819511517883} +{"step": 45800, "loss": 0.02111146638169885, "loss_real": 0.016259772200137378, "loss_synth": 0.020719254743307828, "lr": 2.218261715488513e-05, "elapsed": 1030.1565657779574, "steps_per_second": 45.05909156450234, "loss_extra": 0.02234489453025162} +{"step": 46000, "loss": 0.021168171912431717, "loss_real": 0.016031522238627076, "loss_synth": 0.02084780248813331, "lr": 2.1241145130336496e-05, "elapsed": 1034.0498337820172, "steps_per_second": 45.08317467769379, "loss_extra": 0.022379567064344883} +{"step": 46200, "loss": 0.021053804559633137, "loss_real": 0.016049111038446428, "loss_synth": 0.020738069210201503, "lr": 2.0344639830001105e-05, "elapsed": 1037.9747099980013, "steps_per_second": 45.10568273364625, "loss_extra": 0.022237660717219113} +{"step": 46400, "loss": 0.02109212279319763, "loss_real": 0.01588298752438277, "loss_synth": 0.020731346001848578, "lr": 1.949324282245851e-05, "elapsed": 1041.8610211919295, "steps_per_second": 45.129711660146505, "loss_extra": 0.022356346929445863} +{"step": 46600, "loss": 0.02102754740975797, "loss_real": 0.01598128433339298, "loss_synth": 0.02069527568295598, "lr": 1.8687088553165976e-05, "elapsed": 1045.785540606943, "steps_per_second": 45.15188799605675, "loss_extra": 0.02223509198985994} +{"step": 46800, "loss": 0.021067246440798045, "loss_real": 0.01596059467177838, "loss_synth": 0.020812647091224788, "lr": 1.7926304323227836e-05, "elapsed": 1049.6695313479286, "steps_per_second": 45.17566350792781, "loss_extra": 0.022207938889041542} +{"step": 47000, "loss": 0.02111078502610326, "loss_real": 0.015876297266222538, "loss_synth": 0.020774764623492956, "lr": 1.721101026929328e-05, "elapsed": 1053.5852162269875, "steps_per_second": 45.197883973459106, "loss_extra": 0.0223547625541687} +{"step": 47200, "loss": 0.021051979772746563, "loss_real": 0.015980297406204044, "loss_synth": 0.020607229275628924, "lr": 1.6541319344585365e-05, "elapsed": 1057.5286612589844, "steps_per_second": 45.21873501534428, "loss_extra": 0.022375942347571252} +{"step": 47400, "loss": 0.0210845934972167, "loss_real": 0.016264285370707513, "loss_synth": 0.020782720679417253, "lr": 1.5917337301064426e-05, "elapsed": 1061.4644201450283, "steps_per_second": 45.23976096677537, "loss_extra": 0.022222612649202347} +{"step": 47600, "loss": 0.02106154737062752, "loss_real": 0.015917382268235088, "loss_synth": 0.020803749561309814, "lr": 1.533916267272854e-05, "elapsed": 1065.398021389963, "steps_per_second": 45.260722400302534, "loss_extra": 0.022211941750720145} +{"step": 47800, "loss": 0.02110618987120688, "loss_real": 0.0161901766853407, "loss_synth": 0.020781250474974512, "lr": 1.480688676005397e-05, "elapsed": 1069.305109023, "steps_per_second": 45.28266497669389, "loss_extra": 0.022283805049955845} +{"step": 48000, "loss": 0.021125618498772383, "loss_real": 0.01643323219381273, "loss_synth": 0.02075999930500984, "lr": 1.432059361557764e-05, "elapsed": 1073.2175669759745, "steps_per_second": 45.304216067598055, "loss_extra": 0.022304890202358364} +{"step": 48200, "loss": 0.021113828951492906, "loss_real": 0.015816732947714626, "loss_synth": 0.020821148129180074, "lr": 1.3880360030624374e-05, "elapsed": 1077.134496559971, "steps_per_second": 45.325418002715566, "loss_extra": 0.02232552716508508} +{"step": 48400, "loss": 0.021054048836231232, "loss_real": 0.01619534400757402, "loss_synth": 0.02070956508629024, "lr": 1.3486255523180529e-05, "elapsed": 1081.0539397440152, "steps_per_second": 45.34635748695286, "loss_extra": 0.022241169475018977} +{"step": 48600, "loss": 0.021106790704652666, "loss_real": 0.016043273475952448, "loss_synth": 0.020775184612721206, "lr": 1.313834232691649e-05, "elapsed": 1084.9804219389334, "steps_per_second": 45.36684571661696, "loss_extra": 0.02231666984036565} +{"step": 48800, "loss": 0.021082131760194897, "loss_real": 0.016164222909137608, "loss_synth": 0.020649138642475008, "lr": 1.2836675381359077e-05, "elapsed": 1088.8906208679546, "steps_per_second": 45.38787167182053, "loss_extra": 0.022367671970278023} +{"step": 49000, "loss": 0.02108605418354273, "loss_real": 0.01608533632941544, "loss_synth": 0.020784539822489023, "lr": 1.2581302323216026e-05, "elapsed": 1092.8066669849213, "steps_per_second": 45.40849916609073, "loss_extra": 0.02225505909882486} +{"step": 49200, "loss": 0.021013448908925057, "loss_real": 0.015938451569527386, "loss_synth": 0.020602800901979208, "lr": 1.2372263478853567e-05, "elapsed": 1096.7189478420187, "steps_per_second": 45.42913539841008, "loss_extra": 0.02230402919463813} +{"step": 49400, "loss": 0.02104406327009201, "loss_real": 0.01592557620257139, "loss_synth": 0.020747159775346517, "lr": 1.2209591857928498e-05, "elapsed": 1100.6253106530057, "steps_per_second": 45.449870635626006, "loss_extra": 0.02222893658094108} +{"step": 49600, "loss": 0.021065548816695808, "loss_real": 0.016062015127390625, "loss_synth": 0.020752606699243187, "lr": 1.2093313148175555e-05, "elapsed": 1104.5374903109623, "steps_per_second": 45.470214840186394, "loss_extra": 0.02224642221815884} +{"step": 49800, "loss": 0.021088658012449742, "loss_real": 0.015966391349211337, "loss_synth": 0.020658125802874565, "lr": 1.2023445711350887e-05, "elapsed": 1108.4626444979804, "steps_per_second": 45.48987448462291, "loss_extra": 0.02240725059993565} +{"step": 50000, "loss": 0.02101379981264472, "loss_real": 0.016015909104607998, "loss_synth": 0.020687552569434046, "lr": 1.2000000580332747e-05, "elapsed": 1112.3871025079861, "steps_per_second": 45.509422436415825, "loss_extra": 0.022206941712647678} diff --git a/shared/package-files/b4/b4afb69e1c4711dc48c45cea0092335bb2ff2e01a9d0fef45b1a6f5f37e3de08/model_manifest.json b/shared/package-files/b4/b4afb69e1c4711dc48c45cea0092335bb2ff2e01a9d0fef45b1a6f5f37e3de08/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..9e811670de5a539cd78ec5e70dff0e17b9f2abbb --- /dev/null +++ b/shared/package-files/b4/b4afb69e1c4711dc48c45cea0092335bb2ff2e01a9d0fef45b1a6f5f37e3de08/model_manifest.json @@ -0,0 +1,13 @@ +{ + "schema": "massspecgym-retrieval-model/v1", + "checkpoint": { + "path": "model.pt", + "sha256": "851614f27cf38c4f56ace24768eacd25a9bc5b4416f7da65d58359d285af8b1f", + "format": "pytorch" + }, + "model_config": "model_config.json", + "training_provenance": { + "data": "MassSpecGym v1.5 train fold", + "pretrained_assets": [] + } +} diff --git a/shared/package-files/b7/b74c28a0e8ae91cc03f5fb38ef7ec75ee60f5a44a55c4351f9ee69a80063203b/build-5Ms-I9b+I13-L-ion-net.log b/shared/package-files/b7/b74c28a0e8ae91cc03f5fb38ef7ec75ee60f5a44a55c4351f9ee69a80063203b/build-5Ms-I9b+I13-L-ion-net.log new file mode 100644 index 0000000000000000000000000000000000000000..cb75579d7651e82ea1fe8b8f53616d9bbb848275 --- /dev/null +++ b/shared/package-files/b7/b74c28a0e8ae91cc03f5fb38ef7ec75ee60f5a44a55c4351f9ee69a80063203b/build-5Ms-I9b+I13-L-ion-net.log @@ -0,0 +1,625 @@ +{ + "built": "/run-state/workspace/research/builds/5Ms-I9b+I13-L-ion-net", + "checkpoint_sha256": "7d474babce9102814c0f5d4064f9936e8754fecf6f5bc10abc7910c5ce5f1c09", + "members": [ + { + "source": "runs/B-all-b32/checkpoints/step-0020000-ema.ckpt", + "sha256": "80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 5136.2172065590275, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B-all-b32/checkpoints/step-0030000-ema.ckpt", + "sha256": "0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8314.79353913304, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0020000-ema.ckpt", + "sha256": "ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 6945.18486677701, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0030000-ema.ckpt", + "sha256": "f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 9298.063542745003, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/S2-B20k-synth/checkpoints/step-0030000-ema.ckpt", + "sha256": "44742fa31f337e59b543d903018780560569c2e8e50a008ba008859c8440e3a2", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8906.84206694903, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "own-checkpoint:6c5a43fada335e5f4e9f8265ec6cfd54a8f317eb8d2100d96ea3731809005be2", + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus (auxiliary intensity term)", + "synthetic": { + "manifest_sha256": "431454e702f8da3194684fc9a565135d29a38a407aaa31e9399d871360c6e962", + "per_item": 1, + "weight": 1.0, + "schedule": "e2e", + "instrument": "flag" + } + } + ], + "config": { + "sparse_k": 100, + "inference_batch_size": 128, + "workers": 14, + "num_bins": 150000, + "upper_limit": 1500, + "max_observed_peaks": 50, + "observed_intensity_threshold": 0.001, + "ensemble": "prediction", + "pool_aggregation": 1.0, + "autocast": false, + "model": { + "pe_embed_k": 14, + "embed_elem_group": true, + "multi_hop_max_dist": 10 + }, + "checkpoint": "model.pt", + "views": [ + { + "precursor_window": 0.5, + "pred_power": 0.75, + "match_ppm": 20, + "match_floor_mda": 4, + "match_by_instrument": { + "Orbitrap": [ + 10, + 1 + ] + } + } + ], + "inverse": { + "pooled": true, + "score": { + "members": "probability", + "power": 0.7 + }, + "weight_domain": 0.75, + "weight_other": 0.05, + "weight_other_single": 0.5, + "batch": 2048 + }, + "library": { + "kind": "sum", + "k": 20, + "top": 32, + "power": 6, + "debias": true, + "weight_domain": 0.0, + "weight_other": 0.4, + "weight_other_single": 0.0 + }, + "ion": { + "weight_domain": 0.05, + "weight_other": 0.01 + }, + "consensus": { + "k": 10, + "top": 32, + "power": 3.0, + "answers": 10, + "temperature": 0.02, + "absorb": 0.5, + "bin": 0.01, + "weight_domain": 1.0, + "weight_other": 1.0 + }, + "inverse_members": [ + { + "source": "runs/I9b-ff512x6-real08-corpus2+train3/step-0050000-ema.pt", + "sha256": "f2741a9676a4743fa586d3effe8753d6eade9356fb2ceac8055ff50baf34195f", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus + spectra of the corpus structures simulated by our own train-fold-trained GLACIER forward members (self-simulation, E60)", + "self_simulated_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + }, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "runs/I9b-ff512x6-real08-corpus2+train3", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "init": null, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I13-ff512x6-real08-corpus2+train3-seed2/step-0050000-ema.pt", + "sha256": "bd0f9c965cf7e0101877c780d9f3592e6fc07b4b20cdfc35adb9f60e3aa295a7", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 2, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus + spectra of the corpus structures simulated by our own train-fold-trained GLACIER forward members (self-simulation, E60)", + "self_simulated_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + }, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "runs/I13-ff512x6-real08-corpus2+train3-seed2", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 2, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "init": null, + "max_steps_this_run": 0 + } + } + ], + "library_asset": { + "schema": "train-library/v1", + "fold": "train", + "spectra": 194119, + "molecules": 25046, + "bin": 0.01, + "prior_sample": 1024, + "prior_seed": 0, + "fragment_entries": 6765621, + "loss_entries": 6763777, + "source": "/workspace/data/train.jsonl", + "source_sha256": "de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc", + "structure_store": "/run-state/workspace/research/inv/real-train.npz", + "structure_store_sha256": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "sha256": "22d1ddb216eef78d5040209ff6526371e5fcd8aac88e68a36823b6d5e73b3712", + "elapsed_seconds": 13.499361125999712, + "training_data": "MassSpecGym v1.5 train fold" + }, + "ion_asset": { + "source": "inv/ion_error_table.json", + "sha256": "39aca3a714fd25a20cbaba4d46942764b52d730828a4b8205bf46ac5fc2a6225", + "fit": "MassSpecGym v1.5 train fold (194,119 spectra with [M+H]+ / [M+Na]+), analysis/ion_fit.py", + "training_data": "MassSpecGym v1.5 train fold", + "window_da": 0.02, + "classes": { + "domain|Orbitrap": { + "median_ppm": 0.358, + "sigma_ppm": 1.51, + "background": 0.0204 + }, + "domain|QTOF": { + "median_ppm": 0.027, + "sigma_ppm": 4.348, + "background": 0.0869 + }, + "domain|other": { + "median_ppm": 0.027, + "sigma_ppm": 4.348, + "background": 0.0869 + }, + "H-no-energy|Orbitrap": { + "median_ppm": -0.943, + "sigma_ppm": 2.937, + "background": 0.1196 + }, + "H-no-energy|QTOF": { + "median_ppm": 0.665, + "sigma_ppm": 4.58, + "background": 0.08 + }, + "H-no-energy|other": { + "median_ppm": 0.851, + "sigma_ppm": 4.269, + "background": 0.1021 + }, + "Na|Orbitrap": { + "median_ppm": -0.872, + "sigma_ppm": 2.935, + "background": 0.1834 + }, + "Na|QTOF": { + "median_ppm": 1.119, + "sigma_ppm": 4.103, + "background": 0.0798 + }, + "Na|other": { + "median_ppm": 3.003, + "sigma_ppm": 2.969, + "background": 0.0319 + } + }, + "fallback": { + "domain|other": "domain|QTOF" + }, + "train_fold_statistics": { + "domain|Orbitrap": { + "spectra": 64738, + "present": 0.5068, + "median_ppm": 0.176, + "sigma_ppm": 1.093, + "beyond_3_sigma": 0.0763, + "ml_median_ppm": 0.358, + "ml_sigma_ppm": 1.51, + "ml_background": 0.0204, + "ml_mean_log_density": 6.2307 + }, + "domain|QTOF": { + "spectra": 34603, + "present": 0.5111, + "median_ppm": 0.045, + "sigma_ppm": 3.847, + "beyond_3_sigma": 0.0914, + "ml_median_ppm": 0.027, + "ml_sigma_ppm": 4.348, + "ml_background": 0.0869, + "ml_mean_log_density": 4.9233 + }, + "domain|other": { + "spectra": 36, + "present": 0.8611, + "median_ppm": 2.185, + "sigma_ppm": 4.203, + "beyond_3_sigma": 0.0, + "ml_median_ppm": 2.789, + "ml_sigma_ppm": 3.688, + "ml_background": 0.0, + "ml_mean_log_density": 5.6271 + }, + "H-no-energy|Orbitrap": { + "spectra": 51704, + "present": 0.5479, + "median_ppm": -0.989, + "sigma_ppm": 2.647, + "beyond_3_sigma": 0.1156, + "ml_median_ppm": -0.943, + "ml_sigma_ppm": 2.937, + "ml_background": 0.1196, + "ml_mean_log_density": 5.0128 + }, + "H-no-energy|QTOF": { + "spectra": 11931, + "present": 0.626, + "median_ppm": 0.801, + "sigma_ppm": 4.239, + "beyond_3_sigma": 0.0754, + "ml_median_ppm": 0.665, + "ml_sigma_ppm": 4.58, + "ml_background": 0.08, + "ml_mean_log_density": 4.7319 + }, + "H-no-energy|other": { + "spectra": 3467, + "present": 0.67, + "median_ppm": 0.61, + "sigma_ppm": 4.033, + "beyond_3_sigma": 0.0895, + "ml_median_ppm": 0.851, + "ml_sigma_ppm": 4.269, + "ml_background": 0.1021, + "ml_mean_log_density": 4.7426 + }, + "Na|Orbitrap": { + "spectra": 24454, + "present": 0.4954, + "median_ppm": -0.875, + "sigma_ppm": 2.797, + "beyond_3_sigma": 0.1574, + "ml_median_ppm": -0.872, + "ml_sigma_ppm": 2.935, + "ml_background": 0.1834, + "ml_mean_log_density": 4.589 + }, + "Na|QTOF": { + "spectra": 2361, + "present": 0.8602, + "median_ppm": 1.126, + "sigma_ppm": 4.211, + "beyond_3_sigma": 0.0551, + "ml_median_ppm": 1.119, + "ml_sigma_ppm": 4.103, + "ml_background": 0.0798, + "ml_mean_log_density": 4.5016 + }, + "Na|other": { + "spectra": 825, + "present": 0.9309, + "median_ppm": 3.305, + "sigma_ppm": 3.261, + "beyond_3_sigma": 0.026, + "ml_median_ppm": 3.003, + "ml_sigma_ppm": 2.969, + "ml_background": 0.0319, + "ml_mean_log_density": 4.9698 + } + } + }, + "method": "native-glacier-all-conditions-forward-simulation+formula-transformer-inverse-fusion+train-library-neighbour-fusion+measured-intact-ion-term+cross-pool-consensus", + "inference_runtime": "/opt/glacier/bin/python" + } +} diff --git a/shared/package-files/b7/b7a7bf5269c888bac6af0d86d37f2cb0e7b4aade41e09cba5a90e93959b3daf2/matched-S2-30k-full.log b/shared/package-files/b7/b7a7bf5269c888bac6af0d86d37f2cb0e7b4aade41e09cba5a90e93959b3daf2/matched-S2-30k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..e013b334adf9204794943238f864dd906b8df462 --- /dev/null +++ b/shared/package-files/b7/b7a7bf5269c888bac6af0d86d37f2cb0e7b4aade41e09cba5a90e93959b3daf2/matched-S2-30k-full.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 76.31578311701014} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 79.95859457700863} +ind meanD all=0.4910 dom=0.7333 non=0.2477 h5=0.6415 h20=0.7152 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6224 dom=0.8065 non=0.4375 h5=0.8304 h20=0.9079 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.4910 dom=0.7333 non=0.2477 h5=0.6415 h20=0.7152 | diff=+0.0000 [+0.0000,+0.0000] +agg Dmean all=0.6224 dom=0.8065 non=0.4375 h5=0.8304 h20=0.9079 | diff=+0.0000 [+0.0000,+0.0000] +ind gmean all=0.4910 dom=0.7333 non=0.2477 h5=0.6415 h20=0.7152 | diff=+0.0000 [+0.0000,+0.0000] +agg gmean all=0.6224 dom=0.8065 non=0.4375 h5=0.8304 h20=0.9079 | diff=+0.0000 [+0.0000,+0.0000] diff --git a/shared/package-files/b7/b7bbeccb21c0d9940926c0a7a3e4ddc071f1e510912b0e9c8c8ff95e58267bf2/gen-overlap-lm-a.log b/shared/package-files/b7/b7bbeccb21c0d9940926c0a7a3e4ddc071f1e510912b0e9c8c8ff95e58267bf2/gen-overlap-lm-a.log new file mode 100644 index 0000000000000000000000000000000000000000..a3fa510af343a575df68445dd1eb76624c1391a8 --- /dev/null +++ b/shared/package-files/b7/b7bbeccb21c0d9940926c0a7a3e4ddc071f1e510912b0e9c8c8ff95e58267bf2/gen-overlap-lm-a.log @@ -0,0 +1,5 @@ +515931 finished draws, 477107 distinct valid 2D structures +(a) fitted supplied structures: 9119 structures, among the draws 0.0737, among the supplied structures 1.0000, among the draws but not supplied 0.0000 +(b) held-out supplied structures: 9119 structures, among the draws 0.0395, among the supplied structures 1.0000, among the draws but not supplied 0.0000 +(c) validation labels: 3386 structures, among the draws 0.3683, among the supplied structures 0.0000, among the draws but not supplied 0.3683 | below 850: 0.3795, above 850: 0.2155 +(d) validation candidates, not the label: 67720 structures, among the draws 0.0044, among the supplied structures 0.0213, among the draws but not supplied 0.0024 diff --git a/shared/package-files/b7/b7e02578e6506c51885b95f6c22396f0429d2af2ab8d069e2e7611d52176109c/knn_branch.py b/shared/package-files/b7/b7e02578e6506c51885b95f6c22396f0429d2af2ab8d069e2e7611d52176109c/knn_branch.py new file mode 100644 index 0000000000000000000000000000000000000000..37be3a97e8cc9178bab1a2a8bd713cf989c1e220 --- /dev/null +++ b/shared/package-files/b7/b7e02578e6506c51885b95f6c22396f0429d2af2ab8d069e2e7611d52176109c/knn_branch.py @@ -0,0 +1,278 @@ +"""Library-neighbour branch (lab): structure evidence transferred from the most similar TRAIN spectra. + +knn_branch.py neighbours OUT.npz [--bin 0.01] [--top 32] [--chunk 400] +knn_branch.py evaluate NEIGH.npz [--modes norm,raw,debias,rawdebias] [--fuse KIND:K:P:MODE,...] [--weights UD/UN,...] [--shuffle SEED] [--save OUT.pkl --save-config KIND:K:P:MODE] + +Hypothesis (E48): a query spectrum resembles train-fold spectra of structurally related molecules +(same scaffold / compound class), also where both learned branches fail (few peaks, no recorded +energy). For every query the K most similar train molecules are found by spectral similarity +(fragment cosine, neutral-loss cosine, or their mean; 0.01 Da bins, square-root intensities, +query peaks spread to the two adjacent bins), and every candidate is scored by the +similarity-weighted mean Tanimoto similarity (4096-bit Morgan, radius 2) to those molecules: + score_q(c) = sum_j s_j^p * Tanimoto(c, m_j) / sum_j s_j^p, distance = 1 - score. +Only train-fold spectra and labels form the library; no validation label is read in the +`neighbours` step. `evaluate` reads validation labels to report Hit@1 (evaluation only). +""" +import argparse +import json +import pickle +import sys +import time +from pathlib import Path + +import numpy as np +import scipy.sparse as sp + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +ROOT = Path('/workspace/research') +KINDS = ('frag', 'loss', 'sum') + + +def vectors(records, width, spread): + """CSR fragment and neutral-loss matrices [spectra, bins], rows L2-normalised before spreading.""" + bins = int(2000 / width) + 3 + out = [] + for kind in ('frag', 'loss'): + rows, cols, vals = [], [], [] + for i, (mz, inten, precursor) in enumerate(records): + keep = mz < precursor - 0.5 + if not keep.any(): + continue + value = np.sqrt(inten[keep]) + mass = mz[keep] if kind == 'frag' else precursor - mz[keep] + index = np.rint(mass / width).astype(np.int64) + ok = (index > 0) & (index < bins - 1) + index, value = index[ok], value[ok] + if not len(index): + continue + uniq, inverse = np.unique(index, return_inverse=True) + merged = np.bincount(inverse, weights=value) + merged = merged / np.sqrt(np.sum(merged ** 2)) + for shift in ((-1, 0, 1) if spread else (0,)): + rows.append(np.full(len(uniq), i)) + cols.append(uniq + shift) + vals.append(merged) + matrix = sp.csr_matrix((np.concatenate(vals).astype(np.float32), + (np.concatenate(rows), np.concatenate(cols))), shape=(len(records), bins)) + out.append(matrix) + return out + + +def read_spectra(path, rows=None): + wanted = None if rows is None else set(int(r) for r in rows) + found = {} + with open(path) as stream: + for number, line in enumerate(stream): + if wanted is not None and number not in wanted: + continue + row = json.loads(line) + found[number] = (np.asarray(row['mzs'], dtype=np.float64), np.asarray(row['intensities'], dtype=np.float64), + float(row['precursor_mz'])) + order = sorted(found) if rows is None else [int(r) for r in rows] + return [found[n] for n in order] + + +def neighbours(args): + started = time.monotonic() + store = np.load(ROOT / 'inv/real-train.npz') + row, mol = store['row'], store['mol'] + order = np.argsort(mol, kind='stable') + train = read_spectra('/workspace/data/train.jsonl', row[order]) + mol = mol[order] + starts = np.flatnonzero(np.diff(mol, prepend=-1) != 0) + segment_mol = mol[starts] + queries = read_spectra(ROOT / 'validation-input/queries.jsonl') + print(f'train spectra {len(train)}, molecules {len(starts)}, queries {len(queries)}, read in {time.monotonic() - started:.0f} s', flush=True) + tf, tl = vectors(train, args.bin, spread=False) + qf, ql = vectors(queries, args.bin, spread=True) + tft, tlt = tf.T.tocsr(), tl.T.tocsr() + top = args.top + result = {kind: (np.zeros((len(queries), top), np.int32), np.zeros((len(queries), top), np.float32)) for kind in KINDS} + for low in range(0, len(queries), args.chunk): + high = min(len(queries), low + args.chunk) + sf = np.asarray((qf[low:high] @ tft).todense(), dtype=np.float32) + sl = np.asarray((ql[low:high] @ tlt).todense(), dtype=np.float32) + for kind, sim in (('frag', sf), ('loss', sl), ('sum', 0.5 * (sf + sl))): + per_mol = np.maximum.reduceat(sim, starts, axis=1) + part = np.argpartition(-per_mol, top, axis=1)[:, :top] + value = np.take_along_axis(per_mol, part, axis=1) + rank = np.argsort(-value, axis=1) + result[kind][0][low:high] = segment_mol[np.take_along_axis(part, rank, axis=1)] + result[kind][1][low:high] = np.take_along_axis(value, rank, axis=1) + print(f'{high} / {len(queries)} queries, {time.monotonic() - started:.0f} s', flush=True) + np.savez(args.out, **{f'{kind}_mol': result[kind][0] for kind in KINDS}, + **{f'{kind}_sim': result[kind][1] for kind in KINDS}) + for kind in KINDS: + sim = result[kind][1] + print(f'{kind}: best similarity median {np.median(sim[:, 0]):.3f}, mean {sim[:, 0].mean():.3f}, 10th neighbour median {np.median(sim[:, 9]):.3f}') + + +def evaluate(args): + from fuselab import Lab + from fusion_rule import MEMBERS + neigh = dict(np.load(args.neigh)) + if args.shuffle is not None: # control: every query gets the neighbours of another, random query + order = np.random.default_rng(args.shuffle).permutation(len(neigh['sum_mol'])) + neigh = {key: value[order] for key, value in neigh.items()} + ref = Lab(str(ROOT / 'validation-input'), 'noprec_pp0.75', MEMBERS).setup() + pools = len(ref.members) + store = np.load(ROOT / 'inv/pools-validation-input.npz') + slot = {pid: n for n, pid in enumerate(store['pool_id'])} + cand_start, cand_fps = store['pool_cand_start'], store['cand_fps'] + train_fps = np.load(ROOT / 'inv/real-train.npz')['fps'] + ks = [int(k) for k in args.ks.split(',')] + powers = [float(p) for p in args.powers.split(',')] + kmax = neigh['sum_mol'].shape[1] if args.inclusive else max(ks) + modes = args.modes.split(',') + configs = [(kind, k, p, mode) for kind in KINDS for k in ks for p in powers for mode in modes] + rng = np.random.default_rng(0) + sample = np.unpackbits(train_fps[rng.choice(len(train_fps), 1024, replace=False)], axis=1).astype(np.float32) + dist = {config: [None] * len(ref.query_pool) for config in configs} + own = np.zeros((len(ref.query_pool), 3)) # Tanimoto(best neighbour, label / mean candidate), similarity + for s in range(pools): + p = slot[ref.pool_ids[s]] + cand = np.unpackbits(cand_fps[cand_start[p]:cand_start[p + 1]], axis=1).astype(np.float32) + assert len(cand) == len(ref.tie[s]) + members = ref.members[s] + used = np.unique(np.concatenate([neigh[f'{kind}_mol'][members, :kmax].ravel() for kind in KINDS])) + lib = np.unpackbits(train_fps[used], axis=1).astype(np.float32) + inter = cand @ lib.T + tani = inter / np.maximum(cand.sum(1)[:, None] + lib.sum(1)[None, :] - inter, 1.0) + where = {int(m): n for n, m in enumerate(used)} + # spectrum-free part: mean Tanimoto of every candidate to a fixed random sample of train molecules + inter = cand @ sample.T + prior = (inter / np.maximum(cand.sum(1)[:, None] + sample.sum(1)[None, :] - inter, 1.0)).mean(1) + for i in members: + for kind in KINDS: + column = [where[int(m)] for m in neigh[f'{kind}_mol'][i, :kmax]] + sim = np.maximum(neigh[f'{kind}_sim'][i, :kmax].astype(np.float64), 0.0) + local = tani[:, column] + if kind == 'sum': + own[i] = (local[ref.target[i], 0], local[:, 0].mean(), sim[0]) + for k in ks: + for power in powers: + if args.inclusive: # every molecule tied with the k-th similarity votes (order-free) + weight = np.where(sim >= sim[k - 1], sim, 0.0) ** power + else: + weight = sim[:k] ** power + total = weight.sum() + for mode in modes: + # norm: weighted mean; raw: weighted sum / k (keeps the similarity level); + # +debias: minus the candidate's spectrum-free mean Tanimoto to train molecules + if total <= 0: + dist[(kind, k, power, mode)][i] = np.zeros(len(cand)) if 'raw' in mode else None + continue + scale = weight / (k if 'raw' in mode else total) + score = local[:, :len(scale)] @ scale + if 'debias' in mode: + score = score - prior * scale.sum() + dist[(kind, k, power, mode)][i] = (0.0 if 'raw' in mode or 'debias' in mode else 1.0) - score + print(f'Tanimoto of the best neighbour (kind sum): to the label {own[:, 0].mean():.3f}, to the average candidate {own[:, 1].mean():.3f}') + for name, mask in (('domain', ref.domain), ('other', ~ref.domain)): + print(f' {name}: label {own[mask, 0].mean():.3f}, candidate {own[mask, 1].mean():.3f}, best similarity median {np.median(own[mask, 2]):.3f}') + print('--- neighbour branch alone (per spectrum / pool mean)') + alone = {} + for config in configs: + mats = [ref.matrix(dist[config], s, fill=0.0 if config[3] != 'norm' else 1.0) for s in range(pools)] + single = ref.query_rule(lambda s: mats[s]) + pool = ref.pool_rule(lambda s: mats[s].mean(0)) + alone[config] = mats + hit = single == 0 + print(f'{config[0]:5s} k={config[1]:<3d} p={config[2]:<4g} {config[3]:10s} ind all={hit.mean():.4f} dom={hit[ref.domain].mean():.4f} non={hit[~ref.domain].mean():.4f}' + f' | pool all={np.mean(pool == 0):.4f} dom={np.mean(pool[ref.domain] == 0):.4f} non={np.mean(pool[~ref.domain] == 0):.4f}', flush=True) + # released fused rule + u * neighbour distance + forward = Lab(str(ROOT / 'validation-input'), 'Dmean', ['ENS=' + str(ROOT / 'evals/anchor2/4M-ensmean.pkl')]) + sim = [ref.matrix(forward.sim, s) for s in range(pools)] + parts = [] + for path in ('evals/I1/inv-50k.pkl', 'evals/I3/inv-30k.pkl', 'evals/I3/inv-100k.pkl'): + loaded = pickle.load(open(ROOT / path, 'rb'))['pooled'] + parts.append([ref.matrix(loaded, s) for s in range(pools)]) + inv = [np.mean([part[s] for part in parts], axis=0) for s in range(pools)] + dom = [ref.domain[m] for m in ref.members] + + def weight(s): + return np.where(dom[s], 0.75, max(0.05, 0.5 / len(dom[s]))) + + base = [sim[s] + weight(s)[:, None] * inv[s] for s in range(pools)] + reference = (ref.pool_rule(lambda s: base[s].mean(0)), ref.query_rule(lambda s: base[s])) + if args.forward: # candidate forward member set (the reference stays the released one) + other = Lab(str(ROOT / 'validation-input'), 'Dmean', ['ENS=' + args.forward]) + base = [ref.matrix(other.sim, s) + weight(s)[:, None] * inv[s] for s in range(pools)] + + def show(name, got): + pool, single = got + los, his = ref.paired(single == 0, reference[1] == 0) + print(ref.line(name, pool, reference[0]), + f'| ind {np.mean(single == 0):.4f} {np.mean(single == 0) - np.mean(reference[1] == 0):+.4f} [{los:+.4f},{his:+.4f}]', flush=True) + + print('--- released fused rule + u_domain / u_other * neighbour distance') + show('released', reference) + size = np.array([len(m) for m in ref.members]) + first = np.array([m[0] for m in ref.members]) + order = np.argsort(-size) + small = np.ones(pools, bool) + small[order[:20]] = False + capped = np.minimum(size, 30) + draws = np.random.default_rng(0).integers(0, pools, size=(2000, pools)) + hit0 = reference[0][first] == 0 + + def robust(got): + hit = got[0][first] == 0 + delta = hit.astype(float) - hit0 + macro = delta[draws].mean(1) + trimmed = (delta * size * small)[draws].sum(1) / (size * small)[draws].sum(1) + cap = (delta * capped)[draws].sum(1) / capped[draws].sum(1) + print(f' pools +{int((hit & ~hit0).sum())} -{int((hit0 & ~hit).sum())}' + f' | macro {delta.mean():+.4f} [{np.percentile(macro, 2.5):+.4f},{np.percentile(macro, 97.5):+.4f}]' + f' | without top 20 {np.sum(delta * size * small) / np.sum(size * small):+.4f} [{np.percentile(trimmed, 2.5):+.4f},{np.percentile(trimmed, 97.5):+.4f}]' + f' | weight min(n,30) {np.sum(delta * capped) / capped.sum():+.4f} [{np.percentile(cap, 2.5):+.4f},{np.percentile(cap, 97.5):+.4f}]', flush=True) + + def parse(text): + kind, k, power, mode = (text.split(':') + ['norm'])[:4] + return kind, int(k), float(power), mode + + if args.forward: + got = (ref.pool_rule(lambda s: base[s].mean(0)), ref.query_rule(lambda s: base[s])) + show('forward ' + Path(args.forward).name, got) + robust(got) + + for config in [parse(c) for c in args.fuse.split(',')]: + mats = alone[config] + for item in args.weights.split(','): + # UD/UN or UD/UN/SINGLE: other-condition weight max(UN, SINGLE / spectra sharing the pool) + ud, un, single = (tuple(float(x) for x in item.split('/')) + (0.0,))[:3] + extra = [np.where(dom[s], ud, max(un, single / len(dom[s])))[:, None] * mats[s] for s in range(pools)] + got = (ref.pool_rule(lambda s: (base[s] + extra[s]).mean(0)), ref.query_rule(lambda s: base[s] + extra[s])) + show(f'{config[0]} k={config[1]} p={config[2]:g} {config[3]} u={item}', got) + robust(got) + if args.save: + config = parse(args.save_config) + pickle.dump({'knn': dist[config], 'config': config}, open(args.save, 'wb')) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + sub = p.add_subparsers(dest='command', required=True) + a = sub.add_parser('neighbours') + a.add_argument('out') + a.add_argument('--bin', type=float, default=0.01) + a.add_argument('--top', type=int, default=32) + a.add_argument('--chunk', type=int, default=400) + b = sub.add_parser('evaluate') + b.add_argument('neigh') + b.add_argument('--ks', default='1,3,10,30') + b.add_argument('--powers', default='1,3') + b.add_argument('--fuse', default='sum:10:3') + b.add_argument('--weights', default='0.1/0.1,0.25/0.25,0.5/0.5,1/1,0/0.25,0.25/0') + b.add_argument('--save') + b.add_argument('--shuffle', type=int, default=None) + b.add_argument('--save-config', default='sum:10:3:norm') + b.add_argument('--modes', default='norm') + b.add_argument('--forward', help='ensemble-mean pickle of a candidate forward member set') + b.add_argument('--inclusive', action='store_true', help='include all neighbours tied with the k-th (as pkg/library.py)') + args = p.parse_args() + neighbours(args) if args.command == 'neighbours' else evaluate(args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/b7/b7f9f8c0ec364d18a1074bd1994bef83c1faee5cfab24dc3650eff4890d11263/swap-prepare-N5-recur-blend05-10.log b/shared/package-files/b7/b7f9f8c0ec364d18a1074bd1994bef83c1faee5cfab24dc3650eff4890d11263/swap-prepare-N5-recur-blend05-10.log new file mode 100644 index 0000000000000000000000000000000000000000..7c609c43aaa1d642b17c7818146cbe5cb33dabca --- /dev/null +++ b/shared/package-files/b7/b7f9f8c0ec364d18a1074bd1994bef83c1faee5cfab24dc3650eff4890d11263/swap-prepare-N5-recur-blend05-10.log @@ -0,0 +1 @@ +wrote /workspace/research/evals/fullfold/swap-N5-recur-blend05-10/pred 19429 diff --git a/shared/package-files/ba/ba3a3cca6ff0cd073adec9dc183437e355fe95b4bd4b10ea497ff20450b73d7b/formula_score.py b/shared/package-files/ba/ba3a3cca6ff0cd073adec9dc183437e355fe95b4bd4b10ea497ff20450b73d7b/formula_score.py new file mode 100644 index 0000000000000000000000000000000000000000..80f26422769de070d0b3889e9866112bd7a78eec --- /dev/null +++ b/shared/package-files/ba/ba3a3cca6ff0cd073adec9dc183437e355fe95b4bd4b10ea497ff20450b73d7b/formula_score.py @@ -0,0 +1,137 @@ +"""Does the fragment annotation alone identify the candidate formula? (validation analysis) + +formula_score.py INVERSE.pkl:KEY [--selected wd,wn,c] [--weights 0.05 0.1 ...] + +For every (spectrum, candidate formula) pair of the inference-style store: number of +annotated peaks and explained intensity (share of the selected peaks' intensity that has a +sub-formula of the candidate formula within tolerance). Pool score of a formula = mean over +the pool's spectra. Reports how often the target's formula is ranked first by these scores +(labels for evaluation only) and the effect of adding `weight * (1 - explained)` to the fused +distance of the packaged rule. Fragment peaks only; the precursor m/z is not used. +""" +import argparse +import json +import pickle +import sys +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) +sys.path.insert(0, str(HERE.parent / 'pkg')) +import inverse +from fuselab import Lab +from fusion_rule import MEMBERS + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('inverse') + p.add_argument('--root', default='/workspace/research/validation-input') + p.add_argument('--variant', default='noprec_pp0.75') + p.add_argument('--selected', default='0.75,0.05,0.5') + p.add_argument('--store', default='/workspace/research/inv/pools-validation-input.npz') + p.add_argument('--weights', nargs='*', type=float, default=[0.02, 0.05, 0.1, 0.2, 0.5]) + args = p.parse_args() + lab = Lab(args.root, args.variant, MEMBERS).setup() + pools = len(lab.members) + wd, wn, c = (float(x) for x in args.selected.split(',')) + store = dict(np.load(args.store)) + slot = {pid: n for n, pid in enumerate(store['pool_id'])} + order = {q: n for n, q in enumerate(store['query_id'])} + path, key = args.inverse.rsplit(':', 1) + data = pickle.load(open(path, 'rb'))[key] + inv = [lab.matrix(data, s) for s in range(pools)] + + # per-spectrum totals over the selected peaks (same selection as the annotation) + queries = [json.loads(line) for line in open(Path(args.root) / 'queries.jsonl')] + total = np.zeros((len(store['query_id']), 3)) + store_query = np.zeros(len(queries), dtype=np.int64) + for n, q in enumerate(queries): + _, inten = inverse.select_peaks(q['mzs'], q['intensities']) + i = order[q['query_id']] + store_query[n] = i + total[i] = (len(inten), inten.sum(), (inten ** 2).sum()) + offset = store['offset'] + count = np.diff(offset).astype(np.float64) + csum = np.concatenate([[0.0], np.cumsum(store['inten'].astype(np.float64))]) + csum2 = np.concatenate([[0.0], np.cumsum(store['inten'].astype(np.float64) ** 2)]) + explained = csum[offset[1:]] - csum[offset[:-1]] + explained2 = csum2[offset[1:]] - csum2[offset[:-1]] + pair_query, pair_formula = store['pair_query'], store['pair_formula'] + first = np.flatnonzero(np.diff(pair_query, prepend=-1) != 0) + begin = {int(pair_query[i]): int(i) for i in first} + end = {int(pair_query[i]): int(j) for i, j in zip(first, list(first[1:]) + [len(pair_query)])} + + scores = {'count share': [], 'sqrt-intensity share': [], 'intensity share': [], 'count': []} + formulas, targets = [], [] + for s, members in enumerate(lab.members): + k = slot[lab.pool_ids[s]] + f0, f1 = store['pool_formula_start'][k], store['pool_formula_start'][k + 1] + cand = store['cand_formula'][store['pool_cand_start'][k]:store['pool_cand_start'][k + 1]] + acc = {name: np.zeros(f1 - f0) for name in scores} + used = 0 + for i in store_query[members]: + if i not in begin or total[i, 0] == 0: + continue + lo, hi = begin[i], end[i] + col = pair_formula[lo:hi] - f0 + acc['count share'][col] += count[lo:hi] / total[i, 0] + acc['sqrt-intensity share'][col] += explained[lo:hi] / total[i, 1] + acc['intensity share'][col] += explained2[lo:hi] / total[i, 2] + acc['count'][col] += count[lo:hi] + used += 1 + for name in scores: + scores[name].append(acc[name] / max(used, 1)) + formulas.append(cand.astype(np.int64)) # pool-local formula index, -1 = unsupported + targets.append(formulas[-1][lab.target_pool[s]]) + + n = np.array([len(m) for m in lab.members], dtype=float) + dom = np.array([lab.domain[m].mean() for m in lab.members]) + print('formula identification from fragment annotation alone (query-weighted):') + for name, values in scores.items(): + top, top3, strict = np.zeros(pools), np.zeros(pools), np.zeros(pools) + for s in range(pools): + t = targets[s] + if t < 0: + continue + v = values[s] + better = (v > v[t] + 1e-12).sum() + ties = (np.abs(v - v[t]) <= 1e-12).sum() - 1 + top[s] = better == 0 + strict[s] = better == 0 and ties == 0 + top3[s] = better < 3 + for label, mask in (('all', np.ones(pools, bool)), ('domain', dom == 1), ('non-domain', dom == 0)): + w = n[mask] + print(f' {name:22s} {label:10s} target formula best-or-tied={np.sum(top[mask] * w) / w.sum():.3f} ' + f'strictly best={np.sum(strict[mask] * w) / w.sum():.3f} within top 3={np.sum(top3[mask] * w) / w.sum():.3f}') + sizes = np.array([len(v) for v in scores['count']]) + print(f'distinct candidate formulae per pool: median {np.median(sizes):.0f}') + + sim = [lab.matrix(lab.sim, s).mean(0) for s in range(pools)] + domq = [lab.domain[m] for m in lab.members] + + def fused(s): + w = np.where(domq[s], wd, max(wn, c / len(domq[s]))) + return sim[s] + (w[:, None] * inv[s]).mean(0) + + base = lab.pool_rule(fused) + print(lab.line('packaged rule', base)) + for name in ('count share', 'sqrt-intensity share', 'intensity share'): + for weight in args.weights: + def rule(s): + f = formulas[s] + penalty = np.where(f >= 0, 1.0 - scores[name][s][np.maximum(f, 0)], 1.0) + return fused(s) + weight * penalty + print(lab.line(f'+ {weight} * (1 - {name})', lab.pool_rule(rule), base), flush=True) + for weight in args.weights: + def rule(s): + f = formulas[s] + penalty = np.where(f >= 0, 1.0 - scores[name][s][np.maximum(f, 0)], 1.0) + return sim[s] + weight * penalty + print(lab.line(f'simulator + {weight} * (1 - {name})', lab.pool_rule(rule), base), flush=True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/ba/ba729d7b72021596f765803ecd7b3eb9946382f5508fac324b677d206448cbce/eval-B10k-sub-na-as-h.log b/shared/package-files/ba/ba729d7b72021596f765803ecd7b3eb9946382f5508fac324b677d206448cbce/eval-B10k-sub-na-as-h.log new file mode 100644 index 0000000000000000000000000000000000000000..1ba566a35a1c9fd0e2966f48b550f5b4045901df --- /dev/null +++ b/shared/package-files/ba/ba729d7b72021596f765803ecd7b3eb9946382f5508fac324b677d206448cbce/eval-B10k-sub-na-as-h.log @@ -0,0 +1,7 @@ +{"event": "loaded", "queries": 489, "pools": 63, "members": 1, "workers": 8} +{"event": "canonicalized", "unique_candidates": 15958, "unsupported": 253, "seconds": 1.8288885590154678} +{"event": "planned", "queries": 489, "groups": 89, "molecules": 15705, "simulations": 22296, "seconds": 1.856856528087519} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 22296, "total": 22296, "failed": 0, "seconds": 24.918124211020768} +{"event": "finished", "queries": 489, "unscored": 0, "directly_scored": 489, "scoring_seconds": 0.6735961789963767, "total_seconds": 39.99157716904301} diff --git a/shared/package-files/ba/ba888967c7ac5230a59e4605cc733c4b880108e302e33f7e990493a2ad0c8f53/report-ind.json b/shared/package-files/ba/ba888967c7ac5230a59e4605cc733c4b880108e302e33f7e990493a2ad0c8f53/report-ind.json new file mode 100644 index 0000000000000000000000000000000000000000..ca0f984d3efab1b608e8db42092cd54fd67ec041 --- /dev/null +++ b/shared/package-files/ba/ba888967c7ac5230a59e4605cc733c4b880108e302e33f7e990493a2ad0c8f53/report-ind.json @@ -0,0 +1,111 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": false, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.4589531113284266, + "saturation": null, + "score": 0.92298956105445, + "unclipped_score": 0.92298956105445, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.4589531113284266, + "hit_rate_at_20": 0.6892274435122755, + "hit_rate_at_5": 0.5976118173863811 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.5650694255377076, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.12982900569981, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.45964622763137536, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.10526315789473684, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.7248043052837574, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.7128270580727505, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.5291666666666667, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.7022435897435897, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.2127141950497144, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.5329218106995884, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.45410304763063447, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.4764376996805112, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.2146467251160392, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.7022806657078282, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.4589531113284266, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.4260184969702004, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.49122704658442606 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/ba/bae895b29ab697d7e21e1a2d4baf02a5ce2b43068d805dcfcea4a6104b989da7/selfsim.py b/shared/package-files/ba/bae895b29ab697d7e21e1a2d4baf02a5ce2b43068d805dcfcea4a6104b989da7/selfsim.py new file mode 100644 index 0000000000000000000000000000000000000000..234de5ded6c332232adc131c4977c85b8612a19f --- /dev/null +++ b/shared/package-files/ba/bae895b29ab697d7e21e1a2d4baf02a5ce2b43068d805dcfcea4a6104b989da7/selfsim.py @@ -0,0 +1,374 @@ +#!/usr/bin/env python3 +"""Self-simulated spectra as extra training rows of the inverse model (lab, E60). + +The inverse model sees spectra without a recorded collision energy and sodium adducts almost only +through real train rows (12 k structures); the supplied synthetic corpus (435 k structures) has an +energy in every row. Our own forward simulators were trained on the real rows of every condition, so +they can render the synthetic STRUCTURES in the under-covered conditions. Only train-fold-trained +models and the supplied structures are involved; no validation structure is simulated for training. + +selfsim.py structures + -> inv/selfsim/structures.json : one SMILES per structure slot of inv/synth.npz +selfsim.py simulate NAME --source synth|real-train|real-validation --conditions "[M+H]+|Orbitrap|none,..." + [--bundle builds/5Ms-I1+I3x2-L] [--members 0,1,2,3,4] [--limit N] [--workers 10] + -> inv/selfsim/NAME/{masses.npy,intens.npy,done.npy,rows.npz} + real-* sources simulate, per condition, only the structures that have a real row in it + (calibration / realism analysis; real-validation is analysis only). +selfsim.py simulate NAME --source synth --from-rows K | --from-train K [--window 2000] [--seed 0] [--hash-range LOW,HIGH] + conditions per structure: those of K of its own corpus rows, or K real train-fold conditions + drawn from rows of similar molecular mass (missing energies included). +selfsim.py merge OUT.npz IN.npz [IN.npz ...] concatenate annotated stores (structure tables of different sources are appended) +selfsim.py annotate NAME OUT.npz [--floor 0.02] [--workers 12] + -> store with the layout of prepare_inv.py (mol = structure slot of the SOURCE store, fps copied) +""" +import argparse +import csv +import json +import multiprocessing +import os +import sys +import time +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +import inverse +import invrun + +ROOT = Path('/workspace/research') +STORE = ROOT / 'inv' +DATA = Path('/workspace/data') +LABELS = DATA / 'synthetic_augmentation' / 'labels.tsv' +STATE = {} + + +# -------------------------------------------------------------------------- +# structure slots -> SMILES +# -------------------------------------------------------------------------- + +def key_chunk(smiles): + from rdkit import Chem, RDLogger + RDLogger.DisableLog('rdApp.*') + out = [] + for text in smiles: + mol = Chem.MolFromSmiles(text) if text else None + formula = inverse.mol_formula(mol) if mol is not None else None + out.append(None if formula is None else (inverse.fingerprint(mol).tobytes(), formula.astype(np.int16).tobytes())) + return out + + +def slot_roots(store): + mol = store['mol'] + first = np.full(store['fps'].shape[0], -1, dtype=np.int64) + first[mol[::-1]] = np.arange(len(mol))[::-1] + assert (first >= 0).all() + return store['root'][first] + + +def structures(args): + started = time.monotonic() + store = {k: v for k, v in np.load(STORE / 'synth.npz').items() if k in ('fps', 'root', 'mol')} + roots = slot_roots(store) + smiles, seen = [], set() + with LABELS.open() as stream: + for row in csv.DictReader(stream, delimiter='\t'): + if row['smiles'] not in seen: + seen.add(row['smiles']) + smiles.append(row['smiles']) + chunks = [smiles[i:i + 2000] for i in range(0, len(smiles), 2000)] + with multiprocessing.Pool(args.workers) as pool: + keys = [k for part in pool.imap(key_chunk, chunks, chunksize=1) for k in part] + by_key = {} + for text, key in zip(smiles, keys): + if key is not None: + by_key.setdefault(key, []).append(text) + out, shared = [], 0 + for s in range(store['fps'].shape[0]): + options = by_key[(store['fps'][s].tobytes(), roots[s].astype(np.int16).tobytes())] + shared += len(options) > 1 + out.append(options[0] if len(options) == 1 else options.pop(0)) + target = STORE / 'selfsim' + target.mkdir(parents=True, exist_ok=True) + (target / 'structures.json').write_text(json.dumps(out)) + print(json.dumps({'slots': len(out), 'label_smiles': len(smiles), 'slots_sharing_a_key': shared, + 'seconds': time.monotonic() - started})) + + +def source_structures(name): + """(SMILES per slot, store) of a source store.""" + store = dict(np.load(STORE / f'{name}.npz')) + if name == 'synth': + return json.loads((STORE / 'selfsim' / 'structures.json').read_text()), store + if name.startswith('gen-'): # genstruct.py build + return json.loads((STORE / f'{name}.json').read_text()), store + fold = name.split('-', 1)[1] + rows = [json.loads(line)['target_smiles'] for line in (DATA / f'{fold}.jsonl').open()] + smiles = [None] * store['fps'].shape[0] + for row, slot in zip(store['row'], store['mol']): + if smiles[slot] is None: + smiles[slot] = rows[row] + return smiles, store + + +# -------------------------------------------------------------------------- +# simulation +# -------------------------------------------------------------------------- + +def parse_conditions(text): + out = [] + for item in text.split(','): + adduct, instrument, energy = item.split('|') + out.append((adduct, instrument, None if energy == 'none' else float(energy))) + return out + + +def simulate(args): + import infer + if os.environ.get('GLACIER_SOURCE'): + sys.path.insert(0, os.environ['GLACIER_SOURCE']) + import torch + from ms_pred import common + started = time.monotonic() + smiles, store = source_structures(args.source) + conditions = parse_conditions(args.conditions) if args.conditions else [] + queries, pools, slots_of = [], {}, {} + per_condition = None + if args.from_rows: + # the conditions of up to K of each structure's own rows (energy rounded), structures with slot hash in [low, high) + assert args.source == 'synth' + low, high = (float(x) for x in args.hash_range.split(',')) + mol = store['mol'].astype(np.int64) + share = ((mol * 2654435761) % 4294967296) / 4294967296.0 # the hash of train_inv.py --synth-structures + rows = np.flatnonzero((share >= low) & (share < high)) + rows = np.random.default_rng(0).permutation(rows) + rows = rows[np.argsort(mol[rows], kind='stable')] + first = np.r_[0, np.flatnonzero(np.diff(mol[rows])) + 1] + rank = np.arange(len(rows)) - np.repeat(first, np.diff(np.r_[first, len(rows)])) + rows = rows[rank < args.from_rows] + energy = np.round(store['energy'][rows]).astype(np.int64) + key = np.stack([store['adduct'][rows].astype(np.int64), store['instrument'][rows].astype(np.int64), energy, mol[rows]], 1) + key = np.unique(key, axis=0) # one simulation per (condition, structure) + per_condition = {} + for a, i, e, m in key: + per_condition.setdefault((int(a), int(i), int(e)), []).append(int(m)) + names = list(inverse.INSTRUMENTS) + [''] + conditions = [(inverse.ADDUCTS[a], names[i], float(e)) for a, i, e in per_condition] + per_condition = [np.array(v, dtype=np.int64) for v in per_condition.values()] + if args.from_train: + # K conditions per structure, each copied from a real train-fold row of similar molecular mass + # (rows within +-WINDOW positions in the mass order): the simulated rows follow the train fold's + # joint distribution of mass and acquisition condition, missing energies included. + assert not args.source.startswith('real-') and not args.from_rows + low, high = (float(x) for x in args.hash_range.split(',')) + real = {k: v for k, v in np.load(STORE / 'real-train.npz').items() if k in ('root', 'adduct', 'instrument', 'energy')} + real_mass = real['root'].astype(np.float64) @ inverse.MONO + order = np.argsort(real_mass, kind='stable') + slots = np.arange(store['fps'].shape[0], dtype=np.int64) + share = ((slots * 2654435761) % 4294967296) / 4294967296.0 + slots = slots[(share >= low) & (share < high)] + position = np.searchsorted(real_mass[order], slot_roots(store)[slots].astype(np.float64) @ inverse.MONO) + rng = np.random.default_rng(args.seed) + key = [] + for _ in range(args.from_train): + row = order[np.clip(position + rng.integers(-args.window, args.window + 1, len(slots)), 0, len(order) - 1)] + energy = real['energy'][row] + energy = np.where(np.isnan(energy), -1, np.round(energy)).astype(np.int64) + key.append(np.stack([real['adduct'][row].astype(np.int64), real['instrument'][row].astype(np.int64), energy, slots], 1)) + key = np.unique(np.concatenate(key), axis=0) # one simulation per (condition, structure) + per_condition = {} + for a, i, e, m in key: + per_condition.setdefault((int(a), int(i), int(e)), []).append(int(m)) + names = list(inverse.INSTRUMENTS) + [''] + conditions = [(inverse.ADDUCTS[a], names[i], None if e < 0 else float(e)) for a, i, e in per_condition] + per_condition = [np.array(v, dtype=np.int64) for v in per_condition.values()] + for number, (adduct, instrument, energy) in enumerate(conditions): + if per_condition is not None: + slots = per_condition[number] + elif not args.source.startswith('real-'): + slots = np.arange(len(smiles)) + else: + sel = (store['adduct'] == inverse.ADDUCTS.index(adduct)) & (store['instrument'] == invrun.instrument_index(instrument)) + sel &= np.isnan(store['energy']) if energy is None else np.isclose(store['energy'], energy) + slots = np.unique(store['mol'][sel]) + if args.limit and len(slots) > args.limit: + slots = np.sort(np.random.default_rng(0).choice(slots, args.limit, replace=False)) + for start in range(0, len(slots), 256): + pid = f'c{number}p{start // 256}' + pools[pid] = [{'smiles': smiles[s]} for s in slots[start:start + 256]] + slots_of[pid] = slots[start:start + 256] + queries.append({'query_id': pid, 'candidate_pool_id': pid, 'adduct': adduct, 'instrument_type': instrument, + 'collision_energy': energy, 'precursor_mz': 0.0}) + bundle = ROOT / args.bundle + config = json.loads((bundle / 'model_config.json').read_text()) + members, _, _ = infer.load_members([bundle / 'model.pt']) + members = [members[int(m)] for m in args.members.split(',')] + + def instrument_index(name): + return common.instrument2onehot_pos.get(name or 'Unknown', common.instrument2onehot_pos['Unknown']) + + plan = infer.Plan(queries, pools, args.workers, instrument_index, set(common.ion2onehot_pos)) + masses, intens, done = infer.simulate(plan, members, config, args.workers, torch.device('cuda')) + row_slot, row_task, row_adduct, row_instrument, row_energy = [], [], [], [], [] + for (pid, adduct, _, energy), group in plan.groups.items(): + query = queries[group['queries'][0]] + tasks = group['tasks'] + ok = tasks >= 0 + ok[ok] = done[tasks[ok]] + row_slot.append(slots_of[pid][ok]) + row_task.append(tasks[ok]) + row_adduct.append(np.full(int(ok.sum()), inverse.ADDUCTS.index(adduct), dtype=np.uint8)) + row_instrument.append(np.full(int(ok.sum()), invrun.instrument_index(query['instrument_type']), dtype=np.uint8)) + row_energy.append(np.full(int(ok.sum()), float('nan') if energy is None else energy, dtype=np.float32)) + out = STORE / 'selfsim' / args.name + out.mkdir(parents=True, exist_ok=True) + np.save(out / 'masses.npy', masses) + np.save(out / 'intens.npy', intens) + np.save(out / 'done.npy', done) + np.savez(out / 'rows.npz', slot=np.concatenate(row_slot), task=np.concatenate(row_task), adduct=np.concatenate(row_adduct), + instrument=np.concatenate(row_instrument), energy=np.concatenate(row_energy)) + mode = f'from-train {args.from_train} window {args.window} seed {args.seed}' if args.from_train else f'from-rows {args.from_rows}' + report = {'name': args.name, 'source': args.source, 'conditions': args.conditions or f'{mode} hash-range {args.hash_range} ({len(conditions)} conditions)', + 'bundle': args.bundle, 'members': args.members, + 'structures': len(smiles), 'tasks': int(len(done)), 'failed': int((~done).sum()), + 'rows': int(sum(len(r) for r in row_slot)), 'seconds': time.monotonic() - started} + (out / 'simulate.json').write_text(json.dumps(report, indent=1) + '\n') + print(json.dumps(report), flush=True) + + +# -------------------------------------------------------------------------- +# annotation +# -------------------------------------------------------------------------- + +def merged_spectrum(masses, intens, max_candidates=50): + """Mean of the members' max-normalized predictions (square-root intensity scale), strongest first.""" + members = masses.shape[0] + peak = intens.max(1, keepdims=True) + scaled = np.where(peak > 0, intens / np.maximum(peak, 1e-12), 0.0) + m, s = masses.reshape(-1).astype(np.float64), scaled.reshape(-1).astype(np.float64) + keep = (m > 0) & (s > 0) + if not keep.any(): + return np.zeros(0), np.zeros(0) + m, s = m[keep], s[keep] + _, index = np.unique(np.round(m * 1e4).astype(np.int64), return_inverse=True) + total = np.bincount(index, weights=s) / members + mass = np.bincount(index, weights=m) / np.bincount(index) + order = np.argsort(-total, kind='stable')[:max_candidates] + return mass[order], total[order] / total[order[0]] + + +def annotate_chunk(job): + low, high = job + if 'masses' not in STATE: + root = STATE['root'] + STATE['masses'] = np.load(root / 'masses.npy', mmap_mode='r') + STATE['intens'] = np.load(root / 'intens.npy', mmap_mode='r') + rows, roots, floor = STATE['rows'], STATE['roots'], STATE['floor'] + tables, out = {}, [] + for n in range(low, high): + task = int(rows['task'][n]) + formula = roots[rows['slot'][n]] + key = formula.tobytes() + if float(np.prod(formula[inverse.HEAVY].astype(np.float64) + 1)) > invrun.MAX_TABLE: + out.append((np.zeros((0, len(inverse.ELEMENTS)), np.uint8), np.zeros(0, np.float32), 0)) + continue + table = tables.get(key) + if table is None: + if len(tables) > 64: + tables.clear() + table = tables[key] = inverse.SubformulaTable(formula) + mz, inten = merged_spectrum(np.asarray(STATE['masses'][:, task]), np.asarray(STATE['intens'][:, task]).astype(np.float32)) + cut = inten >= floor + mz, inten = mz[cut], inten[cut] + peaks, kept = inverse.annotate(table, mz, inten, inverse.ADDUCTS[int(rows['adduct'][n])], invrun.PPM, invrun.FLOOR) + out.append((peaks, kept, len(mz))) + return out + + +def annotate(args): + started = time.monotonic() + root = STORE / 'selfsim' / args.name + report = json.loads((root / 'simulate.json').read_text()) + source = {k: v for k, v in np.load(STORE / f"{report['source']}.npz").items() if k in ('fps', 'root', 'mol')} + rows = dict(np.load(root / 'rows.npz')) + STATE.update(root=root, rows=rows, roots=slot_roots(source), floor=args.floor) + total = len(rows['slot']) + jobs = [(i, min(i + 4000, total)) for i in range(0, total, 4000)] + with multiprocessing.Pool(args.workers) as pool: + got = [g for part in pool.imap(annotate_chunk, jobs, chunksize=1) for g in part] + counts = np.array([len(g[1]) for g in got], dtype=np.int64) + keep = counts > 0 + np.savez(args.out, + root=STATE['roots'][rows['slot'][keep]].astype(np.int16), + offset=np.concatenate([[0], np.cumsum(counts[keep])]), + peaks=np.concatenate([g[0] for g, k in zip(got, keep) if k]).astype(np.uint8), + inten=np.concatenate([g[1] for g, k in zip(got, keep) if k]).astype(np.float32), + adduct=rows['adduct'][keep], instrument=rows['instrument'][keep], energy=rows['energy'][keep], + mol=rows['slot'][keep].astype(np.int32), fps=source['fps']) + manifest = dict(report, schema='allcond-inverse-selfsim/v1', floor=args.floor, spectra=int(keep.sum()), without_peak=int((~keep).sum()), + mean_annotated_peaks=float(counts[keep].mean()), mean_candidates=float(np.mean([g[2] for g in got])), + ppm=invrun.PPM, floor_da=invrun.FLOOR, max_peaks=inverse.MAX_PEAKS, annotate_seconds=time.monotonic() - started) + Path(str(args.out).replace('.npz', '.manifest.json')).write_text(json.dumps(manifest, indent=1) + '\n') + print(json.dumps(manifest), flush=True) + + +def merge(args): + """Concatenate annotated stores of one source (same structure slots and fingerprints).""" + parts = [dict(np.load(path)) for path in args.inputs] + tables, shift = [parts[0]['fps']], [0] # structure tables: shared when equal, else appended + for part in parts[1:]: + for table, start in zip(tables, shift): + if part['fps'].shape == table.shape and (part['fps'][::997] == table[::997]).all(): + shift.append(start) + break + else: + shift.append(sum(len(t) for t in tables)) + tables.append(part['fps']) + for part, start in zip(parts, shift): + part['mol'] = part['mol'].astype(np.int64) + start + counts = np.concatenate([np.diff(part['offset']) for part in parts]) + out = {k: np.concatenate([part[k] for part in parts]) for k in ('root', 'peaks', 'inten', 'adduct', 'instrument', 'energy', 'mol')} + out['mol'] = out['mol'].astype(np.int32) + np.savez(args.out, offset=np.concatenate([[0], np.cumsum(counts)]), fps=np.concatenate(tables), **out) + manifest = {'schema': 'allcond-inverse-selfsim/v1', 'merged': [str(path) for path in args.inputs], + 'parts': [json.loads(Path(str(path).replace('.npz', '.manifest.json')).read_text()) for path in args.inputs], + 'spectra': int(len(out['mol'])), 'structures': int(len(np.unique(out['mol'])))} + Path(str(args.out).replace('.npz', '.manifest.json')).write_text(json.dumps(manifest, indent=1) + '\n') + print(json.dumps({k: manifest[k] for k in ('merged', 'spectra', 'structures')}), flush=True) + + +def main(): + p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + sub = p.add_subparsers(dest='mode', required=True) + q = sub.add_parser('structures') + q.add_argument('--workers', type=int, default=12) + q = sub.add_parser('simulate') + q.add_argument('name') + q.add_argument('--source', required=True, help='synth | real-train | real-validation | gen-NAME (genstruct.py build)') + q.add_argument('--conditions', default='') + q.add_argument('--from-rows', type=int, default=0, + help='synth source: simulate the (adduct, instrument, rounded energy) of up to K of every structure\'s own corpus rows') + q.add_argument('--from-train', type=int, default=0, + help='synth source: K conditions per structure copied from real train-fold rows of similar molecular mass') + q.add_argument('--window', type=int, default=2000, help='with --from-train: half-width of the mass-rank window (rows)') + q.add_argument('--seed', type=int, default=0, help='with --from-train: sampling seed') + q.add_argument('--hash-range', default='0,1', help='with --from-rows / --from-train: structures whose slot hash share lies in [LOW, HIGH)') + q.add_argument('--bundle', default='builds/5Ms-I1+I3x2-L') + q.add_argument('--members', default='0,1,2,3,4') + q.add_argument('--limit', type=int, default=0) + q.add_argument('--workers', type=int, default=10) + q = sub.add_parser('annotate') + q.add_argument('name') + q.add_argument('out', type=Path) + q.add_argument('--floor', type=float, default=0.02) + q.add_argument('--workers', type=int, default=12) + q = sub.add_parser('merge') + q.add_argument('out', type=Path) + q.add_argument('inputs', type=Path, nargs='+') + args = p.parse_args() + {'structures': structures, 'simulate': simulate, 'annotate': annotate, 'merge': merge}[args.mode](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/ba/baf6a31a9373a0d68a478f9fa12884242c96063883f6c2e6b77ba35211d2d2a6/report-np075-val-sub-replay.json b/shared/package-files/ba/baf6a31a9373a0d68a478f9fa12884242c96063883f6c2e6b77ba35211d2d2a6/report-np075-val-sub-replay.json new file mode 100644 index 0000000000000000000000000000000000000000..52a0c7b43c62408143a1ebf5125ca9344b3ca4fa --- /dev/null +++ b/shared/package-files/ba/baf6a31a9373a0d68a478f9fa12884242c96063883f6c2e6b77ba35211d2d2a6/report-np075-val-sub-replay.json @@ -0,0 +1,107 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.6199347927340475, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.2776826331876179, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.6199347927340475, + "hit_rate_at_20": 0.8448998602701444, + "hit_rate_at_5": 0.7708430367955287 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.6936067551266586, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.37014314928425357, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.6199347927340475, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.794921875, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.7909604519774012, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.6158940397350994, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.8103448275862069, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.4264859228362878, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6571428571428571, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.6374331550802139, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.4793388429752066, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.42179616548940463, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.7897923875432526, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.6199347927340475, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.519777339836694, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.7230061001092447 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/ba/baf7239cf6d9e9d890e15dc226b300438b04f3ac7a6c4c5d4fe2e4ff9c1a786c/validation.jsonl b/shared/package-files/ba/baf7239cf6d9e9d890e15dc226b300438b04f3ac7a6c4c5d4fe2e4ff9c1a786c/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..260ab55320617859fce69169016c7548ff7488f6 --- /dev/null +++ b/shared/package-files/ba/baf7239cf6d9e9d890e15dc226b300438b04f3ac7a6c4c5d4fe2e4ff9c1a786c/validation.jsonl @@ -0,0 +1,10 @@ +{"step": 5000, "elapsed": 169.0122618880123, "val_loss": 0.03966328664449124, "val_cos": 0.61624081893529, "val_loss_ema": 0.038254887612629636, "val_cos_ema": 0.6278250647791317} +{"step": 10000, "elapsed": 264.2394469748251, "val_loss": 0.03890013043158544, "val_cos": 0.6306502677818917, "val_loss_ema": 0.03704805554287807, "val_cos_ema": 0.6457980192905901, "ind_cos": 0.32173554995110404, "agg_cos": 0.3499408101291883, "ind_nll": 0.21370116835658037, "agg_nll": 0.19445159297956663, "retrieval_seconds": 12.860328110866249} +{"step": 15000, "elapsed": 371.55371425580233, "val_loss": 0.0390390192611359, "val_cos": 0.6354842056634895, "val_loss_ema": 0.037472750782396, "val_cos_ema": 0.6472419033122201} +{"step": 20000, "elapsed": 466.4092327109538, "val_loss": 0.0393182105709812, "val_cos": 0.6368302964680697, "val_loss_ema": 0.037853487766656, "val_cos_ema": 0.6490375287706199, "ind_cos": 0.3413968809511555, "agg_cos": 0.3790725204591075, "ind_nll": 0.24309022595089813, "agg_nll": 0.2426784703278604, "retrieval_seconds": 12.76891752006486} +{"step": 25000, "elapsed": 573.7936231698841, "val_loss": 0.03958230094943046, "val_cos": 0.6413267802097541, "val_loss_ema": 0.03819426320045703, "val_cos_ema": 0.6520246167737338} +{"step": 30000, "elapsed": 702.3826396306977, "val_loss": 0.04015511144569048, "val_cos": 0.6419633377156088, "val_loss_ema": 0.03930512016508827, "val_cos_ema": 0.6479149518559563, "ind_cos": 0.34870554326007513, "agg_cos": 0.38591795769210974, "ind_nll": 0.2579134283802563, "agg_nll": 0.26084718719440014, "retrieval_seconds": 18.707398890983313} +{"step": 35000, "elapsed": 825.243736024946, "val_loss": 0.04117947733097311, "val_cos": 0.6371923669796117, "val_loss_ema": 0.040164136427651036, "val_cos_ema": 0.6456085963737358} +{"step": 40000, "elapsed": 920.0752822957002, "val_loss": 0.04106145712785575, "val_cos": 0.643067838749421, "val_loss_ema": 0.040610224522419774, "val_cos_ema": 0.644764050004584, "ind_cos": 0.3469041124092851, "agg_cos": 0.38560914097483145, "ind_nll": 0.261773637346235, "agg_nll": 0.2611560039116784, "retrieval_seconds": 12.353470745962113} +{"step": 45000, "elapsed": 1028.1071437327191, "val_loss": 0.041190488099548755, "val_cos": 0.6417333964269745, "val_loss_ema": 0.041168526249873334, "val_cos_ema": 0.6426267294540378} +{"step": 50000, "elapsed": 1127.6156913759187, "val_loss": 0.0414377073417254, "val_cos": 0.641847135624421, "val_loss_ema": 0.04134249560800704, "val_cos_ema": 0.6424598495543872, "ind_cos": 0.34870554326007513, "agg_cos": 0.40084409902722734, "ind_nll": 0.2634206598383859, "agg_nll": 0.2601780843069638, "retrieval_seconds": 12.170336270704865} diff --git a/shared/package-files/bd/bd01a0f78b2af7aa7255b68b4ccde4e80b39ebb6e920456a593f3ccc3988512a/selfsim_realism.py b/shared/package-files/bd/bd01a0f78b2af7aa7255b68b4ccde4e80b39ebb6e920456a593f3ccc3988512a/selfsim_realism.py new file mode 100644 index 0000000000000000000000000000000000000000..44d71b796701cdee0cd174fe4335f0da32728b69 --- /dev/null +++ b/shared/package-files/bd/bd01a0f78b2af7aa7255b68b4ccde4e80b39ebb6e920456a593f3ccc3988512a/selfsim_realism.py @@ -0,0 +1,70 @@ +"""How close are self-simulated inverse rows to the real rows of the same structure and condition? (lab, E60; analysis) + +selfsim_realism.py SIM.npz REAL.npz (REAL = inv/real-train.npz or inv/real-validation.npz; SIM from selfsim.py annotate --floor 0) + +Per condition of the simulated store: annotated-peak counts of the real rows and of the simulated row +under a relative intensity floor, the simulated intensity at fixed ranks, and the agreement of the two +peak sets (sub-formulae): share of the real peaks / real intensity present among the simulated peaks, +share of the simulated peaks that are real, cosine of the two annotated spectra. +""" +import sys + +import numpy as np + + +def rows_of(store, n): + low, high = store['offset'][n], store['offset'][n + 1] + return store['peaks'][low:high], store['inten'][low:high] + + +def main(): + sim = dict(np.load(sys.argv[1])) + real = dict(np.load(sys.argv[2])) + by = {} + nan = np.isnan(real['energy']) + for n in np.flatnonzero(nan & (real['instrument'] == 0)): + by.setdefault((int(real['mol'][n]), int(real['adduct'][n])), []).append(n) + floors = (0.0, 0.05, 0.1, 0.15, 0.2, 0.3, 0.4) + for adduct in (0, 1): + counts_real, counts_sim, ranks, ranks_real = [], {f: [] for f in floors}, [], [] + recall, recall_w, precision, cosine, recall_cut, precision_cut = [], [], [], [], [], [] + for n in np.flatnonzero(sim['adduct'] == adduct): + others = by.get((int(sim['mol'][n]), adduct), []) + if not others: + continue + sp, si = rows_of(sim, n) + for f in floors: + counts_sim[f].append(int((si >= f).sum())) + ranks.append([si[k] if len(si) > k else 0.0 for k in (1, 4, 9, 19)]) + sim_keys = {p.tobytes(): v for p, v in zip(sp, si)} + for m in others[:3]: + rp, ri = rows_of(real, m) + counts_real.append(len(ri)) + ranks_real.append([ri[k] if len(ri) > k else 0.0 for k in (1, 4, 9, 19)]) + if len(ri) == 0: + continue + real_keys = {p.tobytes(): v for p, v in zip(rp, ri)} + hit = np.array([p.tobytes() in sim_keys for p in rp]) + recall.append(hit.mean()) + recall_w.append(float(np.sum(ri[hit] ** 2) / np.sum(ri ** 2))) + precision.append(np.mean([k in real_keys for k in sim_keys])) + top = list(sim_keys)[:len(real_keys)] # as many simulated peaks as the real row has + recall_cut.append(np.mean([k in top for k in real_keys])) + keys = sorted(set(sim_keys) | set(real_keys)) + a = np.array([sim_keys.get(k, 0.0) for k in keys]); b = np.array([real_keys.get(k, 0.0) for k in keys]) + cosine.append(float(a @ b / (np.linalg.norm(a) * np.linalg.norm(b) + 1e-12))) + if not counts_real: + continue + cr = np.array(counts_real) + print(f'adduct {adduct}: simulated rows {len(ranks)}, real rows {len(cr)}') + print(f' real count pct 10/25/50/75/90 {np.percentile(cr, [10, 25, 50, 75, 90]).astype(int)} mean {cr.mean():.1f}') + for f in floors: + c = np.array(counts_sim[f]) + print(f' sim count at floor {f:.2f}: pct 10/25/50/75/90 {np.percentile(c, [10, 25, 50, 75, 90]).astype(int)} mean {c.mean():.1f}') + print(' intensity at rank 2/5/10/20: sim median', np.median(np.array(ranks), 0).round(3), '| real median', np.median(np.array(ranks_real), 0).round(3)) + print(f' real peaks among the 24 simulated: {np.mean(recall):.3f} (intensity-weighted {np.mean(recall_w):.3f}); among as many simulated peaks as real ones {np.mean(recall_cut):.3f}' + f' | simulated peaks that are real {np.mean(precision):.3f} | cosine {np.mean(cosine):.3f}') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/bd/bd16599d5b91ceab12469370d5726f487bc617b9d8cd48d472d49ac3cdecd06f/netprop-neigh-p0.log b/shared/package-files/bd/bd16599d5b91ceab12469370d5726f487bc617b9d8cd48d472d49ac3cdecd06f/netprop-neigh-p0.log new file mode 100644 index 0000000000000000000000000000000000000000..632f918b5070be1cad2cae08d85ef4a70d2ac415 --- /dev/null +++ b/shared/package-files/bd/bd16599d5b91ceab12469370d5726f487bc617b9d8cd48d472d49ac3cdecd06f/netprop-neigh-p0.log @@ -0,0 +1,7 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4419 (domain 0.4123 / other 0.4717) macro 0.3701 + lam 1.00/1.00: Hit@1 0.8022 (+0.0309 [+0.0105, +0.0557]) macro +0.0115 [+0.0059, +0.0168] pools +69 -30 | no top 20 +0.0210 cap30 +0.0225 [+0.0069, +0.0388] | Hit@5 -0.0084 macro@5 +0.0071 cap30@5 +0.0108 + +k=10 p=3.0 half=0.4 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4434 (domain 0.4150 / other 0.4718) macro 0.3730 + lam 1.00/1.00: Hit@1 0.8032 (+0.0319 [+0.0115, +0.0570]) macro +0.0127 [+0.0068, +0.0183] pools +77 -34 | no top 20 +0.0222 cap30 +0.0237 [+0.0076, +0.0394] | Hit@5 -0.0086 macro@5 +0.0071 cap30@5 +0.0106 diff --git a/shared/package-files/bd/bd2e738e5e02018930fdeab2cdf9f81c9f12bf054d0ad317b9abebbc62b1a49c/I16-ff512x6-real08-corpus2+train3-noise05.log b/shared/package-files/bd/bd2e738e5e02018930fdeab2cdf9f81c9f12bf054d0ad317b9abebbc62b1a49c/I16-ff512x6-real08-corpus2+train3-noise05.log new file mode 100644 index 0000000000000000000000000000000000000000..ccbdfe817c03b402db3d5c089da73ff60921a9fe --- /dev/null +++ b/shared/package-files/bd/bd2e738e5e02018930fdeab2cdf9f81c9f12bf054d0ad317b9abebbc62b1a49c/I16-ff512x6-real08-corpus2+train3-noise05.log @@ -0,0 +1,12 @@ +{"extra_rows": 2031301, "extra_structures": 434950} +{"args": {"store": "/workspace/research/inv", "out": "runs/I16-ff512x6-real08-corpus2+train3-noise05", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/selfsim/corpus2+train3.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 1, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "noise_rate": 0.5, "noise_max": 12, "noise_scatter": 0.35, "noise_shape": 3.0, "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"gen-x1.manifest.json": null, "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc"}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 12.78748665691819, "extra_store": {"path": "inv/selfsim/corpus2+train3.npz", "rows": 2031301, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/selfsim/train3.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 17.868643710809152, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 43.40271363919601}], "spectra": 2031301, "structures": 434950}}} +{"step": 5000, "elapsed": 129.38671559595969, "val_loss": 0.03585574951988651, "val_cos": 0.649257429997523, "val_loss_ema": 0.0346494672032022, "val_cos_ema": 0.6594719550792308} +{"step": 10000, "elapsed": 253.56793923594523, "val_loss": 0.031351231922485595, "val_cos": 0.6981127222233838, "val_loss_ema": 0.030178573288756297, "val_cos_ema": 0.7091743822258286, "ind_cos": 0.4555046579854856, "agg_cos": 0.48417314323948735, "ind_nll": 0.31540480724689895, "agg_nll": 0.28771424159761183, "retrieval_seconds": 12.10475838999264} +{"step": 15000, "elapsed": 362.4668533169897, "val_loss": 0.029946957216670716, "val_cos": 0.718055388570243, "val_loss_ema": 0.028743662415226193, "val_cos_ema": 0.7281052893105988} +{"step": 20000, "elapsed": 458.691056016949, "val_loss": 0.02874713842533431, "val_cos": 0.731646892813256, "val_loss_ema": 0.027977455072797107, "val_cos_ema": 0.7400623494116398, "ind_cos": 0.5158268567605127, "agg_cos": 0.5546862936846981, "ind_nll": 0.40403520510576973, "agg_nll": 0.3925575171135931, "retrieval_seconds": 11.268065295065753} +{"step": 25000, "elapsed": 568.3081270899856, "val_loss": 0.028412578342639386, "val_cos": 0.7393601231165398, "val_loss_ema": 0.027532374596864504, "val_cos_ema": 0.746849808115446} +{"step": 30000, "elapsed": 664.3025753919501, "val_loss": 0.028590608805217074, "val_cos": 0.7397477021704025, "val_loss_ema": 0.027300943477417978, "val_cos_ema": 0.7509701162526057, "ind_cos": 0.5355396572134439, "agg_cos": 0.5797519172371197, "ind_nll": 0.4347109990220804, "agg_nll": 0.42529208914509237, "retrieval_seconds": 11.27071110997349} +{"step": 35000, "elapsed": 772.2559647839516, "val_loss": 0.02777588300583716, "val_cos": 0.7479953050208451, "val_loss_ema": 0.027519739307975112, "val_cos_ema": 0.7509532655357327} +{"step": 40000, "elapsed": 867.824359663995, "val_loss": 0.027812893560367234, "val_cos": 0.7502158676101125, "val_loss_ema": 0.027607200701487426, "val_cos_ema": 0.7518072362431802, "ind_cos": 0.5361572906480004, "agg_cos": 0.5772299140460136, "ind_nll": 0.4407329250090072, "agg_nll": 0.42652735601420555, "retrieval_seconds": 11.243929087999277} +{"step": 45000, "elapsed": 975.0255274139345, "val_loss": 0.02738559131326822, "val_cos": 0.754074254537354, "val_loss_ema": 0.02757765854237605, "val_cos_ema": 0.7532032697578362} +{"step": 50000, "elapsed": 1071.0661743020173, "val_loss": 0.02762390259235148, "val_cos": 0.7535367154125276, "val_loss_ema": 0.02752703060437, "val_cos_ema": 0.7540649935542553, "ind_cos": 0.5401719079726183, "agg_cos": 0.5796489783313603, "ind_nll": 0.44562252303258015, "agg_nll": 0.4282773174121159, "retrieval_seconds": 11.252867358969525} diff --git a/shared/package-files/bd/bd3f82298c87537bf5048d7c82f5d14922d0fc52bedc28cc81c0ab1abf912864/README.md b/shared/package-files/bd/bd3f82298c87537bf5048d7c82f5d14922d0fc52bedc28cc81c0ab1abf912864/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ac62798b65f2f2ff0c6586b8fbf74847446015ca --- /dev/null +++ b/shared/package-files/bd/bd3f82298c87537bf5048d7c82f5d14922d0fc52bedc28cc81c0ab1abf912864/README.md @@ -0,0 +1,99 @@ +# MassSpecGym v1.5 retrieval package: scratch-trained GLACIER simulator + pool aggregation + +Interim release (the research loop continues; see `EXPERIMENTS.md` at the package root). + +## What it does + +`bash infer.sh INPUT_ROOT OUTPUT_ROOT` reads `queries.jsonl` and `candidate_pools.jsonl` and +writes `OUTPUT_ROOT/rankings.jsonl` with one complete ranking per query. + +1. Every supported candidate SMILES is simulated with a GLACIER forward model (ms-pred commit + `ed8311f2`, vendored under `vendor/ms_pred`) under the query's adduct, instrument and + rounded collision energy (missing energy -> the model's "no energy" embedding; missing + instrument -> `Unknown`). Simulations are deduplicated across queries. +2. Each observed spectrum is compared with each simulated candidate spectrum by a + Jensen-Shannon distance on 0.01 Da bins (top-50 observed peaks, square-root observed + intensities, top-100 predicted fragments), as in GLACIER retrieval, with two global, + label-free changes selected on validation (`views` in `model_config.json`): + - **fragment-only view**: observed and predicted peaks at or above `precursor_mz - 0.5` + are left out before normalization (the simulator puts most intensity on the intact + precursor for `[M+Na]+`/no-energy spectra, while many observed spectra do not contain + it); a spectrum with no fragment peak falls back to the full-spectrum distance; + - predicted intensities are raised to the power 0.75 before normalization. + Unsupported candidates get distance 1. +3. **Pool aggregation (multi-spectrum evidence).** Queries that name the same + `candidate_pool_id` are spectra of the same unknown, so the final distance of a candidate + is the mean of its distances over all scored spectra of that pool + (`pool_aggregation: 1.0` in `model_config.json`; set it to `0.0` for independent + per-spectrum ranking). This uses only the supplied inputs: no labels, no formulae, no + candidate positions, no fitted or query-specific parameters. With weight 1 all spectra + of a pool receive the same ranking. +4. Candidates are sorted by distance, ties by candidate id. + +## Model + +- One GLACIER network (15.1 M parameters), **randomly initialized** and trained only on the + MassSpecGym v1.5 train fold: run B, **all acquisition conditions** (all 194,119 train + spectra: `[M+H]+` and `[M+Na]+`, with and without a recorded collision energy, every + instrument type), 20,000 steps, batch 32, seed 1, stock cosine intensity loss, EMA weights. + No pretrained assets, no published GLACIER weights. +- `model.pt` is a single PyTorch file holding the member list (one member here). +- Source checkpoint sha256 `80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c` + (`research/runs/B-all-b32`: configuration, recipe identity, logs). + +## Validation (selection evidence; not comparable to the test reference) + +Full validation fold, 19,429 queries / 3,386 pools, query-set sha256 +`7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6`. + +| ranking | Hit@1 | Hit@5 | Hit@20 | 95 % CI Hit@1 (molecule-group bootstrap) | +|---|---|---|---|---| +| released (run B 20k; fragment-only view, power 0.75, pool aggregation) | 0.6380 | 0.8077 | 0.8954 | 0.5985 - 0.6782 | +| same model, full-spectrum distance, pool aggregation | 0.6068 | 0.7585 | 0.8505 | 0.5674 - 0.6468 | +| same model, full-spectrum distance, independent spectra | 0.4436 | 0.5886 | 0.6718 | 0.4134 - 0.4733 | +| previous release (run A 10k, same scoring as released) | 0.5636 | 0.7131 | 0.8193 | 0.5125 - 0.6110 | + +Paired pool bootstrap, released vs previous release: +0.0744 [+0.0251, +0.1380]. Strata +(released): `[M+H]+` 0.699, `[M+Na]+` 0.448; recorded energy 0.69-0.82, missing energy +0.482; Orbitrap 0.643, QTOF 0.601; stock GLACIER domain 0.790, other 0.485 (previous +release: 0.783 / 0.343). Pools weighted equally: 0.742. + +How these numbers were produced: the step-20,000 EMA checkpoint was evaluated on the full +fold with the development copy of `infer.py`, saving its 2,540,748 simulations +(`research/evals/B20k-full`; 1,621 s while two training jobs shared the GPU). The packaged +scoring code (`infer.py` of this package, `--load-predictions`, 91 s) re-scored those +simulations and produced the released-row numbers. The relocated, read-only copy of this +exact package was then replayed end to end on `val-sub` (2,147 queries, whole pools; 555 s +with the GPU shared by two training jobs and an evaluation; Hit@1 0.6199, Hit@5 0.7708, +Hit@20 0.8449). Against the full-fold rankings of the same queries the top-1 candidate is +identical for all 2,147 queries and Hit@1/5/20 are identical; 2.5 % of target ranks differ +by at most 2 positions, all below rank 60 (float noise from different batch composition +among near-tied candidates; E14 in `EXPERIMENTS.md`). A full-fold replay of this exact +package was not repeated; the network architecture and the number of simulations are those +of the first release, whose stand-alone full-fold replay took 1,440 s end to end. + +## Limits + +- Non-domain conditions (`[M+Na]+`, missing collision energy; half of the validation queries) + remain much weaker than the stock GLACIER domain (0.485 vs 0.790), and per-spectrum + ranking there is poor (0.24); the pool mean carries most of that stratum. +- With aggregation weight 1 a pool is hit or missed as a whole, so the estimate has a wide + molecule-group confidence interval and depends on a few very large pools. +- Candidates that RDKit cannot parse, contain unsupported elements or have more than 100 + heavy atoms get distance 1 (ranked last, by candidate id). +- The precursor m/z is used only to separate fragment peaks from the precursor region. An + explicit precursor-mass-error term was evaluated (E21) and deliberately **not** enabled. + +## Runtime + +`/opt/glacier/bin/python` (override with `MASSSPECGYM_GLACIER_PYTHON`), one GPU, <= 14 CPU +featurization workers, about 3 GiB of host memory for the validation fold, no network, no +writes inside the package. Measured (first release, same network size, GPU not shared): +2.54 M simulations in 1,362 s, 1,440 s end to end for the validation fold. + +## Files + +`infer.sh`, `infer.py`, `fastfeat.py` (compact featurization, tensor-equal to the stock one), +`model.pt`, `model_config.json`, `model_manifest.json`, `vendor/ms_pred` (+ `LICENSE.ms-pred`), +`training/` (training, preparation, publication and analysis source used for this release). +Experiment records: `EXPERIMENTS.md` and `research/` at the package root. diff --git a/shared/package-files/bd/bd679e6dd7215f0cb2634b724ce5c9af5b4089486ed9bc02fb40e83daf0d2510/knn-evaluate-shuffled.log b/shared/package-files/bd/bd679e6dd7215f0cb2634b724ce5c9af5b4089486ed9bc02fb40e83daf0d2510/knn-evaluate-shuffled.log new file mode 100644 index 0000000000000000000000000000000000000000..4b744427885a76bd53c0634cc1c552d7d2583434 --- /dev/null +++ b/shared/package-files/bd/bd679e6dd7215f0cb2634b724ce5c9af5b4089486ed9bc02fb40e83daf0d2510/knn-evaluate-shuffled.log @@ -0,0 +1,13 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.095, to the average candidate 0.092 + domain: label 0.094, candidate 0.095, best similarity median 0.445 + other: label 0.096, candidate 0.089, best similarity median 0.441 +--- neighbour branch alone (per spectrum / pool mean) +frag k=10 p=3 ind all=0.0110 dom=0.0049 non=0.0171 | pool all=0.0108 dom=0.0033 non=0.0183 +loss k=10 p=3 ind all=0.0102 dom=0.0050 non=0.0155 | pool all=0.0100 dom=0.0026 non=0.0174 +sum k=10 p=3 ind all=0.0103 dom=0.0043 non=0.0164 | pool all=0.0083 dom=0.0059 non=0.0107 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7327 dom=0.9072 non=0.5575 h5=0.8565 h20=0.9156 macro=0.8317 | +0.0000 [+0.0000,+0.0000] | ind 0.5908 +0.0000 [+0.0000,+0.0000] +sum k=10 p=3 u=0.1/0.1 all=0.7341 dom=0.9069 non=0.5606 h5=0.8588 h20=0.9164 macro=0.8317 | +0.0014 [-0.0004,+0.0046] | ind 0.5921 +0.0012 [-0.0002,+0.0026] +sum k=10 p=3 u=0.25/0.25 all=0.7349 dom=0.9061 non=0.5631 h5=0.8652 h20=0.9170 macro=0.8320 | +0.0022 [-0.0043,+0.0095] | ind 0.5895 -0.0013 [-0.0037,+0.0011] +sum k=10 p=3 u=0.5/0.5 all=0.7171 dom=0.9001 non=0.5333 h5=0.8636 h20=0.9171 macro=0.8275 | -0.0156 [-0.0378,+0.0009] | ind 0.5841 -0.0067 [-0.0106,-0.0032] +sum k=10 p=3 u=0/0.25 all=0.7357 dom=0.9072 non=0.5634 h5=0.8653 h20=0.9170 macro=0.8325 | +0.0029 [-0.0036,+0.0102] | ind 0.5898 -0.0010 [-0.0033,+0.0013] diff --git a/shared/package-files/bd/bd7f1042c3627ff4c6636baf9dca40ed14ca5a287fdd51a1d197902f0bf2f60e/knn-evaluate-modes.log b/shared/package-files/bd/bd7f1042c3627ff4c6636baf9dca40ed14ca5a287fdd51a1d197902f0bf2f60e/knn-evaluate-modes.log new file mode 100644 index 0000000000000000000000000000000000000000..98713ad220717de9dbebd73ab51345c6820473fe --- /dev/null +++ b/shared/package-files/bd/bd7f1042c3627ff4c6636baf9dca40ed14ca5a287fdd51a1d197902f0bf2f60e/knn-evaluate-modes.log @@ -0,0 +1,58 @@ +Tanimoto of the best neighbour (kind sum): to the label 0.162, to the average candidate 0.102 + domain: label 0.153, candidate 0.105, best similarity median 0.442 + other: label 0.170, candidate 0.098, best similarity median 0.444 +--- neighbour branch alone (per spectrum / pool mean) +frag k=10 p=3 norm ind all=0.1282 dom=0.1254 non=0.1310 | pool all=0.1658 dom=0.1407 non=0.1910 +frag k=10 p=3 raw ind all=0.1282 dom=0.1254 non=0.1310 | pool all=0.1510 dom=0.1395 non=0.1626 +frag k=10 p=3 debias ind all=0.1408 dom=0.1475 non=0.1340 | pool all=0.1976 dom=0.1727 non=0.2226 +frag k=10 p=3 rawdebias ind all=0.1408 dom=0.1475 non=0.1340 | pool all=0.1894 dom=0.1832 non=0.1956 +loss k=10 p=3 norm ind all=0.0618 dom=0.0455 non=0.0782 | pool all=0.0959 dom=0.0517 non=0.1404 +loss k=10 p=3 raw ind all=0.0618 dom=0.0455 non=0.0782 | pool all=0.0948 dom=0.0535 non=0.1362 +loss k=10 p=3 debias ind all=0.0702 dom=0.0592 non=0.0813 | pool all=0.1220 dom=0.0805 non=0.1636 +loss k=10 p=3 rawdebias ind all=0.0702 dom=0.0592 non=0.0813 | pool all=0.1292 dom=0.0830 non=0.1756 +sum k=10 p=3 norm ind all=0.1528 dom=0.1434 non=0.1622 | pool all=0.2044 dom=0.1681 non=0.2408 +sum k=10 p=3 raw ind all=0.1528 dom=0.1434 non=0.1622 | pool all=0.1732 dom=0.1637 non=0.1828 +sum k=10 p=3 debias ind all=0.1713 dom=0.1752 non=0.1675 | pool all=0.2530 dom=0.2262 non=0.2798 +sum k=10 p=3 rawdebias ind all=0.1713 dom=0.1752 non=0.1675 | pool all=0.2274 dom=0.2055 non=0.2494 +--- released fused rule + u_domain / u_other * neighbour distance +released all=0.7327 dom=0.9072 non=0.5575 h5=0.8565 h20=0.9156 macro=0.8317 | +0.0000 [+0.0000,+0.0000] | ind 0.5908 +0.0000 [+0.0000,+0.0000] +sum k=10 p=3 norm u=0/0.1 all=0.7345 dom=0.9072 non=0.5610 h5=0.8652 h20=0.9227 macro=0.8323 | +0.0017 [-0.0038,+0.0075] | ind 0.5963 +0.0055 [+0.0029,+0.0084] + pools +7 -5 | macro +0.0006 [-0.0015,+0.0027] | without top 20 +0.0020 [-0.0041,+0.0081] | weight min(n,30) +0.0020 [-0.0037,+0.0080] +sum k=10 p=3 norm u=0/0.25 all=0.7383 dom=0.9078 non=0.5680 h5=0.8702 h20=0.9269 macro=0.8331 | +0.0056 [-0.0027,+0.0139] | ind 0.5980 +0.0072 [+0.0032,+0.0115] + pools +13 -8 | macro +0.0015 [-0.0012,+0.0041] | without top 20 +0.0063 [-0.0027,+0.0153] | weight min(n,30) +0.0064 [-0.0025,+0.0156] +sum k=10 p=3 norm u=0/0.5 all=0.7371 dom=0.9088 non=0.5647 h5=0.8747 h20=0.9274 macro=0.8331 | +0.0044 [-0.0052,+0.0142] | ind 0.6014 +0.0106 [+0.0048,+0.0176] + pools +21 -16 | macro +0.0015 [-0.0021,+0.0053] | without top 20 +0.0049 [-0.0049,+0.0155] | weight min(n,30) +0.0049 [-0.0050,+0.0153] +sum k=10 p=3 norm u=0/1 all=0.7177 dom=0.9084 non=0.5264 h5=0.8288 h20=0.9220 macro=0.8305 | -0.0150 [-0.0392,+0.0059] | ind 0.6015 +0.0107 [+0.0030,+0.0187] + pools +40 -44 | macro -0.0012 [-0.0065,+0.0038] | without top 20 -0.0065 [-0.0240,+0.0095] | weight min(n,30) -0.0084 [-0.0248,+0.0068] +sum k=10 p=3 norm u=0/2 all=0.6964 dom=0.9083 non=0.4838 h5=0.7973 h20=0.8738 macro=0.8207 | -0.0363 [-0.0643,-0.0119] | ind 0.5981 +0.0073 [-0.0021,+0.0166] + pools +49 -86 | macro -0.0109 [-0.0180,-0.0044] | without top 20 -0.0259 [-0.0478,-0.0053] | weight min(n,30) -0.0274 [-0.0473,-0.0086] +sum k=10 p=3 raw u=0/0.1 all=0.7327 dom=0.9072 non=0.5575 h5=0.8565 h20=0.9152 macro=0.8317 | +0.0000 [+0.0000,+0.0000] | ind 0.5913 +0.0005 [+0.0001,+0.0008] + pools +0 -0 | macro +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +sum k=10 p=3 raw u=0/0.25 all=0.7326 dom=0.9072 non=0.5573 h5=0.8576 h20=0.9152 macro=0.8314 | -0.0001 [-0.0003,+0.0000] | ind 0.5921 +0.0012 [+0.0004,+0.0022] + pools +0 -1 | macro -0.0003 [-0.0009,+0.0000] | without top 20 -0.0001 [-0.0004,+0.0000] | weight min(n,30) -0.0001 [-0.0004,+0.0000] +sum k=10 p=3 raw u=0/0.5 all=0.7326 dom=0.9072 non=0.5573 h5=0.8611 h20=0.9165 macro=0.8314 | -0.0001 [-0.0003,+0.0000] | ind 0.5936 +0.0028 [+0.0016,+0.0041] + pools +0 -1 | macro -0.0003 [-0.0009,+0.0000] | without top 20 -0.0001 [-0.0004,+0.0000] | weight min(n,30) -0.0001 [-0.0004,+0.0000] +sum k=10 p=3 raw u=0/1 all=0.7333 dom=0.9072 non=0.5586 h5=0.8625 h20=0.9184 macro=0.8320 | +0.0006 [-0.0002,+0.0017] | ind 0.5952 +0.0044 [+0.0023,+0.0068] + pools +2 -1 | macro +0.0003 [-0.0006,+0.0012] | without top 20 +0.0006 [-0.0002,+0.0018] | weight min(n,30) +0.0007 [-0.0002,+0.0019] +sum k=10 p=3 raw u=0/2 all=0.7280 dom=0.9072 non=0.5480 h5=0.8641 h20=0.9204 macro=0.8317 | -0.0047 [-0.0249,+0.0091] | ind 0.5971 +0.0063 [+0.0033,+0.0096] + pools +6 -6 | macro +0.0000 [-0.0021,+0.0021] | without top 20 +0.0050 [+0.0004,+0.0111] | weight min(n,30) +0.0032 [-0.0029,+0.0100] +sum k=10 p=3 debias u=0/0.1 all=0.7353 dom=0.9072 non=0.5627 h5=0.8642 h20=0.9242 macro=0.8328 | +0.0026 [+0.0001,+0.0068] | ind 0.5968 +0.0060 [+0.0038,+0.0086] + pools +6 -2 | macro +0.0012 [-0.0003,+0.0030] | without top 20 +0.0029 [+0.0002,+0.0076] | weight min(n,30) +0.0028 [+0.0002,+0.0072] +sum k=10 p=3 debias u=0/0.25 all=0.7409 dom=0.9085 non=0.5726 h5=0.8692 h20=0.9228 macro=0.8337 | +0.0081 [-0.0015,+0.0191] | ind 0.5986 +0.0078 [+0.0042,+0.0115] + pools +11 -4 | macro +0.0021 [+0.0000,+0.0044] | without top 20 +0.0052 [-0.0034,+0.0145] | weight min(n,30) +0.0057 [-0.0022,+0.0138] +sum k=10 p=3 debias u=0/0.5 all=0.7397 dom=0.9094 non=0.5693 h5=0.8749 h20=0.9324 macro=0.8340 | +0.0069 [-0.0063,+0.0204] | ind 0.6009 +0.0100 [+0.0046,+0.0160] + pools +16 -8 | macro +0.0024 [-0.0003,+0.0053] | without top 20 +0.0084 [-0.0014,+0.0186] | weight min(n,30) +0.0073 [-0.0023,+0.0168] +sum k=10 p=3 debias u=0/1 all=0.7311 dom=0.9098 non=0.5517 h5=0.8699 h20=0.9345 macro=0.8349 | -0.0016 [-0.0262,+0.0218] | ind 0.6037 +0.0129 [+0.0063,+0.0199] + pools +37 -26 | macro +0.0032 [-0.0012,+0.0080] | without top 20 +0.0092 [-0.0040,+0.0235] | weight min(n,30) +0.0055 [-0.0087,+0.0197] +sum k=10 p=3 debias u=0/2 all=0.7256 dom=0.9092 non=0.5413 h5=0.8702 h20=0.9238 macro=0.8281 | -0.0071 [-0.0324,+0.0163] | ind 0.6004 +0.0096 [+0.0019,+0.0177] + pools +47 -59 | macro -0.0035 [-0.0095,+0.0024] | without top 20 +0.0030 [-0.0129,+0.0183] | weight min(n,30) -0.0009 [-0.0165,+0.0148] +sum k=10 p=3 rawdebias u=0/0.1 all=0.7327 dom=0.9072 non=0.5575 h5=0.8565 h20=0.9152 macro=0.8317 | +0.0000 [+0.0000,+0.0000] | ind 0.5912 +0.0004 [+0.0001,+0.0008] + pools +0 -0 | macro +0.0000 [+0.0000,+0.0000] | without top 20 +0.0000 [+0.0000,+0.0000] | weight min(n,30) +0.0000 [+0.0000,+0.0000] +sum k=10 p=3 rawdebias u=0/0.25 all=0.7320 dom=0.9072 non=0.5561 h5=0.8565 h20=0.9152 macro=0.8317 | -0.0007 [-0.0030,+0.0003] | ind 0.5920 +0.0011 [+0.0005,+0.0019] + pools +1 -1 | macro +0.0000 [-0.0009,+0.0009] | without top 20 -0.0008 [-0.0028,+0.0003] | weight min(n,30) -0.0008 [-0.0029,+0.0004] +sum k=10 p=3 rawdebias u=0/0.5 all=0.7320 dom=0.9072 non=0.5561 h5=0.8601 h20=0.9180 macro=0.8317 | -0.0007 [-0.0030,+0.0003] | ind 0.5934 +0.0026 [+0.0015,+0.0038] + pools +1 -1 | macro +0.0000 [-0.0009,+0.0009] | without top 20 -0.0008 [-0.0028,+0.0003] | weight min(n,30) -0.0008 [-0.0029,+0.0004] +sum k=10 p=3 rawdebias u=0/1 all=0.7324 dom=0.9072 non=0.5569 h5=0.8606 h20=0.9191 macro=0.8320 | -0.0003 [-0.0026,+0.0014] | ind 0.5951 +0.0043 [+0.0026,+0.0062] + pools +2 -1 | macro +0.0003 [-0.0006,+0.0015] | without top 20 -0.0003 [-0.0027,+0.0014] | weight min(n,30) -0.0004 [-0.0028,+0.0014] +sum k=10 p=3 rawdebias u=0/2 all=0.7241 dom=0.9072 non=0.5402 h5=0.8635 h20=0.9245 macro=0.8317 | -0.0086 [-0.0283,+0.0041] | ind 0.5966 +0.0058 [+0.0034,+0.0085] + pools +4 -4 | macro +0.0000 [-0.0018,+0.0015] | without top 20 +0.0006 [-0.0041,+0.0059] | weight min(n,30) -0.0013 [-0.0072,+0.0043] diff --git a/shared/package-files/bd/bd8d906b209b1631e8039a40a9c6b8e0b95454ef9321bae586ee58c5cb9af0b2/validation.jsonl b/shared/package-files/bd/bd8d906b209b1631e8039a40a9c6b8e0b95454ef9321bae586ee58c5cb9af0b2/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..7dd938069cf4fbdef0ff812ae41e074216571b7c --- /dev/null +++ b/shared/package-files/bd/bd8d906b209b1631e8039a40a9c6b8e0b95454ef9321bae586ee58c5cb9af0b2/validation.jsonl @@ -0,0 +1,2 @@ +{"step": 5000, "elapsed_seconds": 1444.6998637880897, "validation_loss": 0.6812945827841759, "validation_loss_ema": 0.6684011314064264} +{"step": 10000, "elapsed_seconds": 2708.506315391045, "validation_loss": 0.6276558749377728, "validation_loss_ema": 0.6128806732594967} diff --git a/shared/package-files/bd/bd9185fd8ca87a35436ee69192ed342f2d3b37c587ec4a9fb95893d0bf5e199f/eval-B45a-51k-full.log b/shared/package-files/bd/bd9185fd8ca87a35436ee69192ed342f2d3b37c587ec4a9fb95893d0bf5e199f/eval-B45a-51k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..adc3784bf4b8b573ac062bbb1002ffb0ef738d8c --- /dev/null +++ b/shared/package-files/bd/bd9185fd8ca87a35436ee69192ed342f2d3b37c587ec4a9fb95893d0bf5e199f/eval-B45a-51k-full.log @@ -0,0 +1,46 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 1, "inverse_members": 0, "workers": 12} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 56.87834352599748} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 61.29196739400504} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 2540748, "seconds": 26.264726542998687, "per_second": 2436.7282063730563} +{"event": "simulating", "finished": 128000, "total": 2540748, "seconds": 52.79159027100832, "per_second": 2424.628607376771} +{"event": "simulating", "finished": 192000, "total": 2540748, "seconds": 78.11551550900913, "per_second": 2457.8983925140515} +{"event": "simulating", "finished": 256000, "total": 2540748, "seconds": 103.37168802300585, "per_second": 2476.5001413445625} +{"event": "simulating", "finished": 320000, "total": 2540748, "seconds": 128.9114882920112, "per_second": 2482.323369621905} +{"event": "simulating", "finished": 384000, "total": 2540748, "seconds": 155.45839269000862, "per_second": 2470.114307470772} +{"event": "simulating", "finished": 448000, "total": 2540748, "seconds": 181.75726888100326, "per_second": 2464.8257687746523} +{"event": "simulating", "finished": 512000, "total": 2540748, "seconds": 208.45475100300973, "per_second": 2456.1685331537856} +{"event": "simulating", "finished": 576000, "total": 2540748, "seconds": 235.32138346901047, "per_second": 2447.7163592566317} +{"event": "simulating", "finished": 640000, "total": 2540748, "seconds": 262.4519051820098, "per_second": 2438.5420237515955} +{"event": "simulating", "finished": 704000, "total": 2540748, "seconds": 289.84847001700837, "per_second": 2428.8553255385104} +{"event": "simulating", "finished": 768000, "total": 2540748, "seconds": 317.6315823860059, "per_second": 2417.8955827719865} +{"event": "simulating", "finished": 832000, "total": 2540748, "seconds": 344.6452495400008, "per_second": 2414.0765065251103} +{"event": "simulating", "finished": 896000, "total": 2540748, "seconds": 374.1485946610046, "per_second": 2394.770454267819} +{"event": "simulating", "finished": 960000, "total": 2540748, "seconds": 403.83205806600745, "per_second": 2377.2258314447276} +{"event": "simulating", "finished": 1024000, "total": 2540748, "seconds": 433.15570000100706, "per_second": 2364.04600008177} +{"event": "simulating", "finished": 1088000, "total": 2540748, "seconds": 464.17551006301073, "per_second": 2343.9409801096713} +{"event": "simulating", "finished": 1152000, "total": 2540748, "seconds": 494.0727963810059, "per_second": 2331.6402126127814} +{"event": "simulating", "finished": 1216000, "total": 2540748, "seconds": 524.0464467370039, "per_second": 2320.405009081681} +{"event": "simulating", "finished": 1280000, "total": 2540748, "seconds": 555.5877757420094, "per_second": 2303.866384191966} +{"event": "simulating", "finished": 1344000, "total": 2540748, "seconds": 585.1307560179994, "per_second": 2296.922501811983} +{"event": "simulating", "finished": 1408000, "total": 2540748, "seconds": 616.1116516220063, "per_second": 2285.300069059283} +{"event": "simulating", "finished": 1472000, "total": 2540748, "seconds": 647.0996181110095, "per_second": 2274.765675642045} +{"event": "simulating", "finished": 1536000, "total": 2540748, "seconds": 678.553663965009, "per_second": 2263.638208103769} +{"event": "simulating", "finished": 1600000, "total": 2540748, "seconds": 710.1074411930022, "per_second": 2253.1801628665535} +{"event": "simulating", "finished": 1664000, "total": 2540748, "seconds": 743.2060770180105, "per_second": 2238.948323292135} +{"event": "simulating", "finished": 1728000, "total": 2540748, "seconds": 775.8935470520082, "per_second": 2227.1096422511837} +{"event": "simulating", "finished": 1792000, "total": 2540748, "seconds": 808.1588395120052, "per_second": 2217.3858805801997} +{"event": "simulating", "finished": 1856000, "total": 2540748, "seconds": 841.9081488150114, "per_second": 2204.5160183000085} +{"event": "simulating", "finished": 1920000, "total": 2540748, "seconds": 877.9566296410048, "per_second": 2186.8961804925207} +{"event": "simulating", "finished": 1984000, "total": 2540748, "seconds": 915.779460212012, "per_second": 2166.4604702323027} +{"event": "simulating", "finished": 2048000, "total": 2540748, "seconds": 951.8223102320044, "per_second": 2151.662109601954} +{"event": "simulating", "finished": 2112000, "total": 2540748, "seconds": 989.1265962980106, "per_second": 2135.2170772725667} +{"event": "simulating", "finished": 2176000, "total": 2540748, "seconds": 1027.6390424499987, "per_second": 2117.4750180882475} +{"event": "simulating", "finished": 2240000, "total": 2540748, "seconds": 1069.1954286969994, "per_second": 2095.033274440604} +{"event": "simulating", "finished": 2304000, "total": 2540748, "seconds": 1114.968340920008, "per_second": 2066.426386689035} +{"event": "simulating", "finished": 2368000, "total": 2540748, "seconds": 1174.43200450101, "per_second": 2016.2938262280331} +{"event": "simulating", "finished": 2432000, "total": 2540748, "seconds": 1238.0857895829977, "per_second": 1964.3226830178926} +{"event": "simulating", "finished": 2496000, "total": 2540748, "seconds": 1305.326204019002, "per_second": 1912.1657041090589} +{"event": "simulated", "finished": 2540748, "total": 2540748, "failed": 0, "seconds": 1358.7867831190088} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 21.41778596099175, "total_seconds": 1459.8969024010003} diff --git a/shared/package-files/bd/bdb3f11557fe0b1dbb9504cbedcacbee34e24fcc2bdb57732c6777efd05d8c4b/matched-S2-25k-full.log b/shared/package-files/bd/bdb3f11557fe0b1dbb9504cbedcacbee34e24fcc2bdb57732c6777efd05d8c4b/matched-S2-25k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..0fcd2b05777a24c2828abd2ab15f6acca4e23c1e --- /dev/null +++ b/shared/package-files/bd/bdb3f11557fe0b1dbb9504cbedcacbee34e24fcc2bdb57732c6777efd05d8c4b/matched-S2-25k-full.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 79.29785919499409} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 82.87598752000486} +ind meanD all=0.4887 dom=0.7244 non=0.2520 h5=0.6417 h20=0.7134 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6563 dom=0.7964 non=0.5156 h5=0.8444 h20=0.9085 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.4887 dom=0.7244 non=0.2520 h5=0.6417 h20=0.7134 | diff=+0.0000 [+0.0000,+0.0000] +agg Dmean all=0.6563 dom=0.7964 non=0.5156 h5=0.8444 h20=0.9085 | diff=+0.0000 [+0.0000,+0.0000] +ind gmean all=0.4887 dom=0.7244 non=0.2520 h5=0.6417 h20=0.7134 | diff=+0.0000 [+0.0000,+0.0000] +agg gmean all=0.6563 dom=0.7964 non=0.5156 h5=0.8444 h20=0.9085 | diff=+0.0000 [+0.0000,+0.0000] diff --git a/shared/package-files/bd/bdb4f432ecd56dd3da3fddc9ae59c076630581067a898dacf9d59eca0646434f/consensus_equivalence.py b/shared/package-files/bd/bdb4f432ecd56dd3da3fddc9ae59c076630581067a898dacf9d59eca0646434f/consensus_equivalence.py new file mode 100644 index 0000000000000000000000000000000000000000..788dffaf1fab4cbe0475c6cd8550eadc85d9dc6f --- /dev/null +++ b/shared/package-files/bd/bdb4f432ecd56dd3da3fddc9ae59c076630581067a898dacf9d59eca0646434f/consensus_equivalence.py @@ -0,0 +1,79 @@ +"""Package against lab for the cross-pool consensus term on the full validation fold. + +consensus_equivalence.py --package evals/fullfold/NAME --base evals/fullfold/BASE --lab evals/netprop/term-*.pkl --variant 10:3:half=0.5 + +Compares (i) the branch outputs of the package run with those of the base run (same saved +simulations), (ii) the term of the packaged consensus.py with the lab term of analysis/netprop.py +(an independent numpy implementation without the tie rule), (iii) the rank of the label in the +package's rankings with the lab's fused rank. +""" +import argparse +import json +import pickle +import sys +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'analysis')) +sys.path.insert(0, str(HERE.parent / 'pkg')) +import netprop +import scorelab + +ROOT = Path('/workspace/research') + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--package', required=True) + p.add_argument('--base', required=True) + p.add_argument('--lab', required=True) + p.add_argument('--variant', required=True) + p.add_argument('--weight', type=float, default=1.0) + args = p.parse_args() + queries, pools = netprop.load() + ev = scorelab.Evaluator(queries, pools) + load = lambda root, name: pickle.load(open(ROOT / root / 'pred' / f'{name}.pkl', 'rb')) + for name in ('distances', 'inverse', 'library', 'ion'): + a, b = load(args.package, name), load(args.base, name) + worst, same_none = 0.0, 0 + for q in queries: + x, y = a[q['query_id']], b[q['query_id']] + if x is None or y is None: + same_none += (x is None) == (y is None) + continue + both = np.isfinite(x) & np.isfinite(y) + assert np.array_equal(np.isfinite(x), np.isfinite(y)) + if both.any(): + worst = max(worst, float(np.max(np.abs(x[both] - y[both])))) + print(f'{name}: largest absolute difference package run - base run {worst:.3g}') + lab = pickle.load(open(ROOT / args.lab, 'rb')) + term_lab = lab['term'][args.variant] + term_pkg = load(args.package, 'consensus') + worst, covered, differ = 0.0, 0, 0 + for q, t in zip(queries, term_lab): + u = term_pkg[q['query_id']] + if (t is None) != (u is None): + differ += 1 + continue + if t is None: + continue + covered += 1 + worst = max(worst, float(np.max(np.abs(t - u)))) + print(f'consensus term: {covered} queries covered by both, coverage differs for {differ}, largest absolute difference {worst:.3g}') + pred = {name: load(args.base, name) for name in ('distances', 'inverse', 'library', 'ion')} + config = json.load(open(ROOT / 'builds/5Ms-I9b+I13-L-ion/model_config.json')) + base = netprop.released(queries, pools, pred, config) + fused = [b if (b is None or t is None) else b + args.weight * t for b, t in zip(base, term_lab)] + rank_lab = ev.ranks(fused, 1.0) + order = {json.loads(line)['query_id']: json.loads(line)['ranking'] for line in open(ROOT / args.package / 'rankings.jsonl')} + rank_pkg = np.array([order[q['query_id']].index(pools[q['candidate_pool_id']][ev.target[i]]['candidate_id']) for i, q in enumerate(queries)]) + print(f'label rank: package == lab for {int(np.sum(rank_pkg == rank_lab))} / {len(queries)} queries; Hit@1 package {np.mean(rank_pkg == 0):.4f} lab {np.mean(rank_lab == 0):.4f}; ' + f'Hit@5 {np.mean(rank_pkg < 5):.4f} / {np.mean(rank_lab < 5):.4f}; Hit@20 {np.mean(rank_pkg < 20):.4f} / {np.mean(rank_lab < 20):.4f}') + per_spectrum = ev.ranks(fused, 0.0) + print(f'per spectrum (no pool mean): base {np.mean(ev.ranks(base, 0.0) == 0):.4f} with the term {np.mean(per_spectrum == 0):.4f}') + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/bd/bdb956e0a53851eb8538fb16af1ee813d8f45e0449fa09d520b7ed78e48f9aa9/e74-fwd-union-1.log b/shared/package-files/bd/bdb956e0a53851eb8538fb16af1ee813d8f45e0449fa09d520b7ed78e48f9aa9/e74-fwd-union-1.log new file mode 100644 index 0000000000000000000000000000000000000000..4ff756d000572d4a4465dd69678827ac23509697 --- /dev/null +++ b/shared/package-files/bd/bdb956e0a53851eb8538fb16af1ee813d8f45e0449fa09d520b7ed78e48f9aa9/e74-fwd-union-1.log @@ -0,0 +1,10 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 46.97071259299992} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 50.25009319296805} +released forward distances all=0.6485 dom=0.8188 non=0.4776 h5=0.8464 h20=0.9093 macro=0.7773 +plain-100 all=0.6471 dom=0.8183 non=0.4753 h5=0.8458 h20=0.9085 | diff=-0.0014 [-0.0047,+0.0019] macro=0.7750 (-0.0024 [-0.0056, +0.0006]) pools +10 -18 merged=0 seconds=76 +o-freq5-100 all=0.6613 dom=0.8183 non=0.5037 h5=0.8256 h20=0.8964 | diff=+0.0128 [-0.0062,+0.0331] macro=0.7770 (-0.0003 [-0.0053, +0.0047]) pools +35 -36 merged=7962 seconds=55 +o-freq5-50 all=0.6532 dom=0.8192 non=0.4865 h5=0.8209 h20=0.9005 | diff=+0.0047 [-0.0145,+0.0234] macro=0.7770 (-0.0003 [-0.0038, +0.0033]) pools +19 -20 merged=7962 seconds=26 +o-sqrt5-100 all=0.6494 dom=0.8171 non=0.4811 h5=0.8250 h20=0.8917 | diff=+0.0009 [-0.0166,+0.0197] macro=0.7761 (-0.0012 [-0.0059, +0.0032]) pools +27 -31 merged=7962 seconds=78 +o-mean5-100 all=0.6504 dom=0.8156 non=0.4846 h5=0.8222 h20=0.9039 | diff=+0.0019 [-0.0167,+0.0233] macro=0.7755 (-0.0018 [-0.0065, +0.0030]) pools +30 -36 merged=7962 seconds=136 +d-sqrt10-100 all=0.6436 dom=0.8125 non=0.4740 h5=0.8452 h20=0.9098 | diff=-0.0049 [-0.0113,+0.0018] macro=0.7732 (-0.0041 [-0.0097, +0.0012]) pools +39 -53 merged=9086 seconds=143 +d-mean10-50 all=0.6397 dom=0.8023 non=0.4764 h5=0.8456 h20=0.9090 | diff=-0.0088 [-0.0178,-0.0000] macro=0.7741 (-0.0032 [-0.0086, +0.0021]) pools +39 -50 merged=9086 seconds=144 diff --git a/shared/package-files/bd/bdbf5dcfdeea590eae26658c05adbc31dfe2a2ca86296fa1e60b42b5694f7216/prepare_inv_real_train.log b/shared/package-files/bd/bdbf5dcfdeea590eae26658c05adbc31dfe2a2ca86296fa1e60b42b5694f7216/prepare_inv_real_train.log new file mode 100644 index 0000000000000000000000000000000000000000..1a3cae30a1d05cd9a7f85a4f4957ad93b51e8c3b --- /dev/null +++ b/shared/package-files/bd/bdbf5dcfdeea590eae26658c05adbc31dfe2a2ca86296fa1e60b42b5694f7216/prepare_inv_real_train.log @@ -0,0 +1,20 @@ +{ + "schema": "allcond-inverse-real/v1", + "fold": "train", + "spectra": 194119, + "structures": 25046, + "skipped": { + "structure": 0, + "adduct": 0 + }, + "ppm": 20.0, + "floor": 0.004, + "max_peaks": 24, + "mean_selected_peaks": 24.472833674189545, + "mean_annotated_peaks": 14.610517260031218, + "no_annotated_peak": 367, + "mean_explained_intensity": 0.8166390129725885, + "source_sha256": "de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc", + "sha256": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "elapsed_seconds": 11.086755411000922 +} diff --git a/shared/package-files/bd/bdbf5dcfdeea590eae26658c05adbc31dfe2a2ca86296fa1e60b42b5694f7216/real-train.manifest.json b/shared/package-files/bd/bdbf5dcfdeea590eae26658c05adbc31dfe2a2ca86296fa1e60b42b5694f7216/real-train.manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..1a3cae30a1d05cd9a7f85a4f4957ad93b51e8c3b --- /dev/null +++ b/shared/package-files/bd/bdbf5dcfdeea590eae26658c05adbc31dfe2a2ca86296fa1e60b42b5694f7216/real-train.manifest.json @@ -0,0 +1,20 @@ +{ + "schema": "allcond-inverse-real/v1", + "fold": "train", + "spectra": 194119, + "structures": 25046, + "skipped": { + "structure": 0, + "adduct": 0 + }, + "ppm": 20.0, + "floor": 0.004, + "max_peaks": 24, + "mean_selected_peaks": 24.472833674189545, + "mean_annotated_peaks": 14.610517260031218, + "no_annotated_peak": 367, + "mean_explained_intensity": 0.8166390129725885, + "source_sha256": "de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc", + "sha256": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "elapsed_seconds": 11.086755411000922 +} diff --git a/shared/package-files/bd/bdf638298ee003fab5e694dd921cbc7ce84e0bc29b8c1b0acae0f348a47013f7/README.md b/shared/package-files/bd/bdf638298ee003fab5e694dd921cbc7ce84e0bc29b8c1b0acae0f348a47013f7/README.md new file mode 100644 index 0000000000000000000000000000000000000000..15805d1df27c3f114b0f5851d51428d170a58e0a --- /dev/null +++ b/shared/package-files/bd/bdf638298ee003fab5e694dd921cbc7ce84e0bc29b8c1b0acae0f348a47013f7/README.md @@ -0,0 +1,3 @@ +# Trained Fourier-DeepSets retrieval model + +Initialized from scratch on the provided train fold; selected on validation loss. See training_summary.json for the data and recipe identity. diff --git a/shared/package-files/be/be05ba6adae5740727f1bb5408c77b2de41c28b16a192a49d944a0c77feb0b06/train_inv.py b/shared/package-files/be/be05ba6adae5740727f1bb5408c77b2de41c28b16a192a49d944a0c77feb0b06/train_inv.py new file mode 100644 index 0000000000000000000000000000000000000000..9e86f3cb386a29add25df0c23d05e681826332ec --- /dev/null +++ b/shared/package-files/be/be05ba6adae5740727f1bb5408c77b2de41c28b16a192a49d944a0c77feb0b06/train_inv.py @@ -0,0 +1,407 @@ +#!/usr/bin/env python3 +"""Train the inverse branch (``pkg/inverse.FormulaFormer``): annotated spectrum + formula -> Morgan-4096. + +Training rows: experimental train-fold spectra annotated under their label formula and the +supplied synthetic corpus (``prepare_inv.py``). Validation: (a) fingerprint loss / cosine on +validation spectra annotated under the label formula (diagnostic), (b) the real retrieval +protocol on an inference-style store (every candidate scored with the fingerprint predicted +under its own formula). Validation never contributes a gradient. +""" +import argparse +import copy +import hashlib +import json +import math +import sys +import time +from pathlib import Path + +import numpy as np +import torch +import torch.nn.functional as F + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +sys.path.insert(0, str(HERE)) +import inverse +import invdata +from invrun import PoolStore + + +def targets_of(input_root, cache): + """Index of the labelled candidate of every validation query (evaluation only).""" + cache = Path(cache) + if cache.exists(): + return np.load(cache) + labels = {} + for line in open('/workspace/data/validation.jsonl'): + row = json.loads(line) + labels[row['query_id']] = hashlib.sha256(row['target_smiles'].encode()).hexdigest() + ids = {} + for line in open(Path(input_root) / 'candidate_pools.jsonl'): + pool = json.loads(line) + ids[pool['candidate_pool_id']] = {c['candidate_id']: n for n, c in enumerate(pool['candidates'])} + target = np.array([ids[q['candidate_pool_id']][labels[q['query_id']]] + for q in map(json.loads, open(Path(input_root) / 'queries.jsonl'))], dtype=np.int32) + np.save(cache, target) + return target + + +def retrieval(store, target, dist, pools=None): + """Hit@1 per spectrum and with the pool mean; domain split is reported by the caller.""" + todo = range(len(store.members)) if pools is None else pools + ind, agg, n = 0, 0, 0 + for s in todo: + members = store.members[s] + d = np.stack([dist[i] for i in members]) + t = target[members] + mean = d.mean(0) + ind += int((np.argmin(d, axis=1) == t).sum()) # ties are measure-zero for float scores + agg += int((np.argmin(mean) == t).sum()) + n += len(members) + return ind / n, agg / n + + +def isomer_library(real, synth): + """Same-formula groups over the label molecules of the train fold and of the synthetic corpus. + + Returns (fps [M, bytes], order [M], start [M], size [M]): molecule m (train molecules first, + then synthetic ones) shares its formula with the molecules order[start[m] : start[m] + size[m]]. + No validation or test structure is involved. + """ + def roots(store): + mol = store['mol'].cpu().numpy() + first = np.full(store['fps'].shape[0], -1, dtype=np.int64) + first[mol[::-1]] = np.arange(len(mol))[::-1] + return store['root'].cpu().numpy()[first] + + parts = [roots(real)] + ([roots(synth)] if synth is not None else []) + _, group, counts = np.unique(np.concatenate(parts), axis=0, return_inverse=True, return_counts=True) + group = group.reshape(-1) + order = np.argsort(group, kind='stable') + begin = np.concatenate([[0], np.cumsum(counts)[:-1]]) + device = real['fps'].device + fps = torch.cat([real['fps']] + ([synth['fps']] if synth is not None else [])) + return (fps, torch.from_numpy(order).to(device), torch.from_numpy(begin[group]).to(device), + torch.from_numpy(counts[group]).to(device)) + + +def contrast_term(logits, bits, molecule, library, k, tau, generator): + """InfoNCE of the packaged score (cosine between predicted bit probabilities and a candidate + fingerprint) against ``k`` molecules sampled from the label's own formula group. + + Returns (loss per row [B], target-first indicator [B], rows with at least one decoy [B]).""" + fps, order, start, size = library + pick = (torch.rand(len(molecule), k, device=logits.device, generator=generator) * size[molecule].unsqueeze(1)).long() + decoy = order[start[molecule].unsqueeze(1) + pick.minimum(size[molecule].unsqueeze(1) - 1)] + packed = fps[decoy] # [B, k, bytes] + valid = (packed != fps[molecule].unsqueeze(1)).any(-1) # same fingerprint (or the label itself) = no decoy + cand = torch.cat([bits.unsqueeze(1), inverse.unpack_bits(packed)], dim=1) # [B, 1 + k, bits] + prob = torch.sigmoid(logits.float()) + sim = torch.einsum('bd,bkd->bk', F.normalize(prob, dim=-1), F.normalize(cand, dim=-1)) / tau + keep = torch.cat([torch.ones_like(valid[:, :1]), valid], dim=1) + sim = sim.masked_fill(~keep, float('-inf')) + return -F.log_softmax(sim, dim=1)[:, 0], sim.argmax(1) == 0, valid.any(1) + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--store', type=Path, default=Path('/workspace/research/inv')) + p.add_argument('--out', type=Path, required=True) + p.add_argument('--pools', default='pools-validation-input.npz') + p.add_argument('--input', type=Path, default=Path('/workspace/research/validation-input')) + p.add_argument('--steps', type=int, default=100000) + p.add_argument('--batch', type=int, default=512) + p.add_argument('--real-frac', type=float, default=0.2) + p.add_argument('--real-balance', type=float, default=0.5, help='real sampling weight = spectra_of_molecule ** -x') + p.add_argument('--no-synth', action='store_true') + p.add_argument('--target', default='', + help='E56: alternative fingerprint target (inv/alt-NAME built by altfp.py); empty = released Morgan-4096') + p.add_argument('--heavy-boost', type=float, default=1.0, + help='E53: sampling weight of a row x (1 + (boost - 1) * clip((mass - lo) / (hi - lo), 0, 1)); 1 = off') + p.add_argument('--synth-structures', type=float, default=1.0, + help='E59: keep only this fraction of the synthetic STRUCTURES (hash of the structure slot); 1 = all') + p.add_argument('--extra-store', type=Path, + help='E60: additional simulated store in the prepare_inv layout (selfsim.py annotate: our own forward simulations of supplied structures)') + p.add_argument('--extra-frac', type=float, default=0.0, help='E60: share of the synthetic part of every batch drawn from --extra-store') + p.add_argument('--heavy-lo', type=float, default=450.0) + p.add_argument('--heavy-hi', type=float, default=850.0) + p.add_argument('--lr', type=float, default=6e-4) + p.add_argument('--weight-decay', type=float, default=1e-4) + p.add_argument('--warmup', type=int, default=2000) + p.add_argument('--ema', type=float, default=0.999) + p.add_argument('--dim', type=int, default=512) + p.add_argument('--layers', type=int, default=6) + p.add_argument('--heads', type=int, default=8) + p.add_argument('--dropout', type=float, default=0.1) + p.add_argument('--peak-drop', type=float, default=0.3) + p.add_argument('--truncate', type=float, default=0.3) + p.add_argument('--min-keep', type=int, default=4) + p.add_argument('--jitter', type=float, default=0.15) + p.add_argument('--synth-energy-drop', type=float, default=0.3) + p.add_argument('--synth-instrument-drop', type=float, default=0.3) + p.add_argument('--validate-every', type=int, default=5000) + p.add_argument('--retrieve-every', type=int, default=10000) + p.add_argument('--retrieve-pools', type=int, default=0, help='evaluate retrieval on every k-th pool only (0 = all)') + p.add_argument('--seed', type=int, default=1) + p.add_argument('--contrast-weight', type=float, default=0.0, + help='weight of the same-formula decoy InfoNCE term on the cosine score (0 = off)') + p.add_argument('--contrast-k', type=int, default=31, help='decoys sampled per spectrum from its formula group') + p.add_argument('--contrast-tau', type=float, default=0.05) + p.add_argument('--noise-rate', type=float, default=0.0, help='E68: share of the simulated rows that get spurious annotated peaks') + p.add_argument('--noise-max', type=int, default=12) + p.add_argument('--noise-scatter', type=float, default=0.35) + p.add_argument('--noise-shape', type=float, default=2.0) + p.add_argument('--noise-real-rate', type=float, default=0.0, help='E70: share of the real rows that get the same spurious peaks') + p.add_argument('--synth-peak-drop', type=float, default=-1.0, help='E70: peak-drop bound of the simulated rows (default: --peak-drop)') + p.add_argument('--synth-jitter', type=float, default=-1.0, help='E70: log-normal intensity jitter of the simulated rows (default: --jitter)') + p.add_argument('--synth-rank-drop', type=float, default=0.0, + help='E70: rank-dependent thinning of the simulated rows; per-sample strength uniform in [0, value], 1 = the train-fold share (--rank-keep)') + p.add_argument('--rank-keep', default='inv/rank_keep.json') + p.add_argument('--noise-near', type=float, default=0.0, help='E70: share of the spurious peaks that are a small formula step away from a kept peak') + p.add_argument('--noise-deltas', default='inv/noise_deltas.json', help='E70: train-fold table of those steps (analysis/noise_deltas.py)') + p.add_argument('--merge-rate', type=float, default=0.0, + help='E72: share of the rows replaced by the union spectrum of 2..merge-max rows of the same molecule, adduct and instrument') + p.add_argument('--merge-max', type=int, default=8) + p.add_argument('--max-peaks', type=int, default=24, help='E73: peaks per spectrum read from the stores (the stores must hold as many)') + p.add_argument('--sim-max-peaks', type=int, default=0, help='E73: peaks per simulated row (corpus and --extra-store); 0 = --max-peaks') + p.add_argument('--merge-agg', default='mean', choices=('mean', 'sqrt'), help='E72: union intensity = mean of the raw or of the square-root intensity') + p.add_argument('--init', type=Path, help='start model and EMA from the EMA weights of one of OUR OWN runs (fresh optimizer)') + p.add_argument('--max-steps-this-run', type=int, default=0) + args = p.parse_args() + + torch.manual_seed(args.seed) + np.random.seed(args.seed) + device = torch.device('cuda') + torch.backends.cuda.matmul.allow_tf32 = True + torch.backends.cudnn.allow_tf32 = True + args.out.mkdir(parents=True, exist_ok=True) + started = time.monotonic() + real = invdata.load_padded(args.store / 'real-train.npz', device, args.max_peaks) + val = invdata.load_padded(args.store / 'real-validation.npz', device, args.max_peaks) + sim_peaks = args.sim_max_peaks or args.max_peaks + synth = None if args.no_synth else invdata.load_padded(args.store / 'synth.npz', device, sim_peaks, pad_to=args.max_peaks) + per_mol = torch.bincount(real['mol']).float() + real_weight = per_mol[real['mol']] ** -args.real_balance + synth_weight = None + if args.heavy_boost != 1.0: + mono = torch.tensor(inverse.MONO, dtype=torch.float32, device=device) + + def ramp(store): + mass = store['root'].float() @ mono + return 1.0 + (args.heavy_boost - 1.0) * ((mass - args.heavy_lo) / (args.heavy_hi - args.heavy_lo)).clamp(0, 1) + real_weight = real_weight * ramp(real) + if synth is not None: + synth_weight = ramp(synth) + if synth is not None and args.synth_structures < 1.0: + slot = synth['mol'].long() + keep = ((slot * 2654435761) % 4294967296).double() / 4294967296.0 < args.synth_structures + synth_weight = keep.float() if synth_weight is None else synth_weight * keep.float() + print(json.dumps({'synth_structures_kept': int(torch.unique(slot[keep]).numel()), 'synth_rows_kept': int(keep.sum())}), flush=True) + extra_store = invdata.load_padded(args.extra_store, device, sim_peaks, pad_to=args.max_peaks) if args.extra_store and args.extra_frac > 0 else None + if extra_store is not None: + assert synth is not None and not args.target and extra_store['fps'].shape[1] == synth['fps'].shape[1] + print(json.dumps({'extra_rows': int(extra_store['root'].shape[0]), 'extra_structures': int(torch.unique(extra_store['mol']).numel())}), flush=True) + pools = PoolStore(args.store / args.pools, device, max_peaks=args.max_peaks) if args.pools else None + fp_bits = inverse.FP_BITS + if args.target: + alt = args.store / f'alt-{args.target}' + for store, name in ((real, 'real-train'), (val, 'real-validation'), (synth, 'synth')): + if store is not None: + fps = torch.from_numpy(np.load(alt / f'{name}.fps.npy')).to(device) + assert fps.shape[0] == store['fps'].shape[0] + store['fps'] = fps + fp_bits = real['fps'].shape[1] * 8 + if pools is not None: + fps = torch.from_numpy(np.load(alt / (Path(args.pools).stem + '.cand_fps.npy'))).to(device) + assert fps.shape[0] == pools.cand_fps.shape[0] + pools.cand_fps = fps + target = targets_of(args.input, args.store / f'targets-{args.input.name}.npy') if pools else None + subset = None if not args.retrieve_pools else list(range(0, len(pools.members), args.retrieve_pools)) + domain = None + + model = inverse.FormulaFormer(dim=args.dim, layers=args.layers, heads=args.heads, dropout=args.dropout, fp_bits=fp_bits).to(device) + ema = copy.deepcopy(model).eval() + for q in ema.parameters(): + q.requires_grad_(False) + decay, no_decay = [], [] + for name, q in model.named_parameters(): + (no_decay if q.ndim < 2 else decay).append(q) + opt = torch.optim.AdamW([{'params': decay, 'weight_decay': args.weight_decay}, {'params': no_decay, 'weight_decay': 0.0}], + lr=args.lr, betas=(0.9, 0.98)) + schedule = lambda s: min(1.0, (s + 1) / args.warmup) * (0.02 + 0.98 * 0.5 * (1 + math.cos(math.pi * min(1.0, s / args.steps)))) + step = 0 + last = args.out / 'last.pt' + if args.init and not last.exists(): + state = torch.load(args.init, map_location=device, weights_only=True) + model.load_state_dict(state['ema']) + ema.load_state_dict(state['ema']) + if last.exists(): + state = torch.load(last, map_location=device) + model.load_state_dict(state['model']) + ema.load_state_dict(state['ema']) + opt.load_state_dict(state['opt']) + step = state['step'] + recipe = {'args': {k: str(v) if isinstance(v, Path) else v for k, v in vars(args).items()}, + 'parameters': sum(q.numel() for q in model.parameters()), 'model': model.config, + 'real_rows': int(real['root'].shape[0]), 'synth_rows': 0 if synth is None else int(synth['root'].shape[0]), + 'stores': {f.name: json.loads(f.read_text()).get('sha256') for f in sorted(args.store.glob('*.manifest.json'))}, + 'gpu': torch.cuda.get_device_name(0), 'load_seconds': time.monotonic() - started} + if args.init: + recipe['init'] = {'path': str(args.init), 'sha256': hashlib.sha256(args.init.read_bytes()).hexdigest()} + if extra_store is not None: + manifest = Path(str(args.extra_store).replace('.npz', '.manifest.json')) + recipe['extra_store'] = {'path': str(args.extra_store), 'rows': int(extra_store['root'].shape[0]), + 'manifest': json.loads(manifest.read_text()) if manifest.exists() else None} + library = isomer_library(real, synth) if args.contrast_weight > 0 else None + if library is not None: + recipe['isomer_library'] = {'molecules': int(library[0].shape[0]), + 'with_same_formula_molecule': float((library[3] > 1).float().mean())} + (args.out / 'recipe.json').write_text(json.dumps(recipe, indent=1) + '\n') + print(json.dumps(recipe), flush=True) + + gen = torch.Generator(device=device) + gen.manual_seed(args.seed * 1000003 + step) + n_real = args.batch if synth is None else max(1, round(args.batch * args.real_frac)) + n_synth = args.batch - n_real + n_extra = round(n_synth * args.extra_frac) if extra_store is not None else 0 + n_synth -= n_extra + aug_real = dict(peak_drop=args.peak_drop, truncate=args.truncate, min_keep=args.min_keep, jitter=args.jitter) + aug_synth = dict(aug_real, energy_drop=args.synth_energy_drop, instrument_drop=args.synth_instrument_drop) + if args.synth_peak_drop >= 0: + aug_synth['peak_drop'] = args.synth_peak_drop + if args.synth_jitter >= 0: + aug_synth.update(jitter=args.synth_jitter, renorm=True) + if args.merge_rate > 0: + merge = dict(merge_rate=args.merge_rate, merge_max=args.merge_max, merge_mean_raw=args.merge_agg == 'mean') + aug_real.update(merge) + aug_synth.update(merge) + for name, store in (('real', real), ('synth', synth), ('extra', extra_store)): + if store is not None: + print(json.dumps({'merge_groups': name, **invdata.add_groups(store)}), flush=True) + if args.synth_rank_drop > 0: + table = json.load(open(args.rank_keep)) + assert table['schema'] == 'allcond-inverse-rank-keep/v1' and len(table['keep']) == 3 + assert invdata.SODIUM_INDEX == inverse.ADDUCTS.index('[M+Na]+') + invdata.RANK_KEEP = torch.tensor(table['keep'], dtype=torch.float32) + aug_synth['rank_drop'] = args.synth_rank_drop + if args.noise_rate > 0 or args.noise_real_rate > 0: + assert inverse.H == invdata.H_INDEX + invdata.RDBE_SIGN = inverse.RDBE_SIGN + noise = dict(noise_max=args.noise_max, noise_scatter=args.noise_scatter, noise_shape=args.noise_shape) + if args.noise_near > 0: + table = json.load(open(args.noise_deltas)) + assert table['elements'] == list(inverse.ELEMENTS) + invdata.NOISE_DELTAS = torch.tensor(table['deltas'], dtype=torch.long) + invdata.NOISE_DELTA_WEIGHTS = torch.tensor(table['weights'], dtype=torch.float32) + noise['noise_near'] = args.noise_near + if args.noise_rate > 0: + aug_synth.update(noise, noise_rate=args.noise_rate) + if args.noise_real_rate > 0: + aug_real = dict(aug_real, noise_rate=args.noise_real_rate, **noise) + + @torch.no_grad() + def validate(net): + net.eval() + loss, cosine, n = 0.0, 0.0, val['root'].shape[0] + for start in range(0, n, 4096): + index = torch.arange(start, min(start + 4096, n), device=device) + with torch.autocast('cuda', dtype=torch.bfloat16): + logits = net(*invdata.batch_of(val, index)).float() + bits = inverse.unpack_bits(val['fps'][val['mol'][index]]) + loss += F.binary_cross_entropy_with_logits(logits, bits, reduction='none').mean(1).sum().item() + cosine += F.cosine_similarity(torch.sigmoid(logits), bits, dim=-1).sum().item() + return loss / n, cosine / n + + def checkpoint(path, full): + state = {'ema': ema.state_dict(), 'config': model.config, 'step': step} + if full: + state.update(model=model.state_dict(), opt=opt.state_dict()) + tmp = path.with_suffix('.tmp') + torch.save(state, tmp) + tmp.replace(path) + + log = (args.out / 'metrics.jsonl').open('a') + run_started, run_step, window = time.monotonic(), step, [] + model.train() + while step < args.steps: + for group in opt.param_groups: + group['lr'] = args.lr * schedule(step) + index = torch.multinomial(real_weight, n_real, replacement=True, generator=gen) + parts = [invdata.batch_of(real, index, aug_real, gen)] + mols = [real['fps'][real['mol'][index]]] + ids = [real['mol'][index]] + if n_synth: + if synth_weight is None: + index = torch.randint(0, synth['root'].shape[0], (n_synth,), device=device, generator=gen) + else: + index = torch.multinomial(synth_weight, n_synth, replacement=True, generator=gen) + parts.append(invdata.batch_of(synth, index, aug_synth, gen)) + mols.append(synth['fps'][synth['mol'][index]]) + ids.append(synth['mol'][index] + real['fps'].shape[0]) + if n_extra: + index = torch.randint(0, extra_store['root'].shape[0], (n_extra,), device=device, generator=gen) + parts.append(invdata.batch_of(extra_store, index, aug_synth, gen)) + mols.append(extra_store['fps'][extra_store['mol'][index]]) + ids.append(extra_store['mol'][index] + real['fps'].shape[0]) + inputs = [torch.cat(x) for x in zip(*parts)] + bits = inverse.unpack_bits(torch.cat(mols)) + with torch.autocast('cuda', dtype=torch.bfloat16): + logits = model(*inputs) + per = F.binary_cross_entropy_with_logits(logits.float(), bits, reduction='none').mean(1) + loss = per.mean() + extra = (0.0, 0.0, 0.0, 0.0) + if library is not None: + nce, first, has = contrast_term(logits, bits, torch.cat(ids), library, args.contrast_k, args.contrast_tau, gen) + loss = loss + args.contrast_weight * nce.mean() + real_has, synth_has = has[:n_real], has[n_real:] + extra = (nce[:n_real][real_has].mean().item() if real_has.any() else 0.0, + nce[n_real:][synth_has].mean().item() if synth_has.any() else 0.0, + first[:n_real][real_has].float().mean().item() if real_has.any() else 0.0, + first[n_real:][synth_has].float().mean().item() if synth_has.any() else 0.0) + opt.zero_grad(set_to_none=True) + loss.backward() + torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) + opt.step() + step += 1 + with torch.no_grad(): + d = min(args.ema, (1 + step) / (10 + step)) + for a, b in zip(ema.parameters(), model.parameters()): + a.lerp_(b, 1 - d) + window.append((loss.item(), per[:n_real].mean().item(), per[n_real:n_real + n_synth].mean().item() if n_synth else 0.0) + extra + + (per[n_real + n_synth:].mean().item() if n_extra else 0.0,)) + if step % 200 == 0: + w = np.mean(window, axis=0) + window = [] + row = {'step': step, 'loss': float(w[0]), 'loss_real': float(w[1]), 'loss_synth': float(w[2]), + 'lr': opt.param_groups[0]['lr'], 'elapsed': time.monotonic() - started, + 'steps_per_second': (step - run_step) / (time.monotonic() - run_started)} + if library is not None: + row.update(nce_real=float(w[3]), nce_synth=float(w[4]), first_real=float(w[5]), first_synth=float(w[6])) + if n_extra: + row['loss_extra'] = float(w[7]) + log.write(json.dumps(row) + '\n') + log.flush() + if step % args.validate_every == 0 or step == args.steps: + row = {'step': step, 'elapsed': time.monotonic() - started} + row['val_loss'], row['val_cos'] = validate(model) + row['val_loss_ema'], row['val_cos_ema'] = validate(ema) + if pools is not None and (step % args.retrieve_every == 0 or step == args.steps): + tick = time.monotonic() + cos, nll = pools.distances(ema, subset) + row['ind_cos'], row['agg_cos'] = retrieval(pools, target, cos, subset) + row['ind_nll'], row['agg_nll'] = retrieval(pools, target, nll, subset) + row['retrieval_seconds'] = time.monotonic() - tick + checkpoint(args.out / f'step-{step:07d}-ema.pt', False) + print(json.dumps(row), flush=True) + with (args.out / 'validation.jsonl').open('a') as stream: + stream.write(json.dumps(row) + '\n') + checkpoint(last, True) + model.train() + if args.max_steps_this_run and step - run_step >= args.max_steps_this_run: + break + checkpoint(last, True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/be/be2b4d0f8e0327756f0c160f3bffbec83068070e063caf6504eb48142d50be9f/pool_weights.py b/shared/package-files/be/be2b4d0f8e0327756f0c160f3bffbec83068070e063caf6504eb48142d50be9f/pool_weights.py new file mode 100644 index 0000000000000000000000000000000000000000..aab625bc38e86cdc0e4c314cbd54a8b3baeaed9a --- /dev/null +++ b/shared/package-files/be/be2b4d0f8e0327756f0c160f3bffbec83068070e063caf6504eb48142d50be9f/pool_weights.py @@ -0,0 +1,94 @@ +"""Weighted pooling of the inverse branch's predicted fingerprints (development only). + +pool_weights.py CHECKPOINT POOLS.npz QUERIES.jsonl OUT.pkl [--batch 2048] + +The release averages the predicted bit probabilities of all spectra of a pool with equal +weights ("pooled"). Here the average is weighted per spectrum: + + uniform equal weights (the release; must reproduce the cached `pooled` distances) + fusionw the fusion weights themselves: 0.75 for [M+H]+ spectra with a recorded collision + energy, max(0.05, 0.5 / n_spectra) otherwise (no new constant) + domonly domain spectra only when the pool has any (weight 0 for the others) + a0.25, a0.5 weight 1 for domain spectra, 0.25 / 0.5 for the others + +Only pools that contain both kinds of spectra are affected. Output: {scheme: [vector per query]}. +""" +import argparse +import json +import pickle +import sys +import time +from pathlib import Path + +import numpy as np +import torch + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +import inverse +import invrun + +SCHEMES = ('uniform', 'fusionw', 'domonly', 'a0.25', 'a0.5') + + +def weights(domain, scheme): + n = len(domain) + if scheme == 'uniform' or domain.all() or not domain.any(): + return np.ones(n) + if scheme == 'fusionw': + return np.where(domain, 0.75, max(0.05, 0.5 / n)) + if scheme == 'domonly': + return domain.astype(float) + return np.where(domain, 1.0, float(scheme[1:])) + + +@torch.no_grad() +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('checkpoint', type=Path) + p.add_argument('pools', type=Path) + p.add_argument('queries', type=Path) + p.add_argument('out', type=Path) + p.add_argument('--batch', type=int, default=2048) + args = p.parse_args() + device = torch.device('cuda') + model = invrun.load_model(args.checkpoint, device) + store = invrun.PoolStore(args.pools, device) + domain = np.array([(q['adduct'] == '[M+H]+') and (q['collision_energy'] is not None) + for q in map(json.loads, args.queries.open())]) + assert len(domain) == store.queries + tick = time.monotonic() + out = {name: [None] * store.queries for name in SCHEMES} + mixed = 0 + for group in store.groups(None, 6000): + low, high = int(store.pair_start[group[0]]), int(store.pair_start[group[-1] + 1]) + logits = store.logits(model, low, high, batch=args.batch) + for s in group: + members = store.members[s] + nq, nf = len(members), int(store.formula_start[s + 1] - store.formula_start[s]) + if nq == 0 or nf == 0: + continue + prob = torch.sigmoid(logits[int(store.pair_start[s]) - low:int(store.pair_start[s + 1]) - low].view(nq, nf, -1)) + d = domain[members] + is_mixed = d.any() and not d.all() + mixed += int(is_mixed) + names = SCHEMES if is_mixed else ('uniform',) + stack = [] + for name in names: + w = torch.from_numpy(weights(d, name)).to(prob) + stack.append((prob * (w / w.sum()).view(-1, 1, 1)).sum(0)) + part = torch.logit(torch.stack(stack).clamp(1e-6, 1 - 1e-6)) + cs = slice(int(store.cand_start[s]), int(store.cand_start[s + 1])) + c, _ = inverse.pool_distances(part, store.cand_formula[cs], inverse.unpack_bits(store.cand_fps[cs])) + c = c.cpu().numpy() + for n, name in enumerate(SCHEMES): + vector = c[n] if is_mixed else c[0] + for qi in members: + out[name][qi] = vector + print(f'{store.queries} queries, {mixed} mixed pools, {time.monotonic() - tick:.1f} s') + with args.out.open('wb') as stream: + pickle.dump(out, stream) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/be/be49cb0c3f40cc9b44574140fc94154cd1f5c638c4e52bb82a469e2ffad40963/recur-mop-10.log b/shared/package-files/be/be49cb0c3f40cc9b44574140fc94154cd1f5c638c4e52bb82a469e2ffad40963/recur-mop-10.log new file mode 100644 index 0000000000000000000000000000000000000000..ab3923da9d75434985058fd75db408781ad0ab48 --- /dev/null +++ b/shared/package-files/be/be49cb0c3f40cc9b44574140fc94154cd1f5c638c4e52bb82a469e2ffad40963/recur-mop-10.log @@ -0,0 +1,2 @@ +merged tol 10 mDa: 7962 of 19429 spectra in groups of >= 3; peaks 139302 -> 853636; energy set missing for 0; 0 s +wrote /workspace/research/inv/recur/mop-10.npz 171 s diff --git a/shared/package-files/be/be9328b817c24323b3c2df9867a2c4547f84a1238282f932862277ec81be3036/build-5Ms-I9b+I13-L-ion.cmd b/shared/package-files/be/be9328b817c24323b3c2df9867a2c4547f84a1238282f932862277ec81be3036/build-5Ms-I9b+I13-L-ion.cmd new file mode 100644 index 0000000000000000000000000000000000000000..c0c7d9e771ec2be10b6306950c7c555be87a2802 --- /dev/null +++ b/shared/package-files/be/be9328b817c24323b3c2df9867a2c4547f84a1238282f932862277ec81be3036/build-5Ms-I9b+I13-L-ion.cmd @@ -0,0 +1 @@ +/opt/glacier/bin/python allcond/publish.py build --checkpoint runs/B-all-b32/checkpoints/step-0020000-ema.ckpt --checkpoint runs/B-all-b32/checkpoints/step-0030000-ema.ckpt --checkpoint runs/B2-all-b32-seed2/checkpoints/step-0020000-ema.ckpt --checkpoint runs/B2-all-b32-seed2/checkpoints/step-0030000-ema.ckpt --checkpoint runs/S2-B20k-synth/checkpoints/step-0030000-ema.ckpt --inverse runs/I9b-ff512x6-real08-corpus2+train3/step-0050000-ema.pt --inverse runs/I13-ff512x6-real08-corpus2+train3-seed2/step-0050000-ema.pt --library library/train-library.pt --ion-table inv/ion_error_table.json --set pool_aggregation=1.0 --set 'views=[{"precursor_window": 0.5, "pred_power": 0.75, "match_ppm": 20, "match_floor_mda": 4, "match_by_instrument": {"Orbitrap": [10, 1]}}]' --set 'inverse={"pooled": true, "score": {"members": "probability", "power": 0.7}, "weight_domain": 0.75, "weight_other": 0.05, "weight_other_single": 0.5, "batch": 2048}' --set 'ensemble="prediction"' --set 'library={"kind": "sum", "k": 20, "top": 32, "power": 6, "debias": true, "weight_domain": 0.0, "weight_other": 0.4, "weight_other_single": 0.0}' --set 'ion={"weight_domain": 0.05, "weight_other": 0.01}' --output builds/5Ms-I9b+I13-L-ion diff --git a/shared/package-files/be/beac1fff91b9086fb8067fb5d80227ca1df46738e3e7a5c170c68eb0b5bd1ea1/anchor-B2-20k-v1.log b/shared/package-files/be/beac1fff91b9086fb8067fb5d80227ca1df46738e3e7a5c170c68eb0b5bd1ea1/anchor-B2-20k-v1.log new file mode 100644 index 0000000000000000000000000000000000000000..9ac795ba239ef44b68bf35dd7d2794959740abf0 --- /dev/null +++ b/shared/package-files/be/beac1fff91b9086fb8067fb5d80227ca1df46738e3e7a5c170c68eb0b5bd1ea1/anchor-B2-20k-v1.log @@ -0,0 +1,16 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 60.85314747400116} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 65.19523474799644} +ind noprec_pp0.75 all=0.4646 dom=0.6991 non=0.2292 h5=0.6182 h20=0.7049 | diff=+0.0000 [+0.0000,+0.0000] +agg noprec_pp0.75 all=0.5955 dom=0.7935 non=0.3966 h5=0.7737 h20=0.9059 | diff=+0.0000 [+0.0000,+0.0000] +ind a5 all=0.4721 dom=0.7045 non=0.2387 h5=0.6297 h20=0.7147 | diff=+0.0075 [+0.0032,+0.0119] +agg a5 all=0.6128 dom=0.8033 non=0.4216 h5=0.7854 h20=0.8797 | diff=+0.0173 [+0.0039,+0.0311] +ind a10 all=0.4698 dom=0.6966 non=0.2420 h5=0.6341 h20=0.7223 | diff=+0.0051 [+0.0005,+0.0099] +agg a10 all=0.6138 dom=0.8020 non=0.4249 h5=0.7820 h20=0.8817 | diff=+0.0184 [+0.0052,+0.0317] +ind p10f1 all=0.4722 dom=0.7081 non=0.2353 h5=0.6270 h20=0.7067 | diff=+0.0076 [+0.0028,+0.0121] +agg p10f1 all=0.6146 dom=0.7983 non=0.4301 h5=0.8002 h20=0.8830 | diff=+0.0191 [+0.0065,+0.0317] +ind p10f2 all=0.4729 dom=0.7092 non=0.2357 h5=0.6284 h20=0.7081 | diff=+0.0083 [+0.0039,+0.0129] +agg p10f2 all=0.6120 dom=0.8030 non=0.4203 h5=0.7997 h20=0.8808 | diff=+0.0166 [+0.0030,+0.0302] +ind p20f2 all=0.4732 dom=0.7037 non=0.2417 h5=0.6328 h20=0.7174 | diff=+0.0085 [+0.0039,+0.0132] +agg p20f2 all=0.6138 dom=0.8038 non=0.4231 h5=0.7935 h20=0.8844 | diff=+0.0184 [+0.0061,+0.0304] +ind p20f4 all=0.4736 dom=0.7037 non=0.2426 h5=0.6329 h20=0.7182 | diff=+0.0090 [+0.0045,+0.0138] +agg p20f4 all=0.6122 dom=0.8049 non=0.4188 h5=0.7908 h20=0.8857 | diff=+0.0168 [+0.0038,+0.0289] diff --git a/shared/package-files/c2/c25272ce8adf203779c08dc1ea5435c3927eda62b98906fbc7cb9f6321dc0650/metrics.jsonl b/shared/package-files/c2/c25272ce8adf203779c08dc1ea5435c3927eda62b98906fbc7cb9f6321dc0650/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..339192800d4fab82116a0bcb8ca47a9b5a4b9df8 --- /dev/null +++ b/shared/package-files/c2/c25272ce8adf203779c08dc1ea5435c3927eda62b98906fbc7cb9f6321dc0650/metrics.jsonl @@ -0,0 +1,250 @@ +{"step": 200, "loss": 0.32430133532732724, "loss_real": 0.32268192190676925, "loss_synth": 0.32434114124625923, "lr": 5.999770185426209e-05, "elapsed": 78.44980933703482, "steps_per_second": 22.33409563813114, "loss_extra": 0.32454302288591863} +{"step": 400, "loss": 0.048181396815925835, "loss_real": 0.043708258010447025, "loss_synth": 0.0486886590346694, "lr": 0.0001199815230572914, "elapsed": 86.0565328579396, "steps_per_second": 24.152195155926833, "loss_extra": 0.04845339585095644} +{"step": 600, "loss": 0.04483180481940508, "loss_real": 0.0388418098911643, "loss_synth": 0.045347372870892286, "lr": 0.00017993754018322624, "elapsed": 93.3862485330319, "steps_per_second": 25.113684186072707, "loss_extra": 0.04535905422642827} +{"step": 800, "loss": 0.04274328524246812, "loss_real": 0.035418812669813636, "loss_synth": 0.043382983505725864, "lr": 0.0002398518371215969, "elapsed": 100.62296565400902, "steps_per_second": 25.70027289866951, "loss_extra": 0.04337876772508025} +{"step": 1000, "loss": 0.041796430069953205, "loss_real": 0.03399200197309256, "loss_synth": 0.042329031024128196, "lr": 0.0002997105087403322, "elapsed": 107.87781159894075, "steps_per_second": 26.053254873581153, "loss_extra": 0.042621938530355695} +{"step": 1200, "loss": 0.04089201441034675, "loss_real": 0.03320411323569715, "loss_synth": 0.04141065806150437, "lr": 0.00035949966454633923, "elapsed": 115.09103629994206, "steps_per_second": 26.31801397846563, "loss_extra": 0.04171117655932903} +{"step": 1400, "loss": 0.0401299106888473, "loss_real": 0.032216527117416266, "loss_synth": 0.04064454633742571, "lr": 0.0004192054323428467, "elapsed": 122.30481400899589, "steps_per_second": 26.510169495175433, "loss_extra": 0.0409922369197011} +{"step": 1600, "loss": 0.039497526325285436, "loss_real": 0.031656523821875455, "loss_synth": 0.04000166658312082, "lr": 0.0004788139618827038, "elapsed": 129.6079500289634, "steps_per_second": 26.616512937556614, "loss_extra": 0.04035772832110524} +{"step": 1800, "loss": 0.03884722057729959, "loss_real": 0.031072249989956616, "loss_synth": 0.03931963177397847, "lr": 0.000538311428516825, "elapsed": 136.84654244896956, "steps_per_second": 26.72540276108906, "loss_extra": 0.03972754616290331} +{"step": 2000, "loss": 0.03823719449341297, "loss_real": 0.030745117114856838, "loss_synth": 0.038614097628742454, "lr": 0.0005976840368369773, "elapsed": 144.08493282995187, "steps_per_second": 26.813230776334766, "loss_extra": 0.03916347624734044} +{"step": 2200, "loss": 0.03762316120788455, "loss_real": 0.030140446135774254, "loss_synth": 0.03798300966620445, "lr": 0.0005971982039200904, "elapsed": 151.11703063198365, "steps_per_second": 26.95347145213249, "loss_extra": 0.03856479924172163} +{"step": 2400, "loss": 0.03698377499356866, "loss_real": 0.02963886447250843, "loss_synth": 0.037280195988714696, "lr": 0.000596666387431128, "elapsed": 157.7880812699441, "steps_per_second": 27.182164061675834, "loss_extra": 0.03796463148668408} +{"step": 2600, "loss": 0.03633525112643838, "loss_real": 0.02920153729617596, "loss_synth": 0.036637500394135714, "lr": 0.0005960886713500785, "elapsed": 164.24970037303865, "steps_per_second": 27.43924057434101, "loss_extra": 0.03727361332625151} +{"step": 2800, "loss": 0.035849568508565424, "loss_real": 0.02860258094035089, "loss_synth": 0.03615691313520074, "lr": 0.0005954651469050082, "elapsed": 170.68330609600525, "steps_per_second": 27.67115193234053, "loss_extra": 0.03680253541097045} +{"step": 3000, "loss": 0.03540250325575471, "loss_real": 0.02847181444056332, "loss_synth": 0.03557234657928347, "lr": 0.0005947959125576553, "elapsed": 177.13224694202654, "steps_per_second": 27.87136445440406, "loss_extra": 0.03643743883818388} +{"step": 3200, "loss": 0.03489988373592496, "loss_real": 0.02794128847308457, "loss_synth": 0.03513312878087163, "lr": 0.000594081073987881, "elapsed": 183.6880411269376, "steps_per_second": 28.022696682689393, "loss_extra": 0.035876534227281806} +{"step": 3400, "loss": 0.034517469853162765, "loss_real": 0.027453907718881964, "loss_synth": 0.034644406344741585, "lr": 0.0005933207440769824, "elapsed": 190.23513862804975, "steps_per_second": 28.159624262950093, "loss_extra": 0.03561821445822716} +{"step": 3600, "loss": 0.03417928947135806, "loss_real": 0.027347140954807402, "loss_synth": 0.03434546956792474, "lr": 0.0005925150428898661, "elapsed": 196.8008248009719, "steps_per_second": 28.278336267885305, "loss_extra": 0.03520075334236026} +{"step": 3800, "loss": 0.03378160770982504, "loss_real": 0.027126235235482455, "loss_synth": 0.03387673534452915, "lr": 0.0005916640976560898, "elapsed": 203.35151743795723, "steps_per_second": 28.388583452944008, "loss_extra": 0.034843112379312514} +{"step": 4000, "loss": 0.0334822984598577, "loss_real": 0.026627980824559926, "loss_synth": 0.033648437540978196, "lr": 0.0005907680427497705, "elapsed": 209.84837105195038, "steps_per_second": 28.49947139670717, "loss_extra": 0.0345076540671289} +{"step": 4200, "loss": 0.033102637492120265, "loss_real": 0.0264966335427016, "loss_synth": 0.033233537320047614, "lr": 0.000589827019668365, "elapsed": 216.38875448296312, "steps_per_second": 28.592072625357396, "loss_extra": 0.03411994408816099} +{"step": 4400, "loss": 0.03285570543259382, "loss_real": 0.026216340791434048, "loss_synth": 0.03296021820046008, "lr": 0.0005888411770103267, "elapsed": 222.92135947104543, "steps_per_second": 28.678233040608145, "loss_extra": 0.03390508366748691} +{"step": 4600, "loss": 0.03248523915186524, "loss_real": 0.02611412583850324, "loss_synth": 0.03255747503601015, "lr": 0.0005878106704516395, "elapsed": 229.44010127300862, "steps_per_second": 28.759848448274084, "loss_extra": 0.033520154459401964} +{"step": 4800, "loss": 0.0322413180116564, "loss_real": 0.02573666679672897, "loss_synth": 0.0323392391577363, "lr": 0.0005867356627212351, "elapsed": 235.97733540495392, "steps_per_second": 28.831868903336957, "loss_extra": 0.03327385607175529} +{"step": 5000, "loss": 0.03197144233621657, "loss_real": 0.025705485474318265, "loss_synth": 0.03201724797487259, "lr": 0.000585616323575296, "elapsed": 242.5428724810481, "steps_per_second": 28.8937204956483, "loss_extra": 0.033014406971633437} +{"step": 5200, "loss": 0.03173559263348579, "loss_real": 0.02558943179436028, "loss_synth": 0.031738146189600226, "lr": 0.000584452829770449, "elapsed": 250.10363954794593, "steps_per_second": 28.791517894970415, "loss_extra": 0.03280081361532211} +{"step": 5400, "loss": 0.03147543409839273, "loss_real": 0.025409803492948413, "loss_synth": 0.031434239009395244, "lr": 0.0005832453650358537, "elapsed": 256.64099636499304, "steps_per_second": 28.8544610609135, "loss_extra": 0.032570228604599835} +{"step": 5600, "loss": 0.031304270662367344, "loss_real": 0.02524075939320028, "loss_synth": 0.03139337292872369, "lr": 0.0005819941200441891, "elapsed": 263.2668368309969, "steps_per_second": 28.899952413488418, "loss_extra": 0.03226895097643137} +{"step": 5800, "loss": 0.031111518079414965, "loss_real": 0.02484917959198356, "loss_synth": 0.031086567090824246, "lr": 0.0005806992923815441, "elapsed": 269.91291826195084, "steps_per_second": 28.93951254018384, "loss_extra": 0.03222431098110974} +{"step": 6000, "loss": 0.03085751034319401, "loss_real": 0.024980660546571016, "loss_synth": 0.03084361500106752, "lr": 0.0005793610865162167, "elapsed": 276.4498669389868, "steps_per_second": 28.991813243914315, "loss_extra": 0.031892323726788165} +{"step": 6200, "loss": 0.030637705828994513, "loss_real": 0.024611906660720707, "loss_synth": 0.03068349191918969, "lr": 0.0005779797137664262, "elapsed": 282.97176869702525, "steps_per_second": 29.042958101175156, "loss_extra": 0.031638967599719764} +{"step": 6400, "loss": 0.03050954461097717, "loss_real": 0.024832452358677985, "loss_synth": 0.03044634038582444, "lr": 0.0005765553922669433, "elapsed": 289.5258188350126, "steps_per_second": 29.086820103295814, "loss_extra": 0.031558754658326506} +{"step": 6600, "loss": 0.030267862183973194, "loss_real": 0.024730142774060368, "loss_synth": 0.030178392548114063, "lr": 0.0005750883469346437, "elapsed": 296.0851721250219, "steps_per_second": 29.127462794055397, "loss_extra": 0.031319013088941576} +{"step": 6800, "loss": 0.030100438073277475, "loss_real": 0.024360930686816572, "loss_synth": 0.030007862094789742, "lr": 0.000573578809432992, "elapsed": 302.6140324190492, "steps_per_second": 29.16963390961021, "loss_extra": 0.03118973836302757} +{"step": 7000, "loss": 0.029965716926380993, "loss_real": 0.024367696372792125, "loss_synth": 0.029860857743769884, "lr": 0.000572027018135459, "elapsed": 309.19253203703556, "steps_per_second": 29.203458073129067, "loss_extra": 0.031042668418958783} +{"step": 7200, "loss": 0.02977247826755047, "loss_real": 0.024130825605243444, "loss_synth": 0.02972221125848591, "lr": 0.0005704332180878793, "elapsed": 315.71265554300044, "steps_per_second": 29.242406570842647, "loss_extra": 0.030802648849785327} +{"step": 7400, "loss": 0.029614629400894047, "loss_real": 0.02371627068147063, "loss_synth": 0.029530640076845884, "lr": 0.0005687976609697565, "elapsed": 322.3160326080397, "steps_per_second": 29.269704022443985, "loss_extra": 0.030722976587712766} +{"step": 7600, "loss": 0.029421165650710464, "loss_real": 0.02381357009522617, "loss_synth": 0.029317253828048707, "lr": 0.0005671206050545193, "elapsed": 328.860525385011, "steps_per_second": 29.302262924651217, "loss_extra": 0.030498836757615208} +{"step": 7800, "loss": 0.029383065169677137, "loss_real": 0.02394390607252717, "loss_synth": 0.029243904259055854, "lr": 0.000565402315168738, "elapsed": 335.44849577196874, "steps_per_second": 29.328423701374877, "loss_extra": 0.030466573787853123} +{"step": 8000, "loss": 0.029151302687823774, "loss_real": 0.023931112037971616, "loss_synth": 0.02904717708006501, "lr": 0.0005636430626503045, "elapsed": 342.0294402029831, "steps_per_second": 29.35407651604068, "loss_extra": 0.030161883709952236} +{"step": 8200, "loss": 0.02902005322277546, "loss_real": 0.02350676220841706, "loss_synth": 0.02886082070879638, "lr": 0.0005618431253055855, "elapsed": 348.6394026619382, "steps_per_second": 29.375465563305635, "loss_extra": 0.0301364275906235} +{"step": 8400, "loss": 0.028853354677557945, "loss_real": 0.023481941586360335, "loss_synth": 0.028648500237613915, "lr": 0.000560002787365553, "elapsed": 355.21574703603983, "steps_per_second": 29.399323951776537, "loss_extra": 0.029990509264171124} +{"step": 8600, "loss": 0.028779137954115866, "loss_real": 0.023468982307240368, "loss_synth": 0.028602073630318046, "lr": 0.0005581223394409018, "elapsed": 361.7840002949815, "steps_per_second": 29.422923197160433, "loss_extra": 0.029877978367730974} +{"step": 8800, "loss": 0.028654432091861963, "loss_real": 0.023431308083236218, "loss_synth": 0.02841719732619822, "lr": 0.0005562020784761579, "elapsed": 368.40504191000946, "steps_per_second": 29.44028492562518, "loss_extra": 0.029798067882657053} +{"step": 9000, "loss": 0.028502490920946002, "loss_real": 0.023146269023418427, "loss_synth": 0.028358636982738973, "lr": 0.0005542423077027882, "elapsed": 375.01159695500974, "steps_per_second": 29.458290934003465, "loss_extra": 0.02957626400515437} +{"step": 9200, "loss": 0.028332176711410285, "loss_real": 0.023157413452863693, "loss_synth": 0.028122597998008134, "lr": 0.0005522433365913161, "elapsed": 381.6548681909917, "steps_per_second": 29.47206779106829, "loss_extra": 0.02943987221457064} +{"step": 9400, "loss": 0.02825095208361745, "loss_real": 0.022845272459089756, "loss_synth": 0.028092716792598366, "lr": 0.0005502054808024529, "elapsed": 388.2824555010302, "steps_per_second": 29.4867211289945, "loss_extra": 0.02934763834811747} +{"step": 9600, "loss": 0.028085780907422305, "loss_real": 0.022786310352385045, "loss_synth": 0.027910720817744733, "lr": 0.0005481290621372514, "elapsed": 394.9404019219801, "steps_per_second": 29.498025600496018, "loss_extra": 0.02918076899833977} +{"step": 9800, "loss": 0.028015275159850715, "loss_real": 0.02273546002805233, "loss_synth": 0.027773394919931887, "lr": 0.000546014408486289, "elapsed": 401.65032391098794, "steps_per_second": 29.50425918371413, "loss_extra": 0.029173385435715318} +{"step": 10000, "loss": 0.02789129436016083, "loss_real": 0.02284555503167212, "loss_synth": 0.02769619883969426, "lr": 0.0005438618537778916, "elapsed": 408.21691563003697, "steps_per_second": 29.52273333259092, "loss_extra": 0.028962152479216456} +{"step": 10200, "loss": 0.027787894764915107, "loss_real": 0.0225413881521672, "loss_synth": 0.02763626498170197, "lr": 0.0005416717379254006, "elapsed": 430.77602347300854, "steps_per_second": 28.232861032350943, "loss_extra": 0.028850350603461264} +{"step": 10400, "loss": 0.027703039282932877, "loss_real": 0.022498250016942622, "loss_synth": 0.027465238701552153, "lr": 0.0005394444067734975, "elapsed": 437.4852106439648, "steps_per_second": 28.261613027113615, "loss_extra": 0.02884405336342752} +{"step": 10600, "loss": 0.02755815259180963, "loss_real": 0.02228700874373317, "loss_synth": 0.02739201673306525, "lr": 0.0005371802120435915, "elapsed": 444.0915134079987, "steps_per_second": 28.297105132516737, "loss_extra": 0.028639333033934237} +{"step": 10800, "loss": 0.02750732434913516, "loss_real": 0.02252116926945746, "loss_synth": 0.027295452561229467, "lr": 0.0005348795112782779, "elapsed": 450.75502616504673, "steps_per_second": 28.327115833687404, "loss_extra": 0.028584536146372557} +{"step": 11000, "loss": 0.02745752050541341, "loss_real": 0.022350562866777182, "loss_synth": 0.027189817745238543, "lr": 0.0005325426677848778, "elapsed": 457.4643153799698, "steps_per_second": 28.35274978263941, "loss_extra": 0.028611313793808223} +{"step": 11200, "loss": 0.027306603780016304, "loss_real": 0.022093136562034488, "loss_synth": 0.027049721013754607, "lr": 0.0005301700505780687, "elapsed": 464.272828490939, "steps_per_second": 28.370379774237275, "loss_extra": 0.028468126924708487} +{"step": 11400, "loss": 0.02714840757660568, "loss_real": 0.02223881334066391, "loss_synth": 0.026944066984578966, "lr": 0.0005277620343216117, "elapsed": 471.08238908695057, "steps_per_second": 28.387337850418557, "loss_extra": 0.028204819178208707} +{"step": 11600, "loss": 0.02717535026371479, "loss_real": 0.02205170951783657, "loss_synth": 0.02694122103974223, "lr": 0.0005253189992691882, "elapsed": 477.85334994096775, "steps_per_second": 28.40641539396982, "loss_extra": 0.028298610569909215} +{"step": 11800, "loss": 0.026930897086858748, "loss_real": 0.021742525342851877, "loss_synth": 0.026716568041592836, "lr": 0.0005228413312043536, "elapsed": 484.63674286496826, "steps_per_second": 28.42401929956368, "loss_extra": 0.028045686474069954} +{"step": 12000, "loss": 0.026928004203364254, "loss_real": 0.021893908772617578, "loss_synth": 0.026811975641176104, "lr": 0.0005203294213796174, "elapsed": 491.39282081997953, "steps_per_second": 28.442898523713385, "loss_extra": 0.027918107397854327} +{"step": 12200, "loss": 0.026815128391608597, "loss_real": 0.021717762276530266, "loss_synth": 0.026576634347438812, "lr": 0.0005177836664546598, "elapsed": 498.1805580999935, "steps_per_second": 28.459080742757717, "loss_extra": 0.027938170367851855} +{"step": 12400, "loss": 0.026772718206048013, "loss_real": 0.02156142145395279, "loss_synth": 0.02653740965761244, "lr": 0.000515204468433695, "elapsed": 504.86884819495026, "steps_per_second": 28.481262564352352, "loss_extra": 0.027912381002679468} +{"step": 12600, "loss": 0.026640206957235932, "loss_real": 0.02163640709593892, "loss_synth": 0.026356407478451728, "lr": 0.0005125922346019892, "elapsed": 511.5330396470381, "steps_per_second": 28.50432715460713, "loss_extra": 0.02779210723936558} +{"step": 12800, "loss": 0.02661628518253565, "loss_real": 0.02131879098713398, "loss_synth": 0.026404398512095213, "lr": 0.0005099473774615467, "elapsed": 518.354508753051, "steps_per_second": 28.516711021853403, "loss_extra": 0.02774760021828115} +{"step": 13000, "loss": 0.026440530363470317, "loss_real": 0.021402373262681067, "loss_synth": 0.026175792859867215, "lr": 0.00050727031466597, "elapsed": 525.0843771150103, "steps_per_second": 28.534460097931593, "loss_extra": 0.027579418374225496} +{"step": 13200, "loss": 0.026375663205981253, "loss_real": 0.021171789923682807, "loss_synth": 0.02613414766266942, "lr": 0.000504561468954508, "elapsed": 531.851406633039, "steps_per_second": 28.549397640731637, "loss_extra": 0.02752021737396717} +{"step": 13400, "loss": 0.026254204157739876, "loss_real": 0.02092574743553996, "loss_synth": 0.02607096901163459, "lr": 0.0005018212680853004, "elapsed": 538.6255784259411, "steps_per_second": 28.563469347844354, "loss_extra": 0.027362368525937198} +{"step": 13600, "loss": 0.026235636910423635, "loss_real": 0.021319888830184937, "loss_synth": 0.02599598007276654, "lr": 0.0004990501447678302, "elapsed": 545.359652478015, "steps_per_second": 28.57954842473691, "loss_extra": 0.027328284541144967} +{"step": 13800, "loss": 0.026217164220288396, "loss_real": 0.02122289774939418, "loss_synth": 0.02600482010282576, "lr": 0.0004962485365945929, "elapsed": 552.1244133489672, "steps_per_second": 28.59336067024573, "loss_extra": 0.02729625575244427} +{"step": 14000, "loss": 0.026097159693017603, "loss_real": 0.02081498018000275, "loss_synth": 0.025907448725774884, "lr": 0.0004934168859719962, "elapsed": 558.9282866859576, "steps_per_second": 28.60450495525027, "loss_extra": 0.02720373259857297} +{"step": 14200, "loss": 0.026095483070239425, "loss_real": 0.02105480691418052, "loss_synth": 0.025869556171819567, "lr": 0.0004905556400504991, "elapsed": 565.7278269600356, "steps_per_second": 28.61559352126683, "loss_extra": 0.02719616238027811} +{"step": 14400, "loss": 0.02597790555097163, "loss_real": 0.021061060847714544, "loss_synth": 0.025746524157002567, "lr": 0.0004876652506540011, "elapsed": 572.6110002140049, "steps_per_second": 28.621623821101714, "loss_extra": 0.02706250318326056} +{"step": 14600, "loss": 0.02591495629400015, "loss_real": 0.021083114817738533, "loss_synth": 0.025633822102099656, "lr": 0.00048474617420849446, "elapsed": 579.489256942994, "steps_per_second": 28.627767220451137, "loss_extra": 0.027034328607842325} +{"step": 14800, "loss": 0.025804635984823108, "loss_real": 0.0209048725431785, "loss_synth": 0.025499571049585938, "lr": 0.000481798871669989, "elapsed": 586.3986435179831, "steps_per_second": 28.63202276158929, "loss_extra": 0.026959637496620417} +{"step": 15000, "loss": 0.02576089894399047, "loss_real": 0.020973859350197018, "loss_synth": 0.025489373886957763, "lr": 0.00047882380845172155, "elapsed": 593.2022919240408, "steps_per_second": 28.641947728770923, "loss_extra": 0.026862919358536602} +{"step": 15200, "loss": 0.02562275300733745, "loss_real": 0.020795735847204923, "loss_synth": 0.025390006164088846, "lr": 0.0004758214543506626, "elapsed": 601.1566034749849, "steps_per_second": 28.58960811429666, "loss_extra": 0.02669310455210507} +{"step": 15400, "loss": 0.025651556802913547, "loss_real": 0.020819079792127014, "loss_synth": 0.025371970608830452, "lr": 0.0004727922834733288, "elapsed": 608.049689086969, "steps_per_second": 28.595047467517023, "loss_extra": 0.02676949799992144} +{"step": 15600, "loss": 0.02557595254853368, "loss_real": 0.020568241658620538, "loss_synth": 0.02528459099121392, "lr": 0.0004697367741609171, "elapsed": 614.9529914780287, "steps_per_second": 28.599813620144452, "loss_extra": 0.026736062103882432} +{"step": 15800, "loss": 0.025517418356612323, "loss_real": 0.02084029550664127, "loss_synth": 0.02518910272978246, "lr": 0.0004666554089137685, "elapsed": 621.9393140380271, "steps_per_second": 28.600162038411295, "loss_extra": 0.026656892830505968} +{"step": 16000, "loss": 0.02545200611464679, "loss_real": 0.0204320370266214, "loss_synth": 0.02522694693878293, "lr": 0.00046354867431517584, "elapsed": 628.793166219024, "steps_per_second": 28.607275790780413, "loss_extra": 0.026548224100843072} +{"step": 16200, "loss": 0.025393351353704928, "loss_real": 0.020358552602119745, "loss_synth": 0.025154734067618846, "lr": 0.0004604170609545466, "elapsed": 635.796310235979, "steps_per_second": 28.606673876897535, "loss_extra": 0.026505646500736474} +{"step": 16400, "loss": 0.02523534994572401, "loss_real": 0.02025255942251533, "loss_synth": 0.024958624774590134, "lr": 0.00045726106334993325, "elapsed": 642.8425878470298, "steps_per_second": 28.603934573880007, "loss_extra": 0.026376555897295473} +{"step": 16600, "loss": 0.025304170893505215, "loss_real": 0.020133989257737996, "loss_synth": 0.02503175870515406, "lr": 0.0004540811798699431, "elapsed": 649.9485008260235, "steps_per_second": 28.59832331467669, "loss_extra": 0.026473637381568552} +{"step": 16800, "loss": 0.025238420991227032, "loss_real": 0.02030674526002258, "loss_synth": 0.02491192502900958, "lr": 0.00045087791265504006, "elapsed": 656.987810133025, "steps_per_second": 28.59608934778793, "loss_extra": 0.026420306861400605} +{"step": 17000, "loss": 0.02515006753616035, "loss_real": 0.020221168622374535, "loss_synth": 0.024925499530509113, "lr": 0.0004476517675382507, "elapsed": 664.1656642509624, "steps_per_second": 28.587246550577607, "loss_extra": 0.02622997506521642} +{"step": 17200, "loss": 0.025110708493739368, "loss_real": 0.019950386337004602, "loss_synth": 0.024836572417989373, "lr": 0.00044440325396528766, "elapsed": 671.4287833080161, "steps_per_second": 28.574566461480757, "loss_extra": 0.026280179051682354} +{"step": 17400, "loss": 0.025028507895767688, "loss_real": 0.01989804073702544, "loss_synth": 0.024679777529090643, "lr": 0.00044113288491410207, "elapsed": 678.6557190399617, "steps_per_second": 28.5638852873975, "loss_extra": 0.026267069689929486} +{"step": 17600, "loss": 0.02492173637263477, "loss_real": 0.020149774285964667, "loss_synth": 0.02458382401615381, "lr": 0.00043784117681387844, "elapsed": 686.0683297759388, "steps_per_second": 28.54485597968695, "loss_extra": 0.02608724351041019} +{"step": 17800, "loss": 0.024941758597269655, "loss_real": 0.019904853701591493, "loss_synth": 0.024664473459124564, "lr": 0.00043452864946348456, "elapsed": 693.7049110439839, "steps_per_second": 28.516043380740726, "loss_extra": 0.02609292346984148} +{"step": 18000, "loss": 0.02486544241197407, "loss_real": 0.019879548153840007, "loss_synth": 0.024580333549529314, "lr": 0.00043119582594938896, "elapsed": 701.613930410007, "steps_per_second": 28.475649174415356, "loss_extra": 0.026015535881742834} +{"step": 18200, "loss": 0.024755051592364907, "loss_real": 0.019878885224461556, "loss_synth": 0.02450237005017698, "lr": 0.0004278432325630599, "elapsed": 709.7588617419824, "steps_per_second": 28.425775674719723, "loss_extra": 0.025853791981935503} +{"step": 18400, "loss": 0.02474474046379328, "loss_real": 0.019803139586001633, "loss_synth": 0.02439490278251469, "lr": 0.00042447139871785766, "elapsed": 719.6697661239887, "steps_per_second": 28.30007847273918, "loss_extra": 0.025951593229547144} +{"step": 18600, "loss": 0.024668840691447258, "loss_real": 0.019746907390654087, "loss_synth": 0.02440560257062316, "lr": 0.0004210808568654337, "elapsed": 723.9620495010167, "steps_per_second": 28.420066246954338, "loss_extra": 0.02578604405745864} +{"step": 18800, "loss": 0.02470597776584327, "loss_real": 0.019732502447441222, "loss_synth": 0.024443739904090763, "lr": 0.00041767214241165117, "elapsed": 727.9396035709651, "steps_per_second": 28.552131490434117, "loss_extra": 0.02583113924600184} +{"step": 19000, "loss": 0.024592864103615285, "loss_real": 0.019706200822256506, "loss_synth": 0.02432212349027395, "lr": 0.00041424579363203725, "elapsed": 732.0827361289412, "steps_per_second": 28.675443039903026, "loss_extra": 0.025711410539224745} +{"step": 19200, "loss": 0.024535152772441508, "loss_real": 0.019670571377500893, "loss_synth": 0.02432107319124043, "lr": 0.00041080235158678376, "elapsed": 736.1992817979772, "steps_per_second": 28.798370424598282, "loss_extra": 0.025593442264944314} +{"step": 19400, "loss": 0.024498484833166002, "loss_real": 0.01961197362281382, "loss_synth": 0.02425252879038453, "lr": 0.00040734236003530744, "elapsed": 740.2897972209612, "steps_per_second": 28.920911341696943, "loss_extra": 0.02559232556261122} +{"step": 19600, "loss": 0.024412935953587293, "loss_real": 0.01937608694192022, "loss_synth": 0.024159264164045454, "lr": 0.0004038663653503835, "elapsed": 744.3621533859987, "steps_per_second": 29.04274826336778, "loss_extra": 0.025540577685460447} +{"step": 19800, "loss": 0.024424829883500934, "loss_real": 0.01925559647846967, "loss_synth": 0.024107435029000045, "lr": 0.000400374916431868, "elapsed": 748.3890514309751, "steps_per_second": 29.16507633407428, "loss_extra": 0.025638923943042756} +{"step": 20000, "loss": 0.024384419415146113, "loss_real": 0.019235820150934158, "loss_synth": 0.024076775722205637, "lr": 0.00039686856462001896, "elapsed": 752.4140539519722, "steps_per_second": 29.286043049364686, "loss_extra": 0.02558521868661046} +{"step": 20200, "loss": 0.024238093979656695, "loss_real": 0.019287046566605567, "loss_synth": 0.023866740595549343, "lr": 0.00039334786360843476, "elapsed": 768.7693178319605, "steps_per_second": 28.887085295330362, "loss_extra": 0.025468012550845742} +{"step": 20400, "loss": 0.02416825881227851, "loss_real": 0.019135412601754068, "loss_synth": 0.023902692701667547, "lr": 0.00038981336935661813, "elapsed": 772.7195007449482, "steps_per_second": 29.0092236998701, "loss_extra": 0.02530704944394529} +{"step": 20600, "loss": 0.024259408125653862, "loss_real": 0.019137453706935047, "loss_synth": 0.023996578939259054, "lr": 0.00038626564000218466, "elapsed": 776.6206518310355, "steps_per_second": 29.132017462774094, "loss_extra": 0.025410953657701612} +{"step": 20800, "loss": 0.024142149882391096, "loss_real": 0.019325358415953814, "loss_synth": 0.02383010762743652, "lr": 0.00038270523577272616, "elapsed": 780.5251629319973, "steps_per_second": 29.25332552179019, "loss_extra": 0.02528968458995223} +{"step": 21000, "loss": 0.024137173751369118, "loss_real": 0.019060878846794367, "loss_synth": 0.023834667671471833, "lr": 0.0003791327188973438, "elapsed": 784.4541860310128, "steps_per_second": 29.372301536908076, "loss_extra": 0.02532029594294727} +{"step": 21200, "loss": 0.02408229798078537, "loss_real": 0.01910729769151658, "loss_synth": 0.023820500252768398, "lr": 0.00037554865351786614, "elapsed": 788.3786452079657, "steps_per_second": 29.49016427061401, "loss_extra": 0.025207286616787315} +{"step": 21400, "loss": 0.023934656251221896, "loss_real": 0.01886925713159144, "loss_synth": 0.023755532233044507, "lr": 0.00037195360559976446, "elapsed": 792.4861821749946, "steps_per_second": 29.599250045533037, "loss_extra": 0.024993026703596113} +{"step": 21600, "loss": 0.0239660591352731, "loss_real": 0.01905731202568859, "loss_synth": 0.023774098167195917, "lr": 0.0003683481428427801, "elapsed": 796.4621578450315, "steps_per_second": 29.71247949044863, "loss_extra": 0.025009996639564634} +{"step": 21800, "loss": 0.023981186477467418, "loss_real": 0.018953396156430245, "loss_synth": 0.02364774242043495, "lr": 0.0003647328345912784, "elapsed": 804.5707382949768, "steps_per_second": 29.656803552290448, "loss_extra": 0.025186688993126153} +{"step": 22000, "loss": 0.02387623155489564, "loss_real": 0.018674958115443587, "loss_synth": 0.023533647917211055, "lr": 0.0003611082517443419, "elapsed": 815.8325469089905, "steps_per_second": 29.477274576199424, "loss_extra": 0.02512097398750484} +{"step": 22200, "loss": 0.02383097279816866, "loss_real": 0.018583175959065557, "loss_synth": 0.023579390151426197, "lr": 0.00035747496666562, "elapsed": 826.6192307639867, "steps_per_second": 29.32147182919791, "loss_extra": 0.024993182234466074} +{"step": 22400, "loss": 0.023786915997043252, "loss_real": 0.018698906400240956, "loss_synth": 0.023517325753346086, "lr": 0.00035383355309294483, "elapsed": 837.0016033239663, "steps_per_second": 29.18541249675179, "loss_extra": 0.024939297111704947} +{"step": 22600, "loss": 0.023757690163329244, "loss_real": 0.018606227007694542, "loss_synth": 0.023443297315388918, "lr": 0.00035018458604773206, "elapsed": 846.5947675129864, "steps_per_second": 29.08249079131367, "loss_extra": 0.024965707696974277} +{"step": 22800, "loss": 0.02380165004171431, "loss_real": 0.018441917523741722, "loss_synth": 0.023482480347156526, "lr": 0.0003465286417441785, "elapsed": 855.087592568947, "steps_per_second": 29.02267289602303, "loss_extra": 0.025050606559962035} +{"step": 23000, "loss": 0.02376444826833904, "loss_real": 0.018928186562843622, "loss_synth": 0.02340189806185663, "lr": 0.0003428662974982705, "elapsed": 862.6200286470121, "steps_per_second": 28.999206940659565, "loss_extra": 0.024965659426525236} +{"step": 23200, "loss": 0.0236680197250098, "loss_real": 0.01860190404113382, "loss_synth": 0.023326697954908014, "lr": 0.00033919813163662, "elapsed": 869.6055863429792, "steps_per_second": 28.995987834043685, "loss_extra": 0.024888024302199482} +{"step": 23400, "loss": 0.023613752126693727, "loss_real": 0.018713250285945834, "loss_synth": 0.023345556315034627, "lr": 0.000335524723405139, "elapsed": 875.9154177060118, "steps_per_second": 29.017118527471474, "loss_extra": 0.024732168931514024} +{"step": 23600, "loss": 0.02355811377055943, "loss_real": 0.01846630883868784, "loss_synth": 0.02321004254743457, "lr": 0.00033184665287757097, "elapsed": 881.3718689529924, "steps_per_second": 29.0684434363517, "loss_extra": 0.024789302917197345} +{"step": 23800, "loss": 0.02351827034726739, "loss_real": 0.018269116366282104, "loss_synth": 0.023334739971905948, "lr": 0.0003281645008638895, "elapsed": 886.8274710889673, "steps_per_second": 29.119113314803467, "loss_extra": 0.02461295166052878} +{"step": 24000, "loss": 0.02353503564372659, "loss_real": 0.018465970074757934, "loss_synth": 0.023239617962390186, "lr": 0.0003244788488185826, "elapsed": 892.2636506720446, "steps_per_second": 29.169799808385857, "loss_extra": 0.02470984331332147} +{"step": 24200, "loss": 0.02344511211849749, "loss_real": 0.018308278238400817, "loss_synth": 0.0230889112316072, "lr": 0.00032079027874883385, "elapsed": 897.9212248319527, "steps_per_second": 29.21201199556714, "loss_extra": 0.02469221880659461} +{"step": 24400, "loss": 0.02340422769077122, "loss_real": 0.01864253951702267, "loss_synth": 0.023100256314501168, "lr": 0.00031709937312261613, "elapsed": 903.2988714729436, "steps_per_second": 29.263472686945526, "loss_extra": 0.02453415295109153} +{"step": 24600, "loss": 0.023359055202454328, "loss_real": 0.018461114489473403, "loss_synth": 0.023133125295862554, "lr": 0.0003134067147767145, "elapsed": 908.7411208680132, "steps_per_second": 29.312017306778156, "loss_extra": 0.02443494033999741} +{"step": 24800, "loss": 0.02333096952177584, "loss_real": 0.017921278714202345, "loss_synth": 0.02304865882731974, "lr": 0.0003097128868246881, "elapsed": 913.8996175409993, "steps_per_second": 29.369802439342834, "loss_extra": 0.024551902385428547} +{"step": 25000, "loss": 0.023354317182675003, "loss_real": 0.018197318534366787, "loss_synth": 0.02308732196688652, "lr": 0.0003060184725647909, "elapsed": 919.5904387460323, "steps_per_second": 29.408458919560474, "loss_extra": 0.024516099588945506} +{"step": 25200, "loss": 0.023254950512200594, "loss_real": 0.018121312130242585, "loss_synth": 0.02299854296259582, "lr": 0.0003023240553878617, "elapsed": 925.8173040190013, "steps_per_second": 29.428168211563374, "loss_extra": 0.02440213174559176} +{"step": 25400, "loss": 0.02320500058121979, "loss_real": 0.018078536498360335, "loss_synth": 0.022932995250448583, "lr": 0.0002986302186851996, "elapsed": 930.8812109320424, "steps_per_second": 29.48735009341429, "loss_extra": 0.024366467017680405} +{"step": 25600, "loss": 0.023241362301632762, "loss_real": 0.0182432871311903, "loss_synth": 0.022895749928429722, "lr": 0.00029493754575644036, "elapsed": 935.9697424720507, "steps_per_second": 29.54500061059939, "loss_extra": 0.024453819058835508} +{"step": 25800, "loss": 0.02318029667250812, "loss_real": 0.018227319712750614, "loss_synth": 0.022854938451200724, "lr": 0.0002912466197174462, "elapsed": 940.6747374669649, "steps_per_second": 29.615010162638594, "loss_extra": 0.02436475015245378} +{"step": 26000, "loss": 0.02320723770186305, "loss_real": 0.018340792586095632, "loss_synth": 0.02286465638317168, "lr": 0.00028755802340822527, "elapsed": 944.8595040739747, "steps_per_second": 29.70190892775048, "loss_extra": 0.024393808422610165} +{"step": 26200, "loss": 0.023098589051514865, "loss_real": 0.01809865878894925, "loss_synth": 0.022753129908815027, "lr": 0.0002838723393008943, "elapsed": 948.7775875090156, "steps_per_second": 29.79701534924382, "loss_extra": 0.02431121558882296} +{"step": 26400, "loss": 0.023153705205768347, "loss_real": 0.017972858464345334, "loss_synth": 0.02276963621377945, "lr": 0.00028019014940769974, "elapsed": 952.6896265819669, "steps_per_second": 29.891482527055132, "loss_extra": 0.024436208494007586} +{"step": 26600, "loss": 0.02307331212796271, "loss_real": 0.01786355955991894, "loss_synth": 0.022747806161642074, "lr": 0.000276512035189111, "elapsed": 956.5970903009875, "steps_per_second": 29.985271179686638, "loss_extra": 0.02430252218618989} +{"step": 26800, "loss": 0.02301308423280716, "loss_real": 0.01782644503749907, "loss_synth": 0.022693322533741594, "lr": 0.00027283857746200125, "elapsed": 960.474473068025, "steps_per_second": 30.079252719364632, "loss_extra": 0.024232558831572534} +{"step": 27000, "loss": 0.02293160116299987, "loss_real": 0.017880905899219215, "loss_synth": 0.022583343992009758, "lr": 0.0002691703563079296, "elapsed": 964.3899014419876, "steps_per_second": 30.171137037454393, "loss_extra": 0.024155833376571536} +{"step": 27200, "loss": 0.022908126972615718, "loss_real": 0.017744755800813437, "loss_synth": 0.022560941679403188, "lr": 0.0002655079509815397, "elapsed": 968.3154078460066, "steps_per_second": 30.26188151228273, "loss_extra": 0.02415086674503982} +{"step": 27400, "loss": 0.022869219006970525, "loss_real": 0.017524190563708544, "loss_synth": 0.022508632708340883, "lr": 0.00026185193981908867, "elapsed": 972.1902588210069, "steps_per_second": 30.353540060511584, "loss_extra": 0.0241568623483181} +{"step": 27600, "loss": 0.022862202459946274, "loss_real": 0.01785756405442953, "loss_synth": 0.022534840097650884, "lr": 0.0002582029001471206, "elapsed": 976.0380459190346, "steps_per_second": 30.445323933632267, "loss_extra": 0.024057626985013486} +{"step": 27800, "loss": 0.022832823237404227, "loss_real": 0.01753169072791934, "loss_synth": 0.022557682720944286, "lr": 0.00025456140819130085, "elapsed": 979.8858689239714, "steps_per_second": 30.536330737900318, "loss_extra": 0.024027756229043008} +{"step": 28000, "loss": 0.022756161084398627, "loss_real": 0.017363794264383614, "loss_synth": 0.02240219165571034, "lr": 0.0002509280389854229, "elapsed": 983.7316015739925, "steps_per_second": 30.626641528745846, "loss_extra": 0.024045439455658197} +{"step": 28200, "loss": 0.02280002257786691, "loss_real": 0.017515594554133714, "loss_synth": 0.022547621093690396, "lr": 0.00024730336628060344, "elapsed": 987.5799584470224, "steps_per_second": 30.71610791419535, "loss_extra": 0.023969411440193652} +{"step": 28400, "loss": 0.022829170217737556, "loss_real": 0.017582548842765392, "loss_synth": 0.022608125787228345, "lr": 0.00024368796245468133, "elapsed": 991.4275388040114, "steps_per_second": 30.80485334009962, "loss_extra": 0.023960766373202203} +{"step": 28600, "loss": 0.022774932365864517, "loss_real": 0.01752966483589262, "loss_synth": 0.022438550824299453, "lr": 0.00024008239842183163, "elapsed": 995.2748499029549, "steps_per_second": 30.892870096410828, "loss_extra": 0.02402114192955196} +{"step": 28800, "loss": 0.022722211545333267, "loss_real": 0.01743459186051041, "loss_synth": 0.022416120432317256, "lr": 0.00023648724354241227, "elapsed": 999.124085268937, "steps_per_second": 30.980094196456808, "loss_extra": 0.023945616967976095} +{"step": 29000, "loss": 0.022594335302710534, "loss_real": 0.01742119968868792, "loss_synth": 0.02229314292781055, "lr": 0.00023290306553305494, "elapsed": 1003.0197315310361, "steps_per_second": 31.06505444644124, "loss_extra": 0.023792973225936292} +{"step": 29200, "loss": 0.022708948673680424, "loss_real": 0.017489871880970894, "loss_synth": 0.022417378686368464, "lr": 0.00022933043037701642, "elapsed": 1006.9900862999493, "steps_per_second": 31.146826300148863, "loss_extra": 0.023905986286699772} +{"step": 29400, "loss": 0.02252833212725818, "loss_real": 0.01734620633535087, "loss_synth": 0.022279205592349173, "lr": 0.00022576990223480343, "elapsed": 1011.0913466890343, "steps_per_second": 31.223566982593592, "loss_extra": 0.02367668692022562} +{"step": 29600, "loss": 0.02253792851231992, "loss_real": 0.017516035628505053, "loss_synth": 0.022219667583703993, "lr": 0.00022222204335508425, "elapsed": 1015.0827094479464, "steps_per_second": 31.303279715613392, "loss_extra": 0.023727287566289307} +{"step": 29800, "loss": 0.022544852234423162, "loss_real": 0.01727502789348364, "loss_synth": 0.022247442901134493, "lr": 0.00021868741398590414, "elapsed": 1019.1408397170017, "steps_per_second": 31.380115976657972, "loss_extra": 0.02375652128830552} +{"step": 30000, "loss": 0.022504198867827653, "loss_real": 0.017228357633575796, "loss_synth": 0.02218015767633915, "lr": 0.00021516657228621528, "elapsed": 1023.1021751599619, "steps_per_second": 31.459491237681025, "loss_extra": 0.023743431996554137} +{"step": 30200, "loss": 0.022482317676767706, "loss_real": 0.017230691919103265, "loss_synth": 0.02210120402276516, "lr": 0.00021166007423773693, "elapsed": 1039.5083497849992, "steps_per_second": 31.133588653141253, "loss_extra": 0.023774174572899938} +{"step": 30400, "loss": 0.022483001556247474, "loss_real": 0.01732997354120016, "loss_synth": 0.022185036139562728, "lr": 0.0002081684735571596, "elapsed": 1043.4666767430026, "steps_per_second": 31.212403107538815, "loss_extra": 0.023674933100119235} +{"step": 30600, "loss": 0.02246225917711854, "loss_real": 0.017238442478701474, "loss_synth": 0.022100933957844973, "lr": 0.00020469232160870657, "elapsed": 1047.3864466319792, "steps_per_second": 31.291813313569207, "loss_extra": 0.023729579774662852} +{"step": 30800, "loss": 0.02233398157171905, "loss_real": 0.017174614081159233, "loss_synth": 0.022039647148922085, "lr": 0.00020123216731706737, "elapsed": 1051.343887598021, "steps_per_second": 31.36938580414145, "loss_extra": 0.023523398553952576} +{"step": 31000, "loss": 0.02234473146498203, "loss_real": 0.016976985754445194, "loss_synth": 0.022029524641111492, "lr": 0.00019778855708071612, "elapsed": 1055.4714617489371, "steps_per_second": 31.44090937879607, "loss_extra": 0.02359113403595984} +{"step": 31200, "loss": 0.022392282644286752, "loss_real": 0.01714965813793242, "loss_synth": 0.022116712098941206, "lr": 0.00019436203468562864, "elapsed": 1059.4188853659434, "steps_per_second": 31.517571241155952, "loss_extra": 0.0235774799156934} +{"step": 31400, "loss": 0.022274520713835955, "loss_real": 0.016901171770878135, "loss_synth": 0.022014990067109465, "lr": 0.00019095314121941266, "elapsed": 1063.291233274038, "steps_per_second": 31.59601081156057, "loss_extra": 0.023466456346213818} +{"step": 31600, "loss": 0.022248818203806878, "loss_real": 0.017205301760695874, "loss_synth": 0.02192370072007179, "lr": 0.0001875624149858636, "elapsed": 1067.1168197769439, "steps_per_second": 31.675326184944137, "loss_extra": 0.023448761720210314} +{"step": 31800, "loss": 0.022215109672397374, "loss_real": 0.016687539792619645, "loss_synth": 0.02181819228455424, "lr": 0.00018419039141996036, "elapsed": 1071.0404017289402, "steps_per_second": 31.750928614507764, "loss_extra": 0.023570642797276376} +{"step": 32000, "loss": 0.022217422015964983, "loss_real": 0.01689486557152122, "loss_synth": 0.021893402207642795, "lr": 0.0001808376030033136, "elapsed": 1075.019118390046, "steps_per_second": 31.824195913164655, "loss_extra": 0.0234647495765239} +{"step": 32200, "loss": 0.022212492851540446, "loss_real": 0.016927300128154455, "loss_synth": 0.021890570977702736, "lr": 0.0001775045791800812, "elapsed": 1078.8914245329797, "steps_per_second": 31.900248263369356, "loss_extra": 0.023451240211725236} +{"step": 32400, "loss": 0.02225819867104292, "loss_real": 0.0172310057701543, "loss_synth": 0.021860875934362412, "lr": 0.00017419184627336242, "elapsed": 1082.7465309529798, "steps_per_second": 31.976262100330988, "loss_extra": 0.023527205316349865} +{"step": 32600, "loss": 0.02216319577768445, "loss_real": 0.016729626283049585, "loss_synth": 0.021844552122056483, "lr": 0.00017089992740208575, "elapsed": 1086.6839093610179, "steps_per_second": 32.04910730385681, "loss_extra": 0.02342445601709187} +{"step": 32800, "loss": 0.022096912544220686, "loss_real": 0.016809331160038708, "loss_synth": 0.021802515778690575, "lr": 0.00016762934239840198, "elapsed": 1090.7092477469705, "steps_per_second": 32.11862405329458, "loss_extra": 0.02330866601318121} +{"step": 33000, "loss": 0.02212245412170887, "loss_real": 0.016768425963819028, "loss_synth": 0.021768067451193928, "lr": 0.000164380607725597, "elapsed": 1094.739964095992, "steps_per_second": 32.18742609358599, "loss_extra": 0.023405487490817903} +{"step": 33200, "loss": 0.02207890327088535, "loss_real": 0.016687960526905955, "loss_synth": 0.021804079608991743, "lr": 0.00016115423639653619, "elapsed": 1098.5551639479818, "steps_per_second": 32.26244456883172, "loss_extra": 0.023289123782888055} +{"step": 33400, "loss": 0.022141611892729996, "loss_real": 0.016831329669803382, "loss_synth": 0.02189240597188473, "lr": 0.0001579507378926539, "elapsed": 1102.521183802979, "steps_per_second": 32.3321876837452, "loss_extra": 0.02331230995245278} +{"step": 33600, "loss": 0.022015293845906853, "loss_real": 0.016991524030454456, "loss_synth": 0.021656518038362264, "lr": 0.00015477061808349973, "elapsed": 1106.4040031649638, "steps_per_second": 32.40399724558843, "loss_extra": 0.023245322424918412} +{"step": 33800, "loss": 0.022057243986055255, "loss_real": 0.016889684423804282, "loss_synth": 0.021725152535364032, "lr": 0.0001516143791468568, "elapsed": 1110.2841912290314, "steps_per_second": 32.475353082120854, "loss_extra": 0.023285681623965503} +{"step": 34000, "loss": 0.021988841081038116, "loss_real": 0.016907978844828905, "loss_synth": 0.021651555290445684, "lr": 0.00014848251948944142, "elapsed": 1114.1659769059625, "steps_per_second": 32.54612908825482, "loss_extra": 0.023207388930022717} +{"step": 34200, "loss": 0.021943945456296205, "loss_real": 0.01654120907187462, "loss_synth": 0.021649705013260245, "lr": 0.00014537553366819925, "elapsed": 1118.0452378760092, "steps_per_second": 32.616459587699524, "loss_extra": 0.023175549414008855} +{"step": 34400, "loss": 0.021974009685218333, "loss_real": 0.016657849033363162, "loss_synth": 0.02172866945154965, "lr": 0.0001422939123122089, "elapsed": 1121.9239080039551, "steps_per_second": 32.6862899493324, "loss_extra": 0.023141879830509426} +{"step": 34600, "loss": 0.0218845768366009, "loss_real": 0.016592266354709864, "loss_synth": 0.021601083939895033, "lr": 0.00013923814204520548, "elapsed": 1125.798055583029, "steps_per_second": 32.755747754631, "loss_extra": 0.023086294624954463} +{"step": 34800, "loss": 0.021852981625124814, "loss_real": 0.01609232498332858, "loss_synth": 0.021621645409613848, "lr": 0.00013620870540873793, "elapsed": 1129.7042912530014, "steps_per_second": 32.82370445177426, "loss_extra": 0.023084129076451063} +{"step": 35000, "loss": 0.02194272574968636, "loss_real": 0.016502551599405706, "loss_synth": 0.02162636214867234, "lr": 0.00013320608078596944, "elapsed": 1133.592577064992, "steps_per_second": 32.891717019932074, "loss_extra": 0.023202863046899436} +{"step": 35200, "loss": 0.02187499185092747, "loss_real": 0.016709502809680997, "loss_synth": 0.0216361653059721, "lr": 0.00013023074232613552, "elapsed": 1138.2577628979925, "steps_per_second": 32.93527584234353, "loss_extra": 0.02301019974052906} +{"step": 35400, "loss": 0.02184362944215536, "loss_real": 0.01654583706986159, "loss_synth": 0.02156170442700386, "lr": 0.0001272831598696703, "elapsed": 1142.2843177799368, "steps_per_second": 32.998088097929255, "loss_extra": 0.023044738341122865} +{"step": 35600, "loss": 0.021843588072806598, "loss_real": 0.016382625862024724, "loss_synth": 0.021564383637160064, "lr": 0.00012436379887401295, "elapsed": 1146.2347078670282, "steps_per_second": 33.06276916374088, "loss_extra": 0.02307033510878682} +{"step": 35800, "loss": 0.021810601530596614, "loss_real": 0.016358653926290573, "loss_synth": 0.0215136643871665, "lr": 0.00012147312034010696, "elapsed": 1150.1581028120127, "steps_per_second": 33.12780486804333, "loss_extra": 0.02305343998596072} +{"step": 36000, "loss": 0.021788118090480566, "loss_real": 0.016681681331247093, "loss_synth": 0.02147646211087704, "lr": 0.00011861158073960271, "elapsed": 1155.4346153769875, "steps_per_second": 33.15101122483124, "loss_extra": 0.022985587920993568} +{"step": 36200, "loss": 0.021744035920128225, "loss_real": 0.016545574660412968, "loss_synth": 0.02141619263216853, "lr": 0.00011577963194277514, "elapsed": 1159.8960262109758, "steps_per_second": 33.19879155576079, "loss_extra": 0.022973611848428846} +{"step": 36400, "loss": 0.021728027015924453, "loss_real": 0.016390528734773396, "loss_synth": 0.0213549670483917, "lr": 0.0001129777211471684, "elapsed": 1163.8290977759752, "steps_per_second": 33.26223358358508, "loss_extra": 0.023026783065870405} +{"step": 36600, "loss": 0.021710512274876238, "loss_real": 0.016186083084903657, "loss_synth": 0.021403166437521576, "lr": 0.00011020629080697766, "elapsed": 1168.9394040600164, "steps_per_second": 33.289538088537, "loss_extra": 0.02297630744986236} +{"step": 36800, "loss": 0.02177688420750201, "loss_real": 0.016376881538890303, "loss_synth": 0.021506651928648354, "lr": 0.00010746577856318116, "elapsed": 1173.1330863899784, "steps_per_second": 33.34426098198693, "loss_extra": 0.022984106540679932} +{"step": 37000, "loss": 0.021695922054350378, "loss_real": 0.01643263499252498, "loss_synth": 0.02139714075252414, "lr": 0.00010475661717443124, "elapsed": 1176.9876025889535, "steps_per_second": 33.40879773737654, "loss_extra": 0.022907821303233503} +{"step": 37200, "loss": 0.021629174388945103, "loss_real": 0.016439175722189246, "loss_synth": 0.021367641957476737, "lr": 0.00010207923444871681, "elapsed": 1180.7346982050221, "steps_per_second": 33.47612258419236, "loss_extra": 0.022791250171139837} +{"step": 37400, "loss": 0.02169077755883336, "loss_real": 0.016291968724690378, "loss_synth": 0.021353447372093798, "lr": 9.94340531758075e-05, "elapsed": 1184.5402870370308, "steps_per_second": 33.54123530983693, "loss_extra": 0.022964606331661343} +{"step": 37600, "loss": 0.021637863554060457, "loss_real": 0.016167095694690943, "loss_synth": 0.021308030076324938, "lr": 9.682149106049004e-05, "elapsed": 1188.3130440630484, "steps_per_second": 33.60689125869045, "loss_extra": 0.022916728761047125} +{"step": 37800, "loss": 0.021689382027834655, "loss_real": 0.016311004706658423, "loss_synth": 0.0214083550311625, "lr": 9.424196065660837e-05, "elapsed": 1192.1427306289552, "steps_per_second": 33.67039837696118, "loss_extra": 0.02290359673090279} +{"step": 38000, "loss": 0.021600802894681692, "loss_real": 0.01620964990928769, "loss_synth": 0.021399880386888982, "lr": 9.169586930191606e-05, "elapsed": 1195.9498272510245, "steps_per_second": 33.73415019685737, "loss_extra": 0.022737471759319304} +{"step": 38200, "loss": 0.02157429496757686, "loss_real": 0.01614920356310904, "loss_synth": 0.021257032351568343, "lr": 8.91836190537533e-05, "elapsed": 1199.7388524720445, "steps_per_second": 33.798012919695424, "loss_extra": 0.022832707464694978} +{"step": 38400, "loss": 0.021575104109942914, "loss_real": 0.016006429651752113, "loss_synth": 0.021286335540935397, "lr": 8.670560662555727e-05, "elapsed": 1203.5238548159832, "steps_per_second": 33.86156899968185, "loss_extra": 0.022830087542533874} +{"step": 38600, "loss": 0.021587431244552136, "loss_real": 0.016204364150762558, "loss_synth": 0.021243313355371357, "lr": 8.426222332421624e-05, "elapsed": 1207.3683775969548, "steps_per_second": 33.92292769501754, "loss_extra": 0.02286528393626213} +{"step": 38800, "loss": 0.021536647882312535, "loss_real": 0.016331782303750514, "loss_synth": 0.021198769668117165, "lr": 8.185385498827815e-05, "elapsed": 1211.1493069599383, "steps_per_second": 33.9857661513098, "loss_extra": 0.022777328649535775} +{"step": 39000, "loss": 0.021594535261392593, "loss_real": 0.01610318529419601, "loss_synth": 0.021251235818490387, "lr": 7.948088192702195e-05, "elapsed": 1214.9381730769528, "steps_per_second": 34.04795384979949, "loss_extra": 0.022890384774655104} +{"step": 39200, "loss": 0.02153903478756547, "loss_real": 0.01613055616617203, "loss_synth": 0.021229634396731853, "lr": 7.714367886040248e-05, "elapsed": 1218.7747592689702, "steps_per_second": 34.10831521474868, "loss_extra": 0.022786731952801346} +{"step": 39400, "loss": 0.021548932334408164, "loss_real": 0.016107922499068082, "loss_synth": 0.021230746349319814, "lr": 7.48426148598775e-05, "elapsed": 1222.592774305027, "steps_per_second": 34.16882520152685, "loss_extra": 0.022811029264703395} +{"step": 39600, "loss": 0.021459962902590633, "loss_real": 0.016093350909650327, "loss_synth": 0.02112918487749994, "lr": 7.25780532901276e-05, "elapsed": 1226.400350571028, "steps_per_second": 34.22924465484104, "loss_extra": 0.022721673911437392} +{"step": 39800, "loss": 0.021488038748502733, "loss_real": 0.016219890397042035, "loss_synth": 0.021214688671752812, "lr": 7.035035175167622e-05, "elapsed": 1230.1972709100228, "steps_per_second": 34.289582488052275, "loss_extra": 0.022675459245219826} +{"step": 40000, "loss": 0.021482291640713812, "loss_real": 0.015794052947312592, "loss_synth": 0.021194831114262343, "lr": 6.81598620244206e-05, "elapsed": 1234.034435636946, "steps_per_second": 34.34833981212407, "loss_extra": 0.022756744055077435} +{"step": 40200, "loss": 0.02140735282562673, "loss_real": 0.01577208043076098, "loss_synth": 0.02112916361540556, "lr": 6.600693001208181e-05, "elapsed": 1250.1826048039366, "steps_per_second": 34.04795318311163, "loss_extra": 0.022663371469825506} +{"step": 40400, "loss": 0.021512505244463683, "loss_real": 0.016057664668187498, "loss_synth": 0.021224478771910072, "lr": 6.38918956875819e-05, "elapsed": 1254.0021284540417, "steps_per_second": 34.10700984559962, "loss_extra": 0.022746973568573595} +{"step": 40600, "loss": 0.02149166140705347, "loss_real": 0.016027584145776926, "loss_synth": 0.021268284749239683, "lr": 6.181509303935915e-05, "elapsed": 1257.8030277460348, "steps_per_second": 34.16622231312811, "loss_extra": 0.02266335817053914} +{"step": 40800, "loss": 0.021408213125541805, "loss_real": 0.016049686186015606, "loss_synth": 0.021061334256082774, "lr": 5.977685001862671e-05, "elapsed": 1261.6017206319375, "steps_per_second": 34.22512059929351, "loss_extra": 0.02268455184996128} +{"step": 41000, "loss": 0.021431653825566173, "loss_real": 0.015747703593224287, "loss_synth": 0.021159651735797525, "lr": 5.7777488487585654e-05, "elapsed": 1265.3867347169435, "steps_per_second": 34.28403681034813, "loss_extra": 0.022689968720078467} +{"step": 41200, "loss": 0.021402953900396825, "loss_real": 0.016077536791563034, "loss_synth": 0.021083062635734676, "lr": 5.581732416859908e-05, "elapsed": 1269.1974467569962, "steps_per_second": 34.34184566636576, "loss_extra": 0.022646667156368493} +{"step": 41400, "loss": 0.021359182577580214, "loss_real": 0.016021722578443587, "loss_synth": 0.021024301778525115, "lr": 5.3896666594335835e-05, "elapsed": 1273.012036288972, "steps_per_second": 34.39917759589742, "loss_extra": 0.02261991387233138} +{"step": 41600, "loss": 0.021323749143630267, "loss_real": 0.01586228286381811, "loss_synth": 0.02100981229916215, "lr": 5.20158190588919e-05, "elapsed": 1276.844206616981, "steps_per_second": 34.45564549701224, "loss_extra": 0.022585169160738588} +{"step": 41800, "loss": 0.02137598660774529, "loss_real": 0.01583031365647912, "loss_synth": 0.021073800530284643, "lr": 5.017507856989665e-05, "elapsed": 1280.659727487946, "steps_per_second": 34.51223048987433, "loss_extra": 0.02264033489860594} +{"step": 42000, "loss": 0.021365731917321683, "loss_real": 0.015986329740844667, "loss_synth": 0.021021980084478854, "lr": 4.837473580161169e-05, "elapsed": 1284.4754368040012, "steps_per_second": 34.56845473564701, "loss_extra": 0.02264258371666074} +{"step": 42200, "loss": 0.02123405582271516, "loss_real": 0.015572926341556013, "loss_synth": 0.020928293541073797, "lr": 4.6615075049030575e-05, "elapsed": 1288.3171063830378, "steps_per_second": 34.62358945925812, "loss_extra": 0.022522023301571607} +{"step": 42400, "loss": 0.021342356977984308, "loss_real": 0.015867844759486615, "loss_synth": 0.021065907496958972, "lr": 4.489637418298455e-05, "elapsed": 1292.089785492979, "steps_per_second": 34.680334595796, "loss_extra": 0.022568714935332537} +{"step": 42600, "loss": 0.021346884025260807, "loss_real": 0.01617461766116321, "loss_synth": 0.020990412831306458, "lr": 4.321890460626433e-05, "elapsed": 1295.9123938729754, "steps_per_second": 34.73531640991889, "loss_extra": 0.022600415740162135} +{"step": 42800, "loss": 0.0213025457598269, "loss_real": 0.015701065575703978, "loss_synth": 0.021016679406166076, "lr": 4.158293121076186e-05, "elapsed": 1299.7039129020413, "steps_per_second": 34.790835741439004, "loss_extra": 0.022560338247567414} +{"step": 43000, "loss": 0.021250462559983134, "loss_real": 0.015614936393685639, "loss_synth": 0.021008364353328944, "lr": 3.99887123356411e-05, "elapsed": 1303.5043844890315, "steps_per_second": 34.845761102213814, "loss_extra": 0.02247058772481978} +{"step": 43200, "loss": 0.021267856219783426, "loss_real": 0.016058215661905705, "loss_synth": 0.021015123827382923, "lr": 3.843649972654328e-05, "elapsed": 1307.341217787005, "steps_per_second": 34.899323991330625, "loss_extra": 0.02242458169348538} +{"step": 43400, "loss": 0.02130762648768723, "loss_real": 0.0156412468617782, "loss_synth": 0.02099351417273283, "lr": 3.69265384958331e-05, "elapsed": 1311.1600232010242, "steps_per_second": 34.953063334574985, "loss_extra": 0.022604820327833296} +{"step": 43600, "loss": 0.02129340629093349, "loss_real": 0.015743743018247186, "loss_synth": 0.021000702334567904, "lr": 3.545906708389291e-05, "elapsed": 1314.96236936294, "steps_per_second": 35.00693576087832, "loss_extra": 0.022549005886539818} +{"step": 43800, "loss": 0.02125293972902, "loss_real": 0.015980213712900877, "loss_synth": 0.020927238101139663, "lr": 3.403431722147019e-05, "elapsed": 1318.781907454948, "steps_per_second": 35.05999777146578, "loss_extra": 0.02249328508041799} +{"step": 44000, "loss": 0.021239949790760874, "loss_real": 0.015639520012773574, "loss_synth": 0.02100743063725531, "lr": 3.265251389308442e-05, "elapsed": 1322.7819995980244, "steps_per_second": 35.10767780906968, "loss_extra": 0.022444438822567463} +{"step": 44200, "loss": 0.02125534017570317, "loss_real": 0.015720644020475447, "loss_synth": 0.021025383602827786, "lr": 3.1313875301499545e-05, "elapsed": 1326.6657851509517, "steps_per_second": 35.15830680489361, "loss_extra": 0.022445857971906662} +{"step": 44400, "loss": 0.0212187462951988, "loss_real": 0.015972250644117593, "loss_synth": 0.020915692169219256, "lr": 3.0018612833267117e-05, "elapsed": 1330.6194243379869, "steps_per_second": 35.20667375222983, "loss_extra": 0.022431982988491653} +{"step": 44600, "loss": 0.02123056398704648, "loss_real": 0.015819806940853595, "loss_synth": 0.02101170230656862, "lr": 2.8766931025346027e-05, "elapsed": 1335.450756425038, "steps_per_second": 35.230296090671395, "loss_extra": 0.02238850178197026} +{"step": 44800, "loss": 0.02121692130342126, "loss_real": 0.01574664982035756, "loss_synth": 0.020915415221825242, "lr": 2.755902753280375e-05, "elapsed": 1339.9489000260364, "steps_per_second": 35.262984490589716, "loss_extra": 0.022467493060976267} +{"step": 45000, "loss": 0.02117742907255888, "loss_real": 0.015819054185412823, "loss_synth": 0.020821726536378263, "lr": 2.639509309760422e-05, "elapsed": 1343.9720098270336, "steps_per_second": 35.30859780235331, "loss_extra": 0.022462527845054866} +{"step": 45200, "loss": 0.021181118115782736, "loss_real": 0.015631568753160536, "loss_synth": 0.02089583351276815, "lr": 2.5275311518487436e-05, "elapsed": 1349.269199080998, "steps_per_second": 35.31872746946688, "loss_extra": 0.022429309571161866} +{"step": 45400, "loss": 0.021219334695488215, "loss_real": 0.0157662803074345, "loss_synth": 0.020945498840883373, "lr": 2.4199859621945708e-05, "elapsed": 1353.192359840963, "steps_per_second": 35.366588398586785, "loss_extra": 0.02243936212733388} +{"step": 45600, "loss": 0.02114186443388462, "loss_real": 0.015726757990196346, "loss_synth": 0.020783711839467287, "lr": 2.316890723430054e-05, "elapsed": 1357.2604721889365, "steps_per_second": 35.410171437300896, "loss_extra": 0.022439258890226483} +{"step": 45800, "loss": 0.02120779694058001, "loss_real": 0.01586306354496628, "loss_synth": 0.020983308777213095, "lr": 2.218261715488513e-05, "elapsed": 1361.13863747695, "steps_per_second": 35.45869372910496, "loss_extra": 0.022359866937622427} +{"step": 46000, "loss": 0.021226132279261945, "loss_real": 0.015773257040418685, "loss_synth": 0.02088743635453284, "lr": 2.1241145130336496e-05, "elapsed": 1364.9154485530453, "steps_per_second": 35.50970358379185, "loss_extra": 0.02251071384176612} +{"step": 46200, "loss": 0.021164913354441525, "loss_real": 0.01567847419064492, "loss_synth": 0.0208434649836272, "lr": 2.0344639830001105e-05, "elapsed": 1368.7109762979671, "steps_per_second": 35.559904572649856, "loss_extra": 0.022438151491805912} +{"step": 46400, "loss": 0.021205266322940588, "loss_real": 0.015697277253493666, "loss_synth": 0.020862516751512884, "lr": 1.949324282245851e-05, "elapsed": 1372.517394331051, "steps_per_second": 35.609515486024584, "loss_extra": 0.022503459360450506} +{"step": 46600, "loss": 0.021054148487746716, "loss_real": 0.015554691404104233, "loss_synth": 0.020863907858729363, "lr": 1.8687088553165976e-05, "elapsed": 1376.3073193640448, "steps_per_second": 35.659287435170235, "loss_extra": 0.022198996562510728} +{"step": 46800, "loss": 0.021112361289560795, "loss_real": 0.015404053218662738, "loss_synth": 0.020854344610124826, "lr": 1.7926304323227836e-05, "elapsed": 1380.0910916560097, "steps_per_second": 35.70893917031604, "loss_extra": 0.022360981544479727} +{"step": 47000, "loss": 0.021143571976572274, "loss_real": 0.01568757352884859, "loss_synth": 0.020865386463701726, "lr": 1.721101026929328e-05, "elapsed": 1383.8719392699422, "steps_per_second": 35.758384604965016, "loss_extra": 0.022368441997095943} +{"step": 47200, "loss": 0.02121130014769733, "loss_real": 0.015893654748797417, "loss_synth": 0.02092011976055801, "lr": 1.6541319344585365e-05, "elapsed": 1387.6832714549964, "steps_per_second": 35.8067183103055, "loss_extra": 0.02242507425136864} +{"step": 47400, "loss": 0.021158435000106692, "loss_real": 0.015577933201566339, "loss_synth": 0.0208421631809324, "lr": 1.5917337301064426e-05, "elapsed": 1391.5158369579585, "steps_per_second": 35.85419742506771, "loss_extra": 0.022442860174924136} +{"step": 47600, "loss": 0.0210889904294163, "loss_real": 0.015501236766576767, "loss_synth": 0.020767704909667374, "lr": 1.533916267272854e-05, "elapsed": 1395.3535371680046, "steps_per_second": 35.90126304631566, "loss_extra": 0.022379667731001973} +{"step": 47800, "loss": 0.02112217592075467, "loss_real": 0.015700857145711778, "loss_synth": 0.020860696313902735, "lr": 1.480688676005397e-05, "elapsed": 1399.1901433150051, "steps_per_second": 35.9480865483834, "loss_extra": 0.022324386173859238} +{"step": 48000, "loss": 0.02111720198765397, "loss_real": 0.015745102958753705, "loss_synth": 0.020825100177899004, "lr": 1.432059361557764e-05, "elapsed": 1402.9892782450188, "steps_per_second": 35.995652077591906, "loss_extra": 0.022341353800147772} +{"step": 48200, "loss": 0.021161462143063546, "loss_real": 0.015597894391976296, "loss_synth": 0.02080004271119833, "lr": 1.3880360030624374e-05, "elapsed": 1406.8085762299597, "steps_per_second": 36.04240391941459, "loss_extra": 0.02248790133744478} +{"step": 48400, "loss": 0.021150348205119372, "loss_real": 0.015652377498336135, "loss_synth": 0.02087201246060431, "lr": 1.3486255523180529e-05, "elapsed": 1410.603372212965, "steps_per_second": 36.08954881317593, "loss_extra": 0.022382659697905184} +{"step": 48600, "loss": 0.021174978706985714, "loss_real": 0.015709890741854905, "loss_synth": 0.020848306119441985, "lr": 1.313834232691649e-05, "elapsed": 1414.4187300379854, "steps_per_second": 36.13587520916005, "loss_extra": 0.022449709381908177} +{"step": 48800, "loss": 0.021200138218700884, "loss_real": 0.015687024416401983, "loss_synth": 0.02097213546745479, "lr": 1.2836675381359077e-05, "elapsed": 1418.228812493966, "steps_per_second": 36.18208101217538, "loss_extra": 0.02238496085628867} +{"step": 49000, "loss": 0.02118399920873344, "loss_real": 0.015663991277106108, "loss_synth": 0.020874703880399467, "lr": 1.2581302323216026e-05, "elapsed": 1422.0003083009506, "steps_per_second": 36.229060073567425, "loss_extra": 0.022450967440381647} +{"step": 49200, "loss": 0.021174445720389484, "loss_real": 0.01583405405282974, "loss_synth": 0.02084531937725842, "lr": 1.2372263478853567e-05, "elapsed": 1425.7998656999553, "steps_per_second": 36.27502732610367, "loss_extra": 0.022429956858977675} +{"step": 49400, "loss": 0.021096259728074072, "loss_real": 0.015616040625609458, "loss_synth": 0.020818023532629012, "lr": 1.2209591857928498e-05, "elapsed": 1429.6158455710392, "steps_per_second": 36.320299193851355, "loss_extra": 0.022325388416647912} +{"step": 49600, "loss": 0.021156055117025972, "loss_real": 0.015469121476635338, "loss_synth": 0.020907999472692607, "lr": 1.2093313148175555e-05, "elapsed": 1433.4181824129773, "steps_per_second": 36.36568149774021, "loss_extra": 0.022391043175011872} +{"step": 49800, "loss": 0.021055425917729735, "loss_real": 0.015804829099215566, "loss_synth": 0.020773946437984706, "lr": 1.2023445711350887e-05, "elapsed": 1437.2154370569624, "steps_per_second": 36.41094678044385, "loss_extra": 0.0222478920314461} +{"step": 50000, "loss": 0.021102029643952847, "loss_real": 0.015656276815570892, "loss_synth": 0.02080781645141542, "lr": 1.2000000580332747e-05, "elapsed": 1441.0220626320224, "steps_per_second": 36.455712324981626, "loss_extra": 0.02234107960946858} diff --git a/shared/package-files/c2/c29db284169668eb72343128f5537a3f7c6a640daa3efe6f5c897add895e97b9/ensemble-mean-6M-B4s-30k.log b/shared/package-files/c2/c29db284169668eb72343128f5537a3f7c6a640daa3efe6f5c897add895e97b9/ensemble-mean-6M-B4s-30k.log new file mode 100644 index 0000000000000000000000000000000000000000..ad154ac9e430bfd27f51e5ef548ea007ff494d76 --- /dev/null +++ b/shared/package-files/c2/c29db284169668eb72343128f5537a3f7c6a640daa3efe6f5c897add895e97b9/ensemble-mean-6M-B4s-30k.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 57.987305687274784} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 62.20127816312015} +ind meanD all=0.5007 dom=0.7411 non=0.2594 h5=0.6499 h20=0.7276 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6432 dom=0.8134 non=0.4723 h5=0.8466 h20=0.9105 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.5069 dom=0.7503 non=0.2625 h5=0.6529 h20=0.7267 | diff=+0.0061 [+0.0036,+0.0086] +agg Dmean all=0.6534 dom=0.8233 non=0.4828 h5=0.8453 h20=0.9120 | diff=+0.0102 [+0.0030,+0.0177] +ind gmean all=0.4976 dom=0.7359 non=0.2584 h5=0.6475 h20=0.7243 | diff=-0.0031 [-0.0049,-0.0015] +agg gmean all=0.6357 dom=0.8136 non=0.4570 h5=0.8480 h20=0.9049 | diff=-0.0075 [-0.0168,-0.0004] diff --git a/shared/package-files/c2/c2acafc0019e7384743e2bd1b3ce0bc69988968628b07f79f7f62db6a875c487/fullfold-4M-I1+I3x2.report.json b/shared/package-files/c2/c2acafc0019e7384743e2bd1b3ce0bc69988968628b07f79f7f62db6a875c487/fullfold-4M-I1+I3x2.report.json new file mode 100644 index 0000000000000000000000000000000000000000..d7d0d2b62fdbf9facac674e875295f9375c5e8aa --- /dev/null +++ b/shared/package-files/c2/c2acafc0019e7384743e2bd1b3ce0bc69988968628b07f79f7f62db6a875c487/fullfold-4M-I1+I3x2.report.json @@ -0,0 +1,111 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.7315868032322816, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.5236869876438175, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.7315868032322816, + "hit_rate_at_20": 0.9151783416542282, + "hit_rate_at_5": 0.856348757012713 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8064933297032398, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.49926113573991976, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.7326079108864937, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 0.21052631578947367, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.9165851272015656, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.8959795788130185, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.8, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.9240384615384616, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.5521472392638037, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.6934156378600823, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7261390595535008, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.7747603833865815, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.5558535327488396, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.9066159852064927, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.7315868032322816, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.6760187152869559, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.7795913501685353 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/c3/c3030672e6917b3960b036bb95eba5958dad7eb2df92610f7a3364728f8edd86/compare_rankings.py b/shared/package-files/c3/c3030672e6917b3960b036bb95eba5958dad7eb2df92610f7a3364728f8edd86/compare_rankings.py new file mode 100644 index 0000000000000000000000000000000000000000..6d71bfb4cf5fb52ea0a3a77f03a84e089db63b49 --- /dev/null +++ b/shared/package-files/c3/c3030672e6917b3960b036bb95eba5958dad7eb2df92610f7a3364728f8edd86/compare_rankings.py @@ -0,0 +1,43 @@ +"""Agreement of two ranking files on their common queries. + +compare_rankings.py A/rankings.jsonl B/rankings.jsonl + +Prints the number of common queries, and for how many of them the top candidate, the ordered top five +and the complete ranking are identical; for the differing ones the median first differing rank (1-based) +and the pools they belong to are not known here (rankings carry no pool id) - only counts are reported. +""" +import json +import statistics +import sys + + +def load(path): + out = {} + with open(path) as handle: + for line in handle: + row = json.loads(line) + key = next(k for k in ('query_id', 'identifier', 'id') if k in row) + ranking = next(v for k, v in row.items() if isinstance(v, list)) + out[row[key]] = ranking + return out + + +def main(): + a, b = load(sys.argv[1]), load(sys.argv[2]) + common = [q for q in a if q in b] + top1 = sum(a[q][:1] == b[q][:1] for q in common) + top5 = sum(a[q][:5] == b[q][:5] for q in common) + full = sum(a[q] == b[q] for q in common) + first = [] + for q in common: + if a[q] != b[q]: + first.append(next((i + 1 for i, (x, y) in enumerate(zip(a[q], b[q])) if x != y), min(len(a[q]), len(b[q])) + 1)) + print(json.dumps({'a': len(a), 'b': len(b), 'common': len(common), 'same_top1': top1, 'same_top5': top5, + 'same_ranking': full, 'differing': len(first), + 'first_difference_min': min(first) if first else None, + 'first_difference_median': statistics.median(first) if first else None, + 'top5_differing_queries': [q for q in common if a[q][:5] != b[q][:5]][:40]})) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/c3/c311f288342048a708ea992b414069abd0d95cffabcad38e57174b6c59025635/eval-score-I9b+I14.log b/shared/package-files/c3/c311f288342048a708ea992b414069abd0d95cffabcad38e57174b6c59025635/eval-score-I9b+I14.log new file mode 100644 index 0000000000000000000000000000000000000000..3cd7a1b61e94e606c2114ba1578f5a0c947aab87 --- /dev/null +++ b/shared/package-files/c3/c311f288342048a708ea992b414069abd0d95cffabcad38e57174b6c59025635/eval-score-I9b+I14.log @@ -0,0 +1,41 @@ +19429 queries, 2 members, 70.2 s +cos pool rule all=0.5970 dom=0.8390 non=0.3540 h5=0.7041 macro=0.7156 +cen pool rule all=0.5806 dom=0.8143 non=0.3460 h5=0.6973 macro=0.6893 +cos_pm pool rule all=0.5972 dom=0.8398 non=0.3536 h5=0.7013 macro=0.7165 +dot pool rule all=0.5712 dom=0.7952 non=0.3464 h5=0.6952 macro=0.6902 +geo pool rule all=0.5786 dom=0.8167 non=0.3395 h5=0.6872 macro=0.6985 +idf05 pool rule all=0.6013 dom=0.8369 non=0.3648 h5=0.7077 macro=0.7156 +idf1 pool rule all=0.6045 dom=0.8355 non=0.3726 h5=0.7118 macro=0.7174 +lin pool rule all=0.5453 dom=0.7735 non=0.3162 h5=0.6667 macro=0.6621 +log01 pool rule all=0.5984 dom=0.8378 non=0.3580 h5=0.7267 macro=0.7126 +log05 pool rule all=0.6106 dom=0.8470 non=0.3732 h5=0.7236 macro=0.7212 +log20 pool rule all=0.6066 dom=0.8460 non=0.3663 h5=0.7142 macro=0.7212 +nll02 pool rule all=0.4443 dom=0.7145 non=0.1731 h5=0.5874 macro=0.5783 +nll10 pool rule all=0.4123 dom=0.6713 non=0.1522 h5=0.5408 macro=0.5298 +poolcen pool rule all=0.5790 dom=0.8111 non=0.3461 h5=0.6996 macro=0.6872 +pow020 pool rule all=0.5509 dom=0.7754 non=0.3255 h5=0.7164 macro=0.6627 +pow030 pool rule all=0.5702 dom=0.7983 non=0.3412 h5=0.7150 macro=0.6831 +pow040 pool rule all=0.5957 dom=0.8250 non=0.3653 h5=0.7243 macro=0.7041 +pow05 pool rule all=0.6046 dom=0.8389 non=0.3693 h5=0.7191 macro=0.7165 +pow05idf025 pool rule all=0.6028 dom=0.8363 non=0.3683 h5=0.7273 macro=0.7165 +pow05idf05 pool rule all=0.6031 dom=0.8348 non=0.3705 h5=0.7318 macro=0.7177 +pow05m pool rule all=0.6052 dom=0.8387 non=0.3707 h5=0.7181 macro=0.7162 +pow05s pool rule all=0.5944 dom=0.8351 non=0.3528 h5=0.7108 macro=0.7118 +pow060 pool rule all=0.6068 dom=0.8432 non=0.3694 h5=0.7179 macro=0.7200 +pow060idf025 pool rule all=0.6084 dom=0.8438 non=0.3719 h5=0.7250 macro=0.7227 +pow060idf050 pool rule all=0.6128 dom=0.8441 non=0.3807 h5=0.7330 macro=0.7221 +pow060m pool rule all=0.6038 dom=0.8434 non=0.3632 h5=0.7157 macro=0.7203 +pow065 pool rule all=0.6049 dom=0.8431 non=0.3658 h5=0.7171 macro=0.7200 +pow070 pool rule all=0.6036 dom=0.8417 non=0.3645 h5=0.7144 macro=0.7185 +pow070idf025 pool rule all=0.6059 dom=0.8433 non=0.3676 h5=0.7169 macro=0.7224 +pow070idf050 pool rule all=0.6063 dom=0.8448 non=0.3668 h5=0.7225 macro=0.7218 +pow070m pool rule all=0.5999 dom=0.8412 non=0.3577 h5=0.7136 macro=0.7183 +pow075 pool rule all=0.6021 dom=0.8419 non=0.3614 h5=0.7128 macro=0.7188 +pow080 pool rule all=0.6027 dom=0.8430 non=0.3613 h5=0.7122 macro=0.7200 +pow080m pool rule all=0.6023 dom=0.8421 non=0.3615 h5=0.7110 macro=0.7188 +pow085 pool rule all=0.6032 dom=0.8435 non=0.3619 h5=0.7108 macro=0.7203 +pow085idf025 pool rule all=0.6038 dom=0.8415 non=0.3652 h5=0.7119 macro=0.7191 +pow085idf050 pool rule all=0.6043 dom=0.8403 non=0.3673 h5=0.7128 macro=0.7183 +pow090 pool rule all=0.6000 dom=0.8427 non=0.3564 h5=0.7108 macro=0.7183 +pow2 pool rule all=0.5603 dom=0.7933 non=0.3265 h5=0.6768 macro=0.6796 +tani pool rule all=0.5656 dom=0.7996 non=0.3307 h5=0.6913 macro=0.6867 diff --git a/shared/package-files/c3/c34e5f4132d4fb797c51e98b88d587e6be9409b07ac1496db53be7a56a6d4b61/build-5Ms-N5-L-ion-net.log b/shared/package-files/c3/c34e5f4132d4fb797c51e98b88d587e6be9409b07ac1496db53be7a56a6d4b61/build-5Ms-N5-L-ion-net.log new file mode 100644 index 0000000000000000000000000000000000000000..c70a5f36e93e167a669a3e846c1ae9198738f72f --- /dev/null +++ b/shared/package-files/c3/c34e5f4132d4fb797c51e98b88d587e6be9409b07ac1496db53be7a56a6d4b61/build-5Ms-N5-L-ion-net.log @@ -0,0 +1,1112 @@ +{ + "built": "/run-state/workspace/research/builds/5Ms-N5-L-ion-net", + "checkpoint_sha256": "983068f579f829c65c3f3f63d33319876c383c3150834a6729354d4972a8ce6c", + "members": [ + { + "source": "runs/B-all-b32/checkpoints/step-0020000-ema.ckpt", + "sha256": "80ec4715663e505007412e3d89dbe6020cd145713840c15affaf82604fc5765c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 5136.2172065590275, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B-all-b32/checkpoints/step-0030000-ema.ckpt", + "sha256": "0228e4fa0589333f02db8223e49d6ecd23cd100d1a6182ad268d9db4f8468798", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8314.79353913304, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0020000-ema.ckpt", + "sha256": "ac3c85cdabfb5f68ca3ca506732f1f8e79fa6e9f3d5bf5fa574b6e1f3249312c", + "global_step": 20000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 6945.18486677701, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/B2-all-b32-seed2/checkpoints/step-0030000-ema.ckpt", + "sha256": "f11667b8ee56a15c82d26ab9052816ecc63f2081eaa6fd4ea82d38d1e2a36ce1", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 2, + "elapsed_seconds": 9298.063542745003, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "random", + "training_data": "MassSpecGym v1.5 train fold", + "synthetic": null + }, + { + "source": "runs/S2-B20k-synth/checkpoints/step-0030000-ema.ckpt", + "sha256": "44742fa31f337e59b543d903018780560569c2e8e50a008ba008859c8440e3a2", + "global_step": 30000, + "weights": "ema", + "subset": "all", + "seed": 1, + "elapsed_seconds": 8906.84206694903, + "data_manifest_sha256": "695645989510ffe27c4ef0d2f8f8f14f8c5514a5b23b5bfda55a7d035503ed4e", + "initialization": "own-checkpoint:6c5a43fada335e5f4e9f8265ec6cfd54a8f317eb8d2100d96ea3731809005be2", + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus (auxiliary intensity term)", + "synthetic": { + "manifest_sha256": "431454e702f8da3194684fc9a565135d29a38a407aaa31e9399d871360c6e962", + "per_item": 1, + "weight": 1.0, + "schedule": "e2e", + "instrument": "flag" + } + } + ], + "config": { + "sparse_k": 100, + "inference_batch_size": 128, + "workers": 14, + "num_bins": 150000, + "upper_limit": 1500, + "max_observed_peaks": 50, + "observed_intensity_threshold": 0.001, + "ensemble": "prediction", + "pool_aggregation": 1.0, + "autocast": false, + "model": { + "pe_embed_k": 14, + "embed_elem_group": true, + "multi_hop_max_dist": 10 + }, + "checkpoint": "model.pt", + "views": [ + { + "precursor_window": 0.5, + "pred_power": 0.75, + "match_ppm": 20, + "match_floor_mda": 4, + "match_by_instrument": { + "Orbitrap": [ + 10, + 1 + ] + } + } + ], + "inverse": { + "pooled": true, + "score": { + "members": "probability", + "power": 0.7 + }, + "weight_domain": 0.75, + "weight_other": 0.05, + "weight_other_single": 0.5, + "batch": 2048 + }, + "library": { + "kind": "sum", + "k": 20, + "top": 32, + "power": 6, + "debias": true, + "weight_domain": 0.0, + "weight_other": 0.4, + "weight_other_single": 0.0 + }, + "ion": { + "weight_domain": 0.05, + "weight_other": 0.01 + }, + "consensus": { + "k": 10, + "top": 32, + "power": 3.0, + "answers": 10, + "temperature": 0.02, + "absorb": 0.5, + "bin": 0.01, + "weight_domain": 1.0, + "weight_other": 1.0 + }, + "inverse_members": [ + { + "source": "runs/I16-ff512x6-real08-corpus2+train3-noise05/step-0050000-ema.pt", + "sha256": "035b6418b0be40e11479e170e5c926b352bc56cd8ce823cdfa88169421c91ff1", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus + spectra of the corpus structures simulated by our own train-fold-trained GLACIER forward members (self-simulation, E60)", + "self_simulated_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + }, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "runs/I16-ff512x6-real08-corpus2+train3-noise05", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 0.5, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "init": null, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I18-ff512x6-real08-corpus2+train3-noise05-real025/step-0050000-ema.pt", + "sha256": "2eb34f936b8645b0eaabfcb2a483c2c88d6fb640937a89c66cda6a9def1ef267", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus + spectra of the corpus structures simulated by our own train-fold-trained GLACIER forward members (self-simulation, E60)", + "self_simulated_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + }, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "runs/I18-ff512x6-real08-corpus2+train3-noise05-real025", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 0.5, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "noise_real_rate": 0.25, + "synth_peak_drop": -1.0, + "init": null, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I19-ff512x6-real08-corpus2+train3-noise05-jit08/step-0050000-ema.pt", + "sha256": "7b95edd35fa25625b8ad091d901545d59b5257c95122f7912931317abbc42701", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus + spectra of the corpus structures simulated by our own train-fold-trained GLACIER forward members (self-simulation, E60)", + "self_simulated_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + }, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "runs/I19-ff512x6-real08-corpus2+train3-noise05-jit08", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 0.5, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "noise_real_rate": 0.0, + "synth_peak_drop": -1.0, + "synth_jitter": 0.8, + "noise_near": 0.0, + "noise_deltas": "inv/noise_deltas.json", + "init": null, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I20-ff512x6-real08-corpus2+train3-noise05-near067/step-0050000-ema.pt", + "sha256": "0e017ce27059d5215f38a8b16124408a8a2e3e61c4b86704751485e6a6f610de", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus + spectra of the corpus structures simulated by our own train-fold-trained GLACIER forward members (self-simulation, E60)", + "self_simulated_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + }, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "runs/I20-ff512x6-real08-corpus2+train3-noise05-near067", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 0.5, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "noise_real_rate": 0.0, + "synth_peak_drop": -1.0, + "synth_jitter": -1.0, + "noise_near": 0.67, + "noise_deltas": "inv/noise_deltas.json", + "init": null, + "max_steps_this_run": 0 + } + }, + { + "source": "runs/I21-ff512x6-real08-corpus2+train3-noise05-real05/step-0050000-ema.pt", + "sha256": "152cbfe71ab16096186443adff88b0ad14cce4dae65c655858476185167d5ebc", + "step": 50000, + "class": "FormulaFormer", + "weights": "ema", + "initialization": "random", + "seed": 1, + "training_data": "MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus + spectra of the corpus structures simulated by our own train-fold-trained GLACIER forward members (self-simulation, E60)", + "self_simulated_store": { + "path": "inv/selfsim/corpus2+train3.npz", + "rows": 2031301, + "manifest": { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/corpus2.npz", + "inv/selfsim/train3.npz" + ], + "parts": [ + { + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 + }, + { + "name": "train3", + "source": "synth", + "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 1163260, + "failed": 0, + "rows": 1163260, + "seconds": 1262.926542488858, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 1163218, + "without_peak": 42, + "mean_annotated_peaks": 17.868643710809152, + "mean_candidates": 25.376552103570997, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 43.40271363919601 + } + ], + "spectra": 2031301, + "structures": 434950 + } + }, + "stores": { + "gen-x1.manifest.json": null, + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "recipe": { + "store": "/workspace/research/inv", + "out": "runs/I21-ff512x6-real08-corpus2+train3-noise05-real05", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 50000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "target": "", + "heavy_boost": 1.0, + "synth_structures": 1.0, + "extra_store": "inv/selfsim/corpus2+train3.npz", + "extra_frac": 0.5, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "noise_rate": 0.5, + "noise_max": 12, + "noise_scatter": 0.35, + "noise_shape": 3.0, + "noise_real_rate": 0.5, + "synth_peak_drop": -1.0, + "synth_jitter": -1.0, + "noise_near": 0.0, + "noise_deltas": "inv/noise_deltas.json", + "init": null, + "max_steps_this_run": 0 + } + } + ], + "library_asset": { + "schema": "train-library/v1", + "fold": "train", + "spectra": 194119, + "molecules": 25046, + "bin": 0.01, + "prior_sample": 1024, + "prior_seed": 0, + "fragment_entries": 6765621, + "loss_entries": 6763777, + "source": "/workspace/data/train.jsonl", + "source_sha256": "de7f46e91f7b67eb5ca67468381abbdb20a8f739a0ae4b27070276798ecad0fc", + "structure_store": "/run-state/workspace/research/inv/real-train.npz", + "structure_store_sha256": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "sha256": "22d1ddb216eef78d5040209ff6526371e5fcd8aac88e68a36823b6d5e73b3712", + "elapsed_seconds": 13.499361125999712, + "training_data": "MassSpecGym v1.5 train fold" + }, + "ion_asset": { + "source": "inv/ion_error_table.json", + "sha256": "39aca3a714fd25a20cbaba4d46942764b52d730828a4b8205bf46ac5fc2a6225", + "fit": "MassSpecGym v1.5 train fold (194,119 spectra with [M+H]+ / [M+Na]+), analysis/ion_fit.py", + "training_data": "MassSpecGym v1.5 train fold", + "window_da": 0.02, + "classes": { + "domain|Orbitrap": { + "median_ppm": 0.358, + "sigma_ppm": 1.51, + "background": 0.0204 + }, + "domain|QTOF": { + "median_ppm": 0.027, + "sigma_ppm": 4.348, + "background": 0.0869 + }, + "domain|other": { + "median_ppm": 0.027, + "sigma_ppm": 4.348, + "background": 0.0869 + }, + "H-no-energy|Orbitrap": { + "median_ppm": -0.943, + "sigma_ppm": 2.937, + "background": 0.1196 + }, + "H-no-energy|QTOF": { + "median_ppm": 0.665, + "sigma_ppm": 4.58, + "background": 0.08 + }, + "H-no-energy|other": { + "median_ppm": 0.851, + "sigma_ppm": 4.269, + "background": 0.1021 + }, + "Na|Orbitrap": { + "median_ppm": -0.872, + "sigma_ppm": 2.935, + "background": 0.1834 + }, + "Na|QTOF": { + "median_ppm": 1.119, + "sigma_ppm": 4.103, + "background": 0.0798 + }, + "Na|other": { + "median_ppm": 3.003, + "sigma_ppm": 2.969, + "background": 0.0319 + } + }, + "fallback": { + "domain|other": "domain|QTOF" + }, + "train_fold_statistics": { + "domain|Orbitrap": { + "spectra": 64738, + "present": 0.5068, + "median_ppm": 0.176, + "sigma_ppm": 1.093, + "beyond_3_sigma": 0.0763, + "ml_median_ppm": 0.358, + "ml_sigma_ppm": 1.51, + "ml_background": 0.0204, + "ml_mean_log_density": 6.2307 + }, + "domain|QTOF": { + "spectra": 34603, + "present": 0.5111, + "median_ppm": 0.045, + "sigma_ppm": 3.847, + "beyond_3_sigma": 0.0914, + "ml_median_ppm": 0.027, + "ml_sigma_ppm": 4.348, + "ml_background": 0.0869, + "ml_mean_log_density": 4.9233 + }, + "domain|other": { + "spectra": 36, + "present": 0.8611, + "median_ppm": 2.185, + "sigma_ppm": 4.203, + "beyond_3_sigma": 0.0, + "ml_median_ppm": 2.789, + "ml_sigma_ppm": 3.688, + "ml_background": 0.0, + "ml_mean_log_density": 5.6271 + }, + "H-no-energy|Orbitrap": { + "spectra": 51704, + "present": 0.5479, + "median_ppm": -0.989, + "sigma_ppm": 2.647, + "beyond_3_sigma": 0.1156, + "ml_median_ppm": -0.943, + "ml_sigma_ppm": 2.937, + "ml_background": 0.1196, + "ml_mean_log_density": 5.0128 + }, + "H-no-energy|QTOF": { + "spectra": 11931, + "present": 0.626, + "median_ppm": 0.801, + "sigma_ppm": 4.239, + "beyond_3_sigma": 0.0754, + "ml_median_ppm": 0.665, + "ml_sigma_ppm": 4.58, + "ml_background": 0.08, + "ml_mean_log_density": 4.7319 + }, + "H-no-energy|other": { + "spectra": 3467, + "present": 0.67, + "median_ppm": 0.61, + "sigma_ppm": 4.033, + "beyond_3_sigma": 0.0895, + "ml_median_ppm": 0.851, + "ml_sigma_ppm": 4.269, + "ml_background": 0.1021, + "ml_mean_log_density": 4.7426 + }, + "Na|Orbitrap": { + "spectra": 24454, + "present": 0.4954, + "median_ppm": -0.875, + "sigma_ppm": 2.797, + "beyond_3_sigma": 0.1574, + "ml_median_ppm": -0.872, + "ml_sigma_ppm": 2.935, + "ml_background": 0.1834, + "ml_mean_log_density": 4.589 + }, + "Na|QTOF": { + "spectra": 2361, + "present": 0.8602, + "median_ppm": 1.126, + "sigma_ppm": 4.211, + "beyond_3_sigma": 0.0551, + "ml_median_ppm": 1.119, + "ml_sigma_ppm": 4.103, + "ml_background": 0.0798, + "ml_mean_log_density": 4.5016 + }, + "Na|other": { + "spectra": 825, + "present": 0.9309, + "median_ppm": 3.305, + "sigma_ppm": 3.261, + "beyond_3_sigma": 0.026, + "ml_median_ppm": 3.003, + "ml_sigma_ppm": 2.969, + "ml_background": 0.0319, + "ml_mean_log_density": 4.9698 + } + } + }, + "method": "native-glacier-all-conditions-forward-simulation+formula-transformer-inverse-fusion+train-library-neighbour-fusion+measured-intact-ion-term+cross-pool-consensus", + "inference_runtime": "/opt/glacier/bin/python" + } +} diff --git a/shared/package-files/c3/c354e6d1af9b02f6efb16e80f93ebf226efdca836feff9c10fb949f63950970d/metrics.jsonl b/shared/package-files/c3/c354e6d1af9b02f6efb16e80f93ebf226efdca836feff9c10fb949f63950970d/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..fa912a230f12bba9747ca95679015eff17ef1abc --- /dev/null +++ b/shared/package-files/c3/c354e6d1af9b02f6efb16e80f93ebf226efdca836feff9c10fb949f63950970d/metrics.jsonl @@ -0,0 +1,250 @@ +{"step": 200, "loss": 0.3296841981448233, "loss_real": 0.3283234861306846, "loss_synth": 0.32958698842674494, "lr": 5.999770185426209e-05, "elapsed": 17.821938283042982, "steps_per_second": 49.95359166450965, "loss_extra": 0.33001737857237456} +{"step": 400, "loss": 0.04820211736485362, "loss_real": 0.04411209950223565, "loss_synth": 0.04865902891382575, "lr": 0.0001199815230572914, "elapsed": 21.41147336899303, "steps_per_second": 52.67835958328809, "loss_extra": 0.04845769422128796} +{"step": 600, "loss": 0.044849283378571275, "loss_real": 0.039060070421546696, "loss_synth": 0.045478350315243006, "lr": 0.00017993754018322624, "elapsed": 25.13737112999661, "steps_per_second": 53.00751944864167, "loss_extra": 0.04522863423451781} +{"step": 800, "loss": 0.04255678404122591, "loss_real": 0.03567060478962958, "loss_synth": 0.04314299587160349, "lr": 0.0002398518371215969, "elapsed": 28.74259018304292, "steps_per_second": 53.60361018315652, "loss_extra": 0.04316938297823072} +{"step": 1000, "loss": 0.04148802200332284, "loss_real": 0.034375376142561434, "loss_synth": 0.0419853031821549, "lr": 0.0002997105087403322, "elapsed": 32.321792053000536, "steps_per_second": 54.04362639475739, "loss_extra": 0.042228518687188625} +{"step": 1200, "loss": 0.040517492555081844, "loss_real": 0.03325100023299456, "loss_synth": 0.04106102576479316, "lr": 0.00035949966454633923, "elapsed": 35.89655995904468, "steps_per_second": 54.351918638690165, "loss_extra": 0.041238659396767616} +{"step": 1400, "loss": 0.039671275205910204, "loss_real": 0.032490349132567646, "loss_synth": 0.04017114019021392, "lr": 0.0004192054323428467, "elapsed": 39.57974381902022, "steps_per_second": 54.344616233519865, "loss_extra": 0.04042106032371521} +{"step": 1600, "loss": 0.03896607985720038, "loss_real": 0.03194197067990899, "loss_synth": 0.03939282782375812, "lr": 0.0004788139618827038, "elapsed": 44.59905403002631, "steps_per_second": 51.98040210487672, "loss_extra": 0.03976142931729555} +{"step": 1800, "loss": 0.038231205102056263, "loss_real": 0.03119567875750363, "loss_synth": 0.038562366012483834, "lr": 0.000538311428516825, "elapsed": 49.0864972579875, "steps_per_second": 51.03737034209884, "loss_extra": 0.039123719371855256} +{"step": 2000, "loss": 0.03767479525879026, "loss_real": 0.030561150601133704, "loss_synth": 0.03808246655389667, "lr": 0.0005976840368369773, "elapsed": 53.76394572999561, "steps_per_second": 50.06793814905822, "loss_extra": 0.0385046948492527} +{"step": 2200, "loss": 0.03688284119591117, "loss_real": 0.03026430987752974, "loss_synth": 0.037229835614562036, "lr": 0.0005971982039200904, "elapsed": 58.49429473502096, "steps_per_second": 49.24336177683059, "loss_extra": 0.037687144987285134} +{"step": 2400, "loss": 0.036197452358901504, "loss_real": 0.029634784096851944, "loss_synth": 0.03649920998141169, "lr": 0.000596666387431128, "elapsed": 63.30350639403332, "steps_per_second": 48.49926641042511, "loss_extra": 0.03703709671273828} +{"step": 2600, "loss": 0.03569955386221409, "loss_real": 0.029162902953103184, "loss_synth": 0.03593089265748858, "lr": 0.0005960886713500785, "elapsed": 68.0825446100207, "steps_per_second": 47.91361769385866, "loss_extra": 0.0366047989204526} +{"step": 2800, "loss": 0.03503452207893133, "loss_real": 0.028849366633221508, "loss_synth": 0.03522937322035432, "lr": 0.0005954651469050082, "elapsed": 72.88042460702127, "steps_per_second": 47.40764650086616, "loss_extra": 0.035915035028010606} +{"step": 3000, "loss": 0.034488436821848156, "loss_real": 0.0284005038253963, "loss_synth": 0.03471696114167571, "lr": 0.0005947959125576553, "elapsed": 77.67469958699076, "steps_per_second": 46.98035541212051, "loss_extra": 0.03531852895393968} +{"step": 3200, "loss": 0.034160570800304414, "loss_real": 0.027938035670667886, "loss_synth": 0.03433130197227001, "lr": 0.000594081073987881, "elapsed": 82.51372444501612, "steps_per_second": 46.58238021121607, "loss_extra": 0.035071595627814534} +{"step": 3400, "loss": 0.03372676648199558, "loss_real": 0.02762156301178038, "loss_synth": 0.03384289076551795, "lr": 0.0005933207440769824, "elapsed": 87.39141548599582, "steps_per_second": 46.212483938475955, "loss_extra": 0.034671782944351436} +{"step": 3600, "loss": 0.03334754206240177, "loss_real": 0.02732286467216909, "loss_synth": 0.03345141032710672, "lr": 0.0005925150428898661, "elapsed": 92.23992400703719, "steps_per_second": 45.905660423000064, "loss_extra": 0.03429077289998531} +{"step": 3800, "loss": 0.03300933685153723, "loss_real": 0.027130096396431328, "loss_synth": 0.033185151554644104, "lr": 0.0005916640976560898, "elapsed": 97.3256147489883, "steps_per_second": 45.50495348458096, "loss_extra": 0.033855659645050766} +{"step": 4000, "loss": 0.03263522241264582, "loss_real": 0.026556388502940537, "loss_synth": 0.03279279342852533, "lr": 0.0005907680427497705, "elapsed": 102.33203124202555, "steps_per_second": 45.19068872540294, "loss_extra": 0.03353438686579466} +{"step": 4200, "loss": 0.03228771850466728, "loss_real": 0.026720991218462588, "loss_synth": 0.032203396717086434, "lr": 0.000589827019668365, "elapsed": 107.25185047200648, "steps_per_second": 44.95169554387052, "loss_extra": 0.03333878306671977} +{"step": 4400, "loss": 0.03197287947870791, "loss_real": 0.026367901442572474, "loss_synth": 0.03200950906611979, "lr": 0.0005888411770103267, "elapsed": 112.14326362602878, "steps_per_second": 44.74953604902439, "loss_extra": 0.03291014972142875} +{"step": 4600, "loss": 0.03176202175207436, "loss_real": 0.02634745415300131, "loss_synth": 0.03176816720515489, "lr": 0.0005878106704516395, "elapsed": 117.04616709804395, "steps_per_second": 44.56157694974657, "loss_extra": 0.03269656755030155} +{"step": 4800, "loss": 0.03149443529546261, "loss_real": 0.026325613437220455, "loss_synth": 0.03143340985290706, "lr": 0.0005867356627212351, "elapsed": 121.95599983504508, "steps_per_second": 44.38781810672823, "loss_extra": 0.03245317448861897} +{"step": 5000, "loss": 0.03127443202771246, "loss_real": 0.026055616345256567, "loss_synth": 0.03125154384411871, "lr": 0.000585616323575296, "elapsed": 126.85299258102896, "steps_per_second": 44.23417675638003, "loss_extra": 0.032203880846500395} +{"step": 5200, "loss": 0.031031091455370186, "loss_real": 0.02572996030561626, "loss_synth": 0.03097895479761064, "lr": 0.000584452829770449, "elapsed": 132.84117653104477, "steps_per_second": 43.689051647414836, "loss_extra": 0.03200396506115794} +{"step": 5400, "loss": 0.030751980068162085, "loss_real": 0.02543566926382482, "loss_synth": 0.030715500097721816, "lr": 0.0005832453650358537, "elapsed": 137.7097227339982, "steps_per_second": 43.58652487157461, "loss_extra": 0.031711900206282735} +{"step": 5600, "loss": 0.030542196817696095, "loss_real": 0.025556763177737595, "loss_synth": 0.030406458787620067, "lr": 0.0005819941200441891, "elapsed": 142.67251516500255, "steps_per_second": 43.45994133545049, "loss_extra": 0.031543471999466416} +{"step": 5800, "loss": 0.030379075743258, "loss_real": 0.02529695563018322, "loss_synth": 0.030260997731238602, "lr": 0.0005806992923815441, "elapsed": 147.5954261100269, "steps_per_second": 43.35566776166499, "loss_extra": 0.031379563510417936} +{"step": 6000, "loss": 0.030151853868737817, "loss_real": 0.024769478561356664, "loss_synth": 0.03007898783311248, "lr": 0.0005793610865162167, "elapsed": 152.4411859860411, "steps_per_second": 43.28287212320592, "loss_extra": 0.03115948391146958} +{"step": 6200, "loss": 0.02996382148005068, "loss_real": 0.02501588742248714, "loss_synth": 0.0298832996096462, "lr": 0.0005779797137664262, "elapsed": 157.25559330999386, "steps_per_second": 43.22443974760509, "loss_extra": 0.030903599904850126} +{"step": 6400, "loss": 0.02985514260828495, "loss_real": 0.024792252043262124, "loss_synth": 0.02975694985128939, "lr": 0.0005765553922669433, "elapsed": 162.08205252100015, "steps_per_second": 43.16629340970042, "loss_extra": 0.03083248794078827} +{"step": 6600, "loss": 0.029576745796948672, "loss_real": 0.024301048070192337, "loss_synth": 0.02952103340998292, "lr": 0.0005750883469346437, "elapsed": 166.90226546302438, "steps_per_second": 43.11357221575496, "loss_extra": 0.030548762222751977} +{"step": 6800, "loss": 0.02949042333289981, "loss_real": 0.024876347705721856, "loss_synth": 0.029314525788649917, "lr": 0.000573578809432992, "elapsed": 171.76953992102062, "steps_per_second": 43.051239516203346, "loss_extra": 0.030467172162607314} +{"step": 7000, "loss": 0.029357786253094674, "loss_real": 0.024269193168729542, "loss_synth": 0.029255512421950697, "lr": 0.000572027018135459, "elapsed": 176.63342354400083, "steps_per_second": 42.99352858270288, "loss_extra": 0.03034366115927696} +{"step": 7200, "loss": 0.029235326908528803, "loss_real": 0.024561084443703293, "loss_synth": 0.029041896061971783, "lr": 0.0005704332180878793, "elapsed": 181.48778237903025, "steps_per_second": 42.94160492325799, "loss_extra": 0.030239987634122372} +{"step": 7400, "loss": 0.02906406296417117, "loss_real": 0.024323956621810795, "loss_synth": 0.028922992683947088, "lr": 0.0005687976609697565, "elapsed": 186.3565715480363, "steps_per_second": 42.88901591061518, "loss_extra": 0.030028027230873704} +{"step": 7600, "loss": 0.02887116708792746, "loss_real": 0.02381710265763104, "loss_synth": 0.02874090070836246, "lr": 0.0005671206050545193, "elapsed": 191.22527255304158, "steps_per_second": 42.83933470055678, "loss_extra": 0.02987891680561006} +{"step": 7800, "loss": 0.028798578223213554, "loss_real": 0.024016135400161148, "loss_synth": 0.02860432050190866, "lr": 0.000565402315168738, "elapsed": 196.08424026501598, "steps_per_second": 42.79459271466942, "loss_extra": 0.02982285958714783} +{"step": 8000, "loss": 0.028646398168057204, "loss_real": 0.02374026176519692, "loss_synth": 0.02851083599962294, "lr": 0.0005636430626503045, "elapsed": 200.95083530200645, "steps_per_second": 42.750431731720624, "loss_extra": 0.02963372244499624} +{"step": 8200, "loss": 0.028492606803774835, "loss_real": 0.023505950169637798, "loss_synth": 0.028379441229626535, "lr": 0.0005618431253055855, "elapsed": 205.83981316600693, "steps_per_second": 42.703531257633884, "loss_extra": 0.029471617620438338} +{"step": 8400, "loss": 0.02827891368418932, "loss_real": 0.02334441856481135, "loss_synth": 0.02812815649434924, "lr": 0.000560002787365553, "elapsed": 210.66337312804535, "steps_per_second": 42.67313659867091, "loss_extra": 0.029286295184865595} +{"step": 8600, "loss": 0.02819546315819025, "loss_real": 0.023528048871085047, "loss_synth": 0.027955554146319627, "lr": 0.0005581223394409018, "elapsed": 215.47478728502756, "steps_per_second": 42.64676431775052, "loss_extra": 0.029245219165459274} +{"step": 8800, "loss": 0.028101695878431202, "loss_real": 0.023622701102867724, "loss_synth": 0.027933052955195308, "lr": 0.0005562020784761579, "elapsed": 220.30196875100955, "steps_per_second": 42.618366631602086, "loss_extra": 0.02904775394126773} +{"step": 9000, "loss": 0.028023399328812957, "loss_real": 0.023239120999351146, "loss_synth": 0.027870283098891377, "lr": 0.0005542423077027882, "elapsed": 225.19756745401537, "steps_per_second": 42.577480764258716, "loss_extra": 0.02900703296996653} +{"step": 9200, "loss": 0.02792849563062191, "loss_real": 0.023059781193733215, "loss_synth": 0.027768744518980384, "lr": 0.0005522433365913161, "elapsed": 230.13562755001476, "steps_per_second": 42.53009574295861, "loss_extra": 0.028933404898270964} +{"step": 9400, "loss": 0.02776369085535407, "loss_real": 0.023019824847579, "loss_synth": 0.027598478365689516, "lr": 0.0005502054808024529, "elapsed": 235.29684129101224, "steps_per_second": 42.442020022208894, "loss_extra": 0.02875234848819673} +{"step": 9600, "loss": 0.027644879734143615, "loss_real": 0.022964030150324107, "loss_synth": 0.027469877963885666, "lr": 0.0005481290621372514, "elapsed": 240.29742540302686, "steps_per_second": 42.38799796241694, "loss_extra": 0.028632337702438237} +{"step": 9800, "loss": 0.027575274975970388, "loss_real": 0.022979994686320424, "loss_synth": 0.027344843903556466, "lr": 0.000546014408486289, "elapsed": 245.38836183102103, "steps_per_second": 42.31979144051125, "loss_extra": 0.028603061093017457} +{"step": 10000, "loss": 0.027414948735386132, "loss_real": 0.02260708241723478, "loss_synth": 0.027224432500079273, "lr": 0.0005438618537778916, "elapsed": 250.3917359810439, "steps_per_second": 42.270158810521586, "loss_extra": 0.02843992168083787} +{"step": 10200, "loss": 0.02731050247326493, "loss_real": 0.022572539523243906, "loss_synth": 0.027087702080607415, "lr": 0.0005416717379254006, "elapsed": 276.62057792802807, "steps_per_second": 38.81243750447591, "loss_extra": 0.028355478560552} +{"step": 10400, "loss": 0.027264960939064622, "loss_real": 0.022699337704107165, "loss_synth": 0.027037685075774788, "lr": 0.0005394444067734975, "elapsed": 281.5132022550097, "steps_per_second": 38.85018691891971, "loss_extra": 0.028284453079104422} +{"step": 10600, "loss": 0.02714958448894322, "loss_real": 0.02229912922717631, "loss_synth": 0.02699857686646283, "lr": 0.0005371802120435915, "elapsed": 286.51659227901837, "steps_per_second": 38.87078607198194, "loss_extra": 0.028142615193501114} +{"step": 10800, "loss": 0.02708550405688584, "loss_real": 0.022666379632428287, "loss_synth": 0.026834079716354608, "lr": 0.0005348795112782779, "elapsed": 291.41221276303986, "steps_per_second": 38.905741384619674, "loss_extra": 0.02810359145514667} +{"step": 11000, "loss": 0.02695797693915665, "loss_real": 0.022356176935136318, "loss_synth": 0.02674727718345821, "lr": 0.0005325426677848778, "elapsed": 296.3416704260162, "steps_per_second": 38.93482142350778, "loss_extra": 0.02796724813990295} +{"step": 11200, "loss": 0.02688112707808614, "loss_real": 0.0219434523768723, "loss_synth": 0.0267284875549376, "lr": 0.0005301700505780687, "elapsed": 301.2398358400096, "steps_per_second": 38.96714597859199, "loss_extra": 0.02789093544706702} +{"step": 11400, "loss": 0.02679969755001366, "loss_real": 0.022114303978160024, "loss_synth": 0.026573075130581856, "lr": 0.0005277620343216117, "elapsed": 306.1136460690177, "steps_per_second": 39.0016369559175, "loss_extra": 0.027839346751570702} +{"step": 11600, "loss": 0.026658035824075343, "loss_real": 0.022266656747087835, "loss_synth": 0.026397423511371018, "lr": 0.0005253189992691882, "elapsed": 310.99198245903244, "steps_per_second": 39.03440196367318, "loss_extra": 0.02768045204691589} +{"step": 11800, "loss": 0.026631226222962143, "loss_real": 0.022269872864708305, "loss_synth": 0.026352406768128275, "lr": 0.0005228413312043536, "elapsed": 315.8919072049903, "steps_per_second": 39.06331663384038, "loss_extra": 0.027666556015610695} +{"step": 12000, "loss": 0.02656790902838111, "loss_real": 0.021708873538300394, "loss_synth": 0.026324052372947337, "lr": 0.0005203294213796174, "elapsed": 320.77032553602476, "steps_per_second": 39.09404718099853, "loss_extra": 0.027654885929077864} +{"step": 12200, "loss": 0.02637413206510246, "loss_real": 0.021840232135728003, "loss_synth": 0.026095937471836805, "lr": 0.0005177836664546598, "elapsed": 325.69854794599814, "steps_per_second": 39.117568511317295, "loss_extra": 0.027438816102221607} +{"step": 12400, "loss": 0.026399360783398152, "loss_real": 0.02198044177144766, "loss_synth": 0.026081461757421494, "lr": 0.000515204468433695, "elapsed": 330.63252835400635, "steps_per_second": 39.13964665600073, "loss_extra": 0.027483605574816466} +{"step": 12600, "loss": 0.026268368009477853, "loss_real": 0.021293297111988067, "loss_synth": 0.026074805688112976, "lr": 0.0005125922346019892, "elapsed": 335.5357444669935, "steps_per_second": 39.16479252912664, "loss_extra": 0.027325422521680593} +{"step": 12800, "loss": 0.026145587963983415, "loss_real": 0.021705326372757554, "loss_synth": 0.02581983305513859, "lr": 0.0005099473774615467, "elapsed": 340.4594630910433, "steps_per_second": 39.186723534985276, "loss_extra": 0.02724136316217482} +{"step": 13000, "loss": 0.026118856398388745, "loss_real": 0.021495753144845368, "loss_synth": 0.025883013661950827, "lr": 0.00050727031466597, "elapsed": 345.3967914620298, "steps_per_second": 39.20639391481385, "loss_extra": 0.02715686502866447} +{"step": 13200, "loss": 0.026005160650238394, "loss_real": 0.021304638176225126, "loss_synth": 0.025797343775629998, "lr": 0.000504561468954508, "elapsed": 350.31485348404385, "steps_per_second": 39.22773299313538, "loss_extra": 0.027028712071478368} +{"step": 13400, "loss": 0.025863261949270962, "loss_real": 0.02135696436278522, "loss_synth": 0.025568643026053904, "lr": 0.0005018212680853004, "elapsed": 355.2116845540004, "steps_per_second": 39.25089800113093, "loss_extra": 0.026939505534246563} +{"step": 13600, "loss": 0.02591691260226071, "loss_real": 0.021372639397159218, "loss_synth": 0.02565083434805274, "lr": 0.0004990501447678302, "elapsed": 360.0598634390044, "steps_per_second": 39.27892657903089, "loss_extra": 0.026971333520486952} +{"step": 13800, "loss": 0.025898428754881023, "loss_real": 0.02133632226847112, "loss_synth": 0.025619519148021935, "lr": 0.0004962485365945929, "elapsed": 364.9173504600185, "steps_per_second": 39.30513890615955, "loss_extra": 0.02696872491389513} +{"step": 14000, "loss": 0.025709842685610055, "loss_real": 0.02090311299543828, "loss_synth": 0.025478107258677482, "lr": 0.0004934168859719962, "elapsed": 369.8310944940313, "steps_per_second": 39.3244208268648, "loss_extra": 0.02677566271275282} +{"step": 14200, "loss": 0.025645819334313272, "loss_real": 0.021210314184427263, "loss_synth": 0.025335837360471486, "lr": 0.0004905556400504991, "elapsed": 374.73116237699287, "steps_per_second": 39.34466854307202, "loss_extra": 0.026725062010809778} +{"step": 14400, "loss": 0.025564473727717994, "loss_real": 0.02112103014718741, "loss_synth": 0.02523415976203978, "lr": 0.0004876652506540011, "elapsed": 379.62858745403355, "steps_per_second": 39.364658223598035, "loss_extra": 0.026665341341868043} +{"step": 14600, "loss": 0.025571633828803897, "loss_real": 0.021232199398800732, "loss_synth": 0.025248949993401767, "lr": 0.00048474617420849446, "elapsed": 384.55105447099777, "steps_per_second": 39.38145947231297, "loss_extra": 0.026646834313869477} +{"step": 14800, "loss": 0.02550236485898495, "loss_real": 0.020925901415757835, "loss_synth": 0.025203150790184738, "lr": 0.000481798871669989, "elapsed": 389.46121463301824, "steps_per_second": 39.399111147472716, "loss_extra": 0.026595373526215552} +{"step": 15000, "loss": 0.02538937975652516, "loss_real": 0.020852292338386178, "loss_synth": 0.025144673930481077, "lr": 0.00047882380845172155, "elapsed": 394.3654686289956, "steps_per_second": 39.416919029855904, "loss_extra": 0.026421270314604044} +{"step": 15200, "loss": 0.025365874571725726, "loss_real": 0.02072315763682127, "loss_synth": 0.025087796058505772, "lr": 0.0004758214543506626, "elapsed": 400.2344987629913, "steps_per_second": 39.3358171823602, "loss_extra": 0.026449347380548716} +{"step": 15400, "loss": 0.025251223389059305, "loss_real": 0.020722782257944345, "loss_synth": 0.024999628691002727, "lr": 0.0004727922834733288, "elapsed": 405.1224293500418, "steps_per_second": 39.3555697370893, "loss_extra": 0.02628847154788673} +{"step": 15600, "loss": 0.025210812920704484, "loss_real": 0.020527659729123116, "loss_synth": 0.02495585024356842, "lr": 0.0004697367741609171, "elapsed": 410.0330943260342, "steps_per_second": 39.37257560533935, "loss_extra": 0.026278292974457145} +{"step": 15800, "loss": 0.025174402352422475, "loss_real": 0.02082191014662385, "loss_synth": 0.02484675998799503, "lr": 0.0004666554089137685, "elapsed": 414.9307295040344, "steps_per_second": 39.39044461078934, "loss_extra": 0.026256808834150432} +{"step": 16000, "loss": 0.025060793962329627, "loss_real": 0.020400568037293853, "loss_synth": 0.024762060167267917, "lr": 0.00046354867431517584, "elapsed": 419.8150821219897, "steps_per_second": 39.409171796185674, "loss_extra": 0.026167876599356533} +{"step": 16200, "loss": 0.025076688630506397, "loss_real": 0.020559207471087575, "loss_synth": 0.024772547539323567, "lr": 0.0004604170609545466, "elapsed": 424.66833051503636, "steps_per_second": 39.430438695106744, "loss_extra": 0.026164357075467704} +{"step": 16400, "loss": 0.024956873720511794, "loss_real": 0.02026052966713905, "loss_synth": 0.024691033493727445, "lr": 0.00045726106334993325, "elapsed": 429.511877248995, "steps_per_second": 39.452129740471044, "loss_extra": 0.02603747713379562} +{"step": 16600, "loss": 0.02496406896971166, "loss_real": 0.02057338474318385, "loss_synth": 0.024627729495987297, "lr": 0.0004540811798699431, "elapsed": 434.3908626449993, "steps_per_second": 39.46999499073289, "loss_extra": 0.02606177072972059} +{"step": 16800, "loss": 0.0247939030546695, "loss_real": 0.020267930636182426, "loss_synth": 0.024510626764968037, "lr": 0.00045087791265504006, "elapsed": 439.27375815901905, "steps_per_second": 39.48708758673469, "loss_extra": 0.02586226997897029} +{"step": 17000, "loss": 0.0248363190703094, "loss_real": 0.02021010155789554, "loss_synth": 0.024610950043424965, "lr": 0.0004476517675382507, "elapsed": 444.1372678630287, "steps_per_second": 39.50557191946189, "loss_extra": 0.025864439634606242} +{"step": 17200, "loss": 0.024816867550835012, "loss_real": 0.020382231427356602, "loss_synth": 0.02454111068509519, "lr": 0.00044440325396528766, "elapsed": 448.97365312703187, "steps_per_second": 39.52610671500561, "loss_extra": 0.025861878963187337} +{"step": 17400, "loss": 0.02478275421075523, "loss_real": 0.0199643609020859, "loss_synth": 0.024565471913665534, "lr": 0.00044113288491410207, "elapsed": 453.8431223620428, "steps_per_second": 39.54321675994568, "loss_extra": 0.02583620901219547} +{"step": 17600, "loss": 0.024652226334437727, "loss_real": 0.02028039863333106, "loss_synth": 0.02437010418623686, "lr": 0.00043784117681387844, "elapsed": 458.6679981779889, "steps_per_second": 39.56391787307652, "loss_extra": 0.02569266453385353} +{"step": 17800, "loss": 0.024610314629971982, "loss_real": 0.020066986796446144, "loss_synth": 0.024271651785820723, "lr": 0.00043452864946348456, "elapsed": 463.48923641303554, "steps_per_second": 39.5844949839223, "loss_extra": 0.02573684855364263} +{"step": 18000, "loss": 0.02456787448376417, "loss_real": 0.020044457875192167, "loss_synth": 0.024231715705245734, "lr": 0.00043119582594938896, "elapsed": 468.356063410989, "steps_per_second": 39.600663282975255, "loss_extra": 0.025688455952331424} +{"step": 18200, "loss": 0.02447480001486838, "loss_real": 0.019842149061150848, "loss_synth": 0.024133206559345127, "lr": 0.0004278432325630599, "elapsed": 473.2547563299886, "steps_per_second": 39.613741310906406, "loss_extra": 0.025619770186021924} +{"step": 18400, "loss": 0.024448761874809863, "loss_real": 0.019800669527612627, "loss_synth": 0.024122452717274426, "lr": 0.00042447139871785766, "elapsed": 478.1672457639943, "steps_per_second": 39.625365998708475, "loss_extra": 0.02558119537308812} +{"step": 18600, "loss": 0.024341672230511903, "loss_real": 0.019836736456491054, "loss_synth": 0.02397060764953494, "lr": 0.0004210808568654337, "elapsed": 483.035407887015, "steps_per_second": 39.640491807900176, "loss_extra": 0.025493800882250072} +{"step": 18800, "loss": 0.024357569143176078, "loss_real": 0.019816278140060605, "loss_synth": 0.023969295350834727, "lr": 0.00041767214241165117, "elapsed": 487.9067189930356, "steps_per_second": 39.65504356294978, "loss_extra": 0.02553314999677241} +{"step": 19000, "loss": 0.02431030963547528, "loss_real": 0.019617955810390414, "loss_synth": 0.024013748858124018, "lr": 0.00041424579363203725, "elapsed": 492.96074343804503, "steps_per_second": 39.654172128594354, "loss_extra": 0.0254208099655807} +{"step": 19200, "loss": 0.02428798107430339, "loss_real": 0.01968535053078085, "loss_synth": 0.02397755007259548, "lr": 0.00041080235158678376, "elapsed": 497.8261831430136, "steps_per_second": 39.66876901691829, "loss_extra": 0.02539670554921031} +{"step": 19400, "loss": 0.024219982428476214, "loss_real": 0.019511441080830992, "loss_synth": 0.023939057625830172, "lr": 0.00040734236003530744, "elapsed": 502.7348520940286, "steps_per_second": 39.6795666410929, "loss_extra": 0.02531772536225617} +{"step": 19600, "loss": 0.02416508961468935, "loss_real": 0.019641925957985223, "loss_synth": 0.023848831290379166, "lr": 0.0004038663653503835, "elapsed": 507.6898573990329, "steps_per_second": 39.68642581363935, "loss_extra": 0.025265810806304217} +{"step": 19800, "loss": 0.02415646882727742, "loss_real": 0.019420301294885575, "loss_synth": 0.02385015390813351, "lr": 0.000400374916431868, "elapsed": 512.6635114660021, "steps_per_second": 39.69166477383688, "loss_extra": 0.025284293694421648} +{"step": 20000, "loss": 0.023996965065598487, "loss_real": 0.019634371870197356, "loss_synth": 0.023601052211597563, "lr": 0.00039686856462001896, "elapsed": 517.7094980319962, "steps_per_second": 39.6911019699866, "loss_extra": 0.025149107929319143} +{"step": 20200, "loss": 0.024088928988203407, "loss_real": 0.01966150519903749, "loss_synth": 0.02375381039455533, "lr": 0.00039334786360843476, "elapsed": 543.8578589180252, "steps_per_second": 38.110357437481504, "loss_extra": 0.025191797856241465} +{"step": 20400, "loss": 0.02398674131371081, "loss_real": 0.019522889386862516, "loss_synth": 0.023657631147652864, "lr": 0.00038981336935661813, "elapsed": 548.7286541209905, "steps_per_second": 38.13722596191376, "loss_extra": 0.025089955925941466} +{"step": 20600, "loss": 0.023941644802689552, "loss_real": 0.01921690283343196, "loss_synth": 0.023631827579811214, "lr": 0.00038626564000218466, "elapsed": 553.5840245800209, "steps_per_second": 38.16470017599744, "loss_extra": 0.02507097245194018} +{"step": 20800, "loss": 0.02381865511648357, "loss_real": 0.019141058521345258, "loss_synth": 0.02350673111155629, "lr": 0.00038270523577272616, "elapsed": 558.4596599340439, "steps_per_second": 38.190263481852284, "loss_extra": 0.02494188990443945} +{"step": 21000, "loss": 0.02395355620421469, "loss_real": 0.01914727277588099, "loss_synth": 0.02362955555319786, "lr": 0.0003791327188973438, "elapsed": 563.3452434689971, "steps_per_second": 38.214681352983845, "loss_extra": 0.02511117280460894} +{"step": 21200, "loss": 0.023776261368766427, "loss_real": 0.01898110993206501, "loss_synth": 0.023446564087644218, "lr": 0.00037554865351786614, "elapsed": 568.2694970250013, "steps_per_second": 38.236001896552565, "loss_extra": 0.024937616745010018} +{"step": 21400, "loss": 0.023713363371789455, "loss_real": 0.019144701110199093, "loss_synth": 0.02342342834919691, "lr": 0.00037195360559976446, "elapsed": 573.2217063549906, "steps_per_second": 38.25503526175266, "loss_extra": 0.02479577736929059} +{"step": 21600, "loss": 0.023742395034059883, "loss_real": 0.019033888559788464, "loss_synth": 0.023479790315032004, "lr": 0.0003683481428427801, "elapsed": 578.4933834859985, "steps_per_second": 38.25208093419662, "loss_extra": 0.024821889279410245} +{"step": 21800, "loss": 0.02370697570964694, "loss_real": 0.019007894904352726, "loss_synth": 0.02342124299146235, "lr": 0.0003647328345912784, "elapsed": 583.589394855022, "steps_per_second": 38.26097396168489, "loss_extra": 0.024807862807065248} +{"step": 22000, "loss": 0.023613888146355747, "loss_real": 0.01865222444292158, "loss_synth": 0.023386287642642854, "lr": 0.0003611082517443419, "elapsed": 588.8052244680002, "steps_per_second": 38.26173445561908, "loss_extra": 0.024702507434412838} +{"step": 22200, "loss": 0.023671072348952292, "loss_real": 0.019014503993093967, "loss_synth": 0.023380004400387407, "lr": 0.00035747496666562, "elapsed": 593.815343025024, "steps_per_second": 38.27605207689647, "loss_extra": 0.02476988625712693} +{"step": 22400, "loss": 0.023545164223760365, "loss_real": 0.018478883993811906, "loss_synth": 0.023263251008465886, "lr": 0.00035383355309294483, "elapsed": 598.8185808500275, "steps_per_second": 38.29057483091147, "loss_extra": 0.02470604089088738} +{"step": 22600, "loss": 0.02354245680384338, "loss_real": 0.018791869156993924, "loss_synth": 0.02320037130266428, "lr": 0.00035018458604773206, "elapsed": 603.7775081419968, "steps_per_second": 38.30772826209773, "loss_extra": 0.02470840610563755} +{"step": 22800, "loss": 0.02344562905840576, "loss_real": 0.01862836736254394, "loss_synth": 0.02307997896336019, "lr": 0.0003465286417441785, "elapsed": 608.7099138020421, "steps_per_second": 38.32630432005583, "loss_extra": 0.024646626161411403} +{"step": 23000, "loss": 0.02345593897625804, "loss_real": 0.018987082284875213, "loss_synth": 0.023165563913062216, "lr": 0.0003428662974982705, "elapsed": 613.596468675998, "steps_per_second": 38.347506175867835, "loss_extra": 0.02452145173214376} +{"step": 23200, "loss": 0.023408533167093994, "loss_real": 0.01877062258310616, "loss_synth": 0.023057366125285625, "lr": 0.00033919813163662, "elapsed": 618.5610415700357, "steps_per_second": 38.36341543061153, "loss_extra": 0.024563950141891836} +{"step": 23400, "loss": 0.023364280397072435, "loss_real": 0.018941193004138768, "loss_synth": 0.023036954691633582, "lr": 0.000335524723405139, "elapsed": 623.4181122420123, "steps_per_second": 38.38583371176989, "loss_extra": 0.024458636259660126} +{"step": 23600, "loss": 0.023283944595605136, "loss_real": 0.018392439824528994, "loss_synth": 0.022948893047869207, "lr": 0.00033184665287757097, "elapsed": 628.3087050620234, "steps_per_second": 38.40580231895014, "loss_extra": 0.024467371143400668} +{"step": 23800, "loss": 0.023293717540800573, "loss_real": 0.018723979289643467, "loss_synth": 0.022984864804893732, "lr": 0.0003281645008638895, "elapsed": 633.2051611840143, "steps_per_second": 38.42509183222966, "loss_extra": 0.024395156111568214} +{"step": 24000, "loss": 0.023194995699450372, "loss_real": 0.018597925435751676, "loss_synth": 0.022770474879071117, "lr": 0.0003244788488185826, "elapsed": 638.0916976950248, "steps_per_second": 38.444689635485496, "loss_extra": 0.024416360342875122} +{"step": 24200, "loss": 0.02317406713962555, "loss_real": 0.018575214240700008, "loss_synth": 0.022860097354277967, "lr": 0.00032079027874883385, "elapsed": 642.96537291602, "steps_per_second": 38.46476929534442, "loss_extra": 0.02428565902635455} +{"step": 24400, "loss": 0.023152354219928385, "loss_real": 0.018467055964283646, "loss_synth": 0.02276329674758017, "lr": 0.00031709937312261613, "elapsed": 647.8362847809913, "steps_per_second": 38.48470800765022, "loss_extra": 0.024353733519092202} +{"step": 24600, "loss": 0.023080818867310882, "loss_real": 0.01846792864147574, "loss_synth": 0.02271255474537611, "lr": 0.0003134067147767145, "elapsed": 652.7232129700133, "steps_per_second": 38.503377437852556, "loss_extra": 0.024248913554474713} +{"step": 24800, "loss": 0.023095881612971426, "loss_real": 0.01830089684110135, "loss_synth": 0.022789279455319045, "lr": 0.0003097128868246881, "elapsed": 657.6058880410274, "steps_per_second": 38.52201792195745, "loss_extra": 0.024234211156144738} +{"step": 25000, "loss": 0.023015716671943666, "loss_real": 0.018386699757538736, "loss_synth": 0.022715636137872933, "lr": 0.0003060184725647909, "elapsed": 662.4918570820009, "steps_per_second": 38.54018208908224, "loss_extra": 0.02411871876567602} +{"step": 25200, "loss": 0.02296787951141596, "loss_real": 0.018272567130625247, "loss_synth": 0.022704239152371884, "lr": 0.0003023240553878617, "elapsed": 668.4431992560276, "steps_per_second": 38.49532309343763, "loss_extra": 0.024046113044023515} +{"step": 25400, "loss": 0.022983067287132144, "loss_real": 0.018412776682525875, "loss_synth": 0.022559041194617747, "lr": 0.0002986302186851996, "elapsed": 673.5229739419883, "steps_per_second": 38.50207220291248, "loss_extra": 0.024199287267401816} +{"step": 25600, "loss": 0.023012160109356045, "loss_real": 0.018412556373514233, "loss_synth": 0.022667067255824805, "lr": 0.00029493754575644036, "elapsed": 678.4523557820357, "steps_per_second": 38.51743192549912, "loss_extra": 0.024154873741790654} +{"step": 25800, "loss": 0.022936498150229453, "loss_real": 0.018276764969341455, "loss_synth": 0.022573799919337036, "lr": 0.0002912466197174462, "elapsed": 683.4224141110317, "steps_per_second": 38.53022475602087, "loss_extra": 0.024107188656926154} +{"step": 26000, "loss": 0.02284061536192894, "loss_real": 0.0183539494080469, "loss_synth": 0.022569535253569483, "lr": 0.00028755802340822527, "elapsed": 688.3307005130337, "steps_per_second": 38.54635879867679, "loss_extra": 0.02389000934548676} +{"step": 26200, "loss": 0.02281365809030831, "loss_real": 0.018276575217023493, "loss_synth": 0.022471543103456497, "lr": 0.0002838723393008943, "elapsed": 693.2400005389936, "steps_per_second": 38.562202221991285, "loss_extra": 0.02394254463724792} +{"step": 26400, "loss": 0.022814189242199065, "loss_real": 0.017970381304621696, "loss_synth": 0.02261157201603055, "lr": 0.00028019014940769974, "elapsed": 698.18931393401, "steps_per_second": 38.575562763652556, "loss_extra": 0.023857455933466554} +{"step": 26600, "loss": 0.022741737915202974, "loss_real": 0.01813018074259162, "loss_synth": 0.02243949968367815, "lr": 0.000276512035189111, "elapsed": 703.2319579670439, "steps_per_second": 38.58350741274036, "loss_extra": 0.023843854954466222} +{"step": 26800, "loss": 0.022784400871023534, "loss_real": 0.017954314248636364, "loss_synth": 0.02246304577216506, "lr": 0.00027283857746200125, "elapsed": 708.2300876289955, "steps_per_second": 38.593810597408044, "loss_extra": 0.023943518530577423} +{"step": 27000, "loss": 0.022761608622968197, "loss_real": 0.01796253832988441, "loss_synth": 0.022360267220064997, "lr": 0.0002691703563079296, "elapsed": 713.2306306890096, "steps_per_second": 38.60383326145194, "loss_extra": 0.023994985269382596} +{"step": 27200, "loss": 0.022716844007372856, "loss_real": 0.01773280631750822, "loss_synth": 0.022413390092551708, "lr": 0.0002655079509815397, "elapsed": 718.1155059449957, "steps_per_second": 38.62005524813922, "loss_extra": 0.02388488220050931} +{"step": 27400, "loss": 0.02267225433140993, "loss_real": 0.017894977270625532, "loss_synth": 0.022353647649288176, "lr": 0.00026185193981908867, "elapsed": 723.0528019409976, "steps_per_second": 38.63319807025876, "loss_extra": 0.023819460812956095} +{"step": 27600, "loss": 0.022683800524100663, "loss_real": 0.01788242262788117, "loss_synth": 0.02243603172712028, "lr": 0.0002582029001471206, "elapsed": 728.0811521800351, "steps_per_second": 38.64123259139972, "loss_extra": 0.023764656279236077} +{"step": 27800, "loss": 0.022637574225664137, "loss_real": 0.017795690968632698, "loss_synth": 0.022223758660256863, "lr": 0.00025456140819130085, "elapsed": 733.0862994519994, "steps_per_second": 38.650401552415275, "loss_extra": 0.023890810338780284} +{"step": 28000, "loss": 0.02253020429983735, "loss_real": 0.017792128957808018, "loss_synth": 0.022184414407238364, "lr": 0.0002509280389854229, "elapsed": 738.0163911349955, "steps_per_second": 38.663450425880605, "loss_extra": 0.023697668612003328} +{"step": 28200, "loss": 0.022570879943668843, "loss_real": 0.01792496773414314, "loss_synth": 0.02227279718965292, "lr": 0.00024730336628060344, "elapsed": 742.9675795930088, "steps_per_second": 38.67520381678864, "loss_extra": 0.02367482764646411} +{"step": 28400, "loss": 0.02254634039476514, "loss_real": 0.017792049264535308, "loss_synth": 0.022213841630145906, "lr": 0.00024368796245468133, "elapsed": 747.8545547529939, "steps_per_second": 38.69018294924857, "loss_extra": 0.023703386848792432} +{"step": 28600, "loss": 0.02245907255448401, "loss_real": 0.017755604381673038, "loss_synth": 0.022147598257288337, "lr": 0.00024008239842183163, "elapsed": 752.7290630800417, "steps_per_second": 38.70561700079513, "loss_extra": 0.023586354264989496} +{"step": 28800, "loss": 0.022467755926772952, "loss_real": 0.017686863243579865, "loss_synth": 0.022147584035992623, "lr": 0.00023648724354241227, "elapsed": 757.6400290009915, "steps_per_second": 38.71895089276108, "loss_extra": 0.02361714915372431} +{"step": 29000, "loss": 0.02239047134295106, "loss_real": 0.017779013575054705, "loss_synth": 0.022018628595396876, "lr": 0.00023290306553305494, "elapsed": 762.5609897840186, "steps_per_second": 38.7315928216863, "loss_extra": 0.02356188081204891} +{"step": 29200, "loss": 0.022363210488110782, "loss_real": 0.017608557608909906, "loss_synth": 0.022059778105467557, "lr": 0.00022933043037701642, "elapsed": 767.5107150039985, "steps_per_second": 38.74259101014864, "loss_extra": 0.02349137660115957} +{"step": 29400, "loss": 0.022340623615309595, "loss_real": 0.017652062382549048, "loss_synth": 0.02196469584479928, "lr": 0.00022576990223480343, "elapsed": 772.5321859359974, "steps_per_second": 38.74978109861981, "loss_extra": 0.02352949573658407} +{"step": 29600, "loss": 0.02233045795932412, "loss_real": 0.017603472610935568, "loss_synth": 0.0219340281188488, "lr": 0.00022222204335508425, "elapsed": 777.5681237190147, "steps_per_second": 38.75614248970234, "loss_extra": 0.023546420708298682} +{"step": 29800, "loss": 0.022272380432114006, "loss_real": 0.017437574472278356, "loss_synth": 0.021925405701622366, "lr": 0.00021868741398590414, "elapsed": 782.5530546630034, "steps_per_second": 38.76499247474405, "loss_extra": 0.0234578291233629} +{"step": 30000, "loss": 0.022304578209295867, "loss_real": 0.01740142506081611, "loss_synth": 0.021922505646944045, "lr": 0.00021516657228621528, "elapsed": 787.5262458100333, "steps_per_second": 38.77431679126784, "loss_extra": 0.02353685042820871} +{"step": 30200, "loss": 0.022264617057517172, "loss_real": 0.017211837437935175, "loss_synth": 0.02198853482492268, "lr": 0.00021166007423773693, "elapsed": 814.7548349520075, "steps_per_second": 37.705855283223364, "loss_extra": 0.02341734237037599} +{"step": 30400, "loss": 0.022310700071975588, "loss_real": 0.017424142519012094, "loss_synth": 0.02194071746431291, "lr": 0.0002081684735571596, "elapsed": 819.665102539002, "steps_per_second": 37.72428825558383, "loss_extra": 0.023528050007298587} +{"step": 30600, "loss": 0.022150593772530557, "loss_real": 0.01720470084808767, "loss_synth": 0.02181356123648584, "lr": 0.00020469232160870657, "elapsed": 824.5658372110338, "steps_per_second": 37.742941750384446, "loss_extra": 0.023345441529527305} +{"step": 30800, "loss": 0.022178744915872812, "loss_real": 0.01741779609117657, "loss_synth": 0.021798914400860667, "lr": 0.00020123216731706737, "elapsed": 829.4480271490174, "steps_per_second": 37.7622296588208, "loss_extra": 0.023384079141542315} +{"step": 31000, "loss": 0.02214372478425503, "loss_real": 0.01711269671563059, "loss_synth": 0.0218551707174629, "lr": 0.00019778855708071612, "elapsed": 834.3099772030255, "steps_per_second": 37.782220012825704, "loss_extra": 0.02330509009771049} +{"step": 31200, "loss": 0.022106721233576536, "loss_real": 0.017453420241363347, "loss_synth": 0.021714375745505096, "lr": 0.00019436203468562864, "elapsed": 839.2071172900032, "steps_per_second": 37.80036318332935, "loss_extra": 0.023305815840139986} +{"step": 31400, "loss": 0.0220617619715631, "loss_real": 0.017124820481985808, "loss_synth": 0.02172115375287831, "lr": 0.00019095314121941266, "elapsed": 844.1060458710417, "steps_per_second": 37.81821087531653, "loss_extra": 0.023258615331724287} +{"step": 31600, "loss": 0.022025473192334177, "loss_real": 0.01701952898874879, "loss_synth": 0.021716482797637583, "lr": 0.0001875624149858636, "elapsed": 849.0624803330284, "steps_per_second": 37.83324422225011, "loss_extra": 0.02320283021777868} +{"step": 31800, "loss": 0.02208111425861716, "loss_real": 0.01737263289745897, "loss_synth": 0.021738383127376436, "lr": 0.00018419039141996036, "elapsed": 854.0012023079908, "steps_per_second": 37.84889810753323, "loss_extra": 0.023240391202270984} +{"step": 32000, "loss": 0.02201165203936398, "loss_real": 0.0169778885692358, "loss_synth": 0.021646631108596923, "lr": 0.0001808376030033136, "elapsed": 858.9596173900063, "steps_per_second": 37.863486731826235, "loss_extra": 0.02324963517487049} +{"step": 32200, "loss": 0.021933824215084316, "loss_real": 0.01698366242926568, "loss_synth": 0.02160423352383077, "lr": 0.0001775045791800812, "elapsed": 863.8670662410441, "steps_per_second": 37.88017620119132, "loss_extra": 0.023122003367170692} +{"step": 32400, "loss": 0.021913413284346463, "loss_real": 0.01707646972965449, "loss_synth": 0.021600249474868178, "lr": 0.00017419184627336242, "elapsed": 868.7657985819969, "steps_per_second": 37.89706047638842, "loss_extra": 0.023065565787255764} +{"step": 32600, "loss": 0.021891179960221052, "loss_real": 0.017188389040529727, "loss_synth": 0.021604931587353347, "lr": 0.00017089992740208575, "elapsed": 873.6387396480422, "steps_per_second": 37.91488960492495, "loss_extra": 0.022993224933743478} +{"step": 32800, "loss": 0.021912218444049357, "loss_real": 0.017124047316610814, "loss_synth": 0.021632334822788833, "lr": 0.00016762934239840198, "elapsed": 878.5148678430123, "steps_per_second": 37.93237799337982, "loss_extra": 0.02302275851368904} +{"step": 33000, "loss": 0.021850015483796597, "loss_real": 0.016963404291309415, "loss_synth": 0.021592766270041464, "lr": 0.000164380607725597, "elapsed": 883.407244349015, "steps_per_second": 37.94896114409412, "loss_extra": 0.02295511929318309} +{"step": 33200, "loss": 0.021869608880952, "loss_real": 0.016943691675551237, "loss_synth": 0.021521645840257408, "lr": 0.00016115423639653619, "elapsed": 888.295866348024, "steps_per_second": 37.965521726037096, "loss_extra": 0.023071870636194945} +{"step": 33400, "loss": 0.021841948544606568, "loss_real": 0.016758255204185845, "loss_synth": 0.021452331142500045, "lr": 0.0001579507378926539, "elapsed": 893.1885414629942, "steps_per_second": 37.981723146497906, "loss_extra": 0.02311309851706028} +{"step": 33600, "loss": 0.021829707734286784, "loss_real": 0.017052011857740582, "loss_synth": 0.02142219861038029, "lr": 0.00015477061808349973, "elapsed": 898.0751957879984, "steps_per_second": 37.99800399066565, "loss_extra": 0.023065512906759976} +{"step": 33800, "loss": 0.021773485448211432, "loss_real": 0.01678435366600752, "loss_synth": 0.02145345013588667, "lr": 0.0001516143791468568, "elapsed": 902.9606098739896, "steps_per_second": 38.01415889790878, "loss_extra": 0.022958919825032353} +{"step": 34000, "loss": 0.021734728701412676, "loss_real": 0.016695059197954835, "loss_synth": 0.021333734840154647, "lr": 0.00014848251948944142, "elapsed": 907.8580955890357, "steps_per_second": 38.029623744119604, "loss_extra": 0.023009558422490955} +{"step": 34200, "loss": 0.021687197210267187, "loss_real": 0.016843775939196347, "loss_synth": 0.021442503528669478, "lr": 0.00014537553366819925, "elapsed": 912.7470328470226, "steps_per_second": 38.045281888567715, "loss_extra": 0.022772295167669654} +{"step": 34400, "loss": 0.021697520865127443, "loss_real": 0.016807955955155194, "loss_synth": 0.021408126298338173, "lr": 0.0001422939123122089, "elapsed": 917.6258224990452, "steps_per_second": 38.06119796538787, "loss_extra": 0.022835147064179183} +{"step": 34600, "loss": 0.021708213090896607, "loss_real": 0.016831276705488563, "loss_synth": 0.021358538316562772, "lr": 0.00013923814204520548, "elapsed": 922.515150354011, "steps_per_second": 38.07650156709547, "loss_extra": 0.022903669532388447} +{"step": 34800, "loss": 0.021670609936118124, "loss_real": 0.016657041502185166, "loss_synth": 0.021302803186699748, "lr": 0.00013620870540873793, "elapsed": 927.4100370469969, "steps_per_second": 38.091409579909055, "loss_extra": 0.022907858872786166} +{"step": 35000, "loss": 0.021700165970250963, "loss_real": 0.01683221369050443, "loss_synth": 0.021404629442840814, "lr": 0.00013320608078596944, "elapsed": 932.3056823330116, "steps_per_second": 38.106127220237184, "loss_extra": 0.022840152755379678} +{"step": 35200, "loss": 0.021580621674656866, "loss_real": 0.01642270720563829, "loss_synth": 0.021237768912687898, "lr": 0.00013023074232613552, "elapsed": 938.0978547720006, "steps_per_second": 38.0837127327212, "loss_extra": 0.022818099381402134} +{"step": 35400, "loss": 0.02169593460857868, "loss_real": 0.01683735687751323, "loss_synth": 0.021352898487821223, "lr": 0.0001272831598696703, "elapsed": 942.9728244190337, "steps_per_second": 38.09914939598094, "loss_extra": 0.022881591599434613} +{"step": 35600, "loss": 0.02161550784483552, "loss_real": 0.016856579058803618, "loss_synth": 0.021286886623129248, "lr": 0.00012436379887401295, "elapsed": 947.8392876299913, "steps_per_second": 38.11477206111745, "loss_extra": 0.02276949883438647} +{"step": 35800, "loss": 0.021545232301577927, "loss_real": 0.016517940275371075, "loss_synth": 0.021293648621067404, "lr": 0.00012147312034010696, "elapsed": 952.7033096239902, "steps_per_second": 38.1303319130256, "loss_extra": 0.02266913468949497} +{"step": 36000, "loss": 0.021508999560028316, "loss_real": 0.01655589409172535, "loss_synth": 0.021234825253486633, "lr": 0.00011861158073960271, "elapsed": 957.5737678619917, "steps_per_second": 38.14547121898405, "loss_extra": 0.022642508195713163} +{"step": 36200, "loss": 0.021528191128745676, "loss_real": 0.016758776814676822, "loss_synth": 0.02119761220179498, "lr": 0.00011577963194277514, "elapsed": 962.4779515599948, "steps_per_second": 38.15909844155823, "loss_extra": 0.022685953108593823} +{"step": 36400, "loss": 0.021506883166730405, "loss_real": 0.0164125155005604, "loss_synth": 0.0211503716558218, "lr": 0.0001129777211471684, "elapsed": 967.3611103370204, "steps_per_second": 38.17342718938377, "loss_extra": 0.022746921954676508} +{"step": 36600, "loss": 0.021482130493968726, "loss_real": 0.016611098307184876, "loss_synth": 0.021153468852862716, "lr": 0.00011020629080697766, "elapsed": 972.2512323670089, "steps_per_second": 38.187332460794984, "loss_extra": 0.02265563724562526} +{"step": 36800, "loss": 0.02142709377221763, "loss_real": 0.016695609986782073, "loss_synth": 0.021123589714989066, "lr": 0.00010746577856318116, "elapsed": 977.1294882610091, "steps_per_second": 38.20156713103212, "loss_extra": 0.022551305992528796} +{"step": 37000, "loss": 0.021409520423039795, "loss_real": 0.016422941563650966, "loss_synth": 0.021033921297639608, "lr": 0.00010475661717443124, "elapsed": 982.001978048007, "steps_per_second": 38.21588596412874, "loss_extra": 0.022649839613586666} +{"step": 37200, "loss": 0.021394425928592684, "loss_real": 0.01636964688077569, "loss_synth": 0.020978008015081286, "lr": 0.00010207923444871681, "elapsed": 986.8913551759906, "steps_per_second": 38.22939791317384, "loss_extra": 0.022682027285918595} +{"step": 37400, "loss": 0.021525957146659492, "loss_real": 0.016499647051095963, "loss_synth": 0.02114389297552407, "lr": 9.94340531758075e-05, "elapsed": 991.7788001640001, "steps_per_second": 38.242850320794325, "loss_extra": 0.02277961652725935} +{"step": 37600, "loss": 0.0214138397667557, "loss_real": 0.016339809177443387, "loss_synth": 0.021069872193038464, "lr": 9.682149106049004e-05, "elapsed": 996.66512998502, "steps_per_second": 38.25621233141333, "loss_extra": 0.022637854535132645} +{"step": 37800, "loss": 0.021390581633895636, "loss_real": 0.01654657979030162, "loss_synth": 0.021059390660375356, "lr": 9.424196065660837e-05, "elapsed": 1001.5559465039987, "steps_per_second": 38.26926831171808, "loss_extra": 0.022561910850927232} +{"step": 38000, "loss": 0.021373504009097814, "loss_real": 0.016045542722567915, "loss_synth": 0.02110371888615191, "lr": 9.169586930191606e-05, "elapsed": 1006.452444761002, "steps_per_second": 38.28197652432331, "loss_extra": 0.02256776548922062} +{"step": 38200, "loss": 0.021385198812931775, "loss_real": 0.016280735870823265, "loss_synth": 0.021040118960663677, "lr": 8.91836190537533e-05, "elapsed": 1011.3743965700269, "steps_per_second": 38.29358284945657, "loss_extra": 0.02261560846120119} +{"step": 38400, "loss": 0.021393381394445896, "loss_real": 0.016296261325478553, "loss_synth": 0.02106813611462712, "lr": 8.670560662555727e-05, "elapsed": 1016.2751420930144, "steps_per_second": 38.305885516511864, "loss_extra": 0.022602764489129186} +{"step": 38600, "loss": 0.021309278942644595, "loss_real": 0.016190532334148883, "loss_synth": 0.020936822053045034, "lr": 8.426222332421624e-05, "elapsed": 1021.2062699699891, "steps_per_second": 38.31691282546331, "loss_extra": 0.022569430684670808} +{"step": 38800, "loss": 0.02130288066342473, "loss_real": 0.016379661145620047, "loss_synth": 0.0209159991517663, "lr": 8.185385498827815e-05, "elapsed": 1026.163672153023, "steps_per_second": 38.32683795170893, "loss_extra": 0.022543427404016256} +{"step": 39000, "loss": 0.021328275240957737, "loss_real": 0.016222199685871602, "loss_synth": 0.020936077833175658, "lr": 7.948088192702195e-05, "elapsed": 1031.091566394025, "steps_per_second": 38.33777836661381, "loss_extra": 0.022605882324278355} +{"step": 39200, "loss": 0.021268589617684484, "loss_real": 0.01634311712346971, "loss_synth": 0.02095163377933204, "lr": 7.714367886040248e-05, "elapsed": 1036.0294870630023, "steps_per_second": 38.34823715075938, "loss_extra": 0.022439898159354925} +{"step": 39400, "loss": 0.021282510580495, "loss_real": 0.016430259053595363, "loss_synth": 0.021022271579131484, "lr": 7.48426148598775e-05, "elapsed": 1040.9321992750047, "steps_per_second": 38.359910276275045, "loss_extra": 0.022384622218087315} +{"step": 39600, "loss": 0.021189692467451095, "loss_real": 0.016171302706934513, "loss_synth": 0.020817193500697613, "lr": 7.25780532901276e-05, "elapsed": 1045.8692686079885, "steps_per_second": 38.370195103237606, "loss_extra": 0.022432451425120233} +{"step": 39800, "loss": 0.021260514883324505, "loss_real": 0.016121374787762762, "loss_synth": 0.020928279254585503, "lr": 7.035035175167622e-05, "elapsed": 1050.801754959044, "steps_per_second": 38.380551620174835, "loss_extra": 0.022484158920124172} +{"step": 40000, "loss": 0.021283114273101093, "loss_real": 0.01642720400355756, "loss_synth": 0.02093034687452018, "lr": 6.81598620244206e-05, "elapsed": 1055.7037764940178, "steps_per_second": 38.391932633806015, "loss_extra": 0.02247799807228148} +{"step": 40200, "loss": 0.02109905978664756, "loss_real": 0.016313981260173024, "loss_synth": 0.020726068168878554, "lr": 6.600693001208181e-05, "elapsed": 1082.6433292879956, "steps_per_second": 37.61139193529929, "loss_extra": 0.022301776306703686} +{"step": 40400, "loss": 0.02111832182854414, "loss_real": 0.01610245322342962, "loss_synth": 0.020797186633571982, "lr": 6.38918956875819e-05, "elapsed": 1087.5789901289972, "steps_per_second": 37.62476821465993, "loss_extra": 0.022309496197849513} +{"step": 40600, "loss": 0.02120262324810028, "loss_real": 0.015928930281661452, "loss_synth": 0.020834206771105528, "lr": 6.181509303935915e-05, "elapsed": 1092.4817453240394, "steps_per_second": 37.63917027116316, "loss_extra": 0.022485670251771808} +{"step": 40800, "loss": 0.021254267850890754, "loss_real": 0.016208068826235832, "loss_synth": 0.020930632054805755, "lr": 5.977685001862671e-05, "elapsed": 1097.4011655829963, "steps_per_second": 37.65286289555475, "loss_extra": 0.02245320172980428} +{"step": 41000, "loss": 0.021164623629301785, "loss_real": 0.016084491517394783, "loss_synth": 0.020847751339897514, "lr": 5.7777488487585654e-05, "elapsed": 1102.3465211490402, "steps_per_second": 37.66553432773181, "loss_extra": 0.022362717734649776} +{"step": 41200, "loss": 0.021135887634009122, "loss_real": 0.016375961969606577, "loss_synth": 0.020767344683408736, "lr": 5.581732416859908e-05, "elapsed": 1107.2621978700045, "steps_per_second": 37.67911381566623, "loss_extra": 0.022329804413020612} +{"step": 41400, "loss": 0.021140669491142034, "loss_real": 0.01593901025597006, "loss_synth": 0.020856150425970554, "lr": 5.3896666594335835e-05, "elapsed": 1112.200352513988, "steps_per_second": 37.69180039335105, "loss_extra": 0.022327660294249655} +{"step": 41600, "loss": 0.021137935230508446, "loss_real": 0.01607713127043098, "loss_synth": 0.020897323144599796, "lr": 5.20158190588919e-05, "elapsed": 1117.1248338530422, "steps_per_second": 37.70484067525603, "loss_extra": 0.022256734566763043} +{"step": 41800, "loss": 0.021080599213019014, "loss_real": 0.015991147626191377, "loss_synth": 0.02073056176304817, "lr": 5.017507856989665e-05, "elapsed": 1122.047889191017, "steps_per_second": 37.71781360420839, "loss_extra": 0.02231333702802658} +{"step": 42000, "loss": 0.021085422122851014, "loss_real": 0.016157800327055157, "loss_synth": 0.020791819849982858, "lr": 4.837473580161169e-05, "elapsed": 1126.9890850119991, "steps_per_second": 37.73005691606878, "loss_extra": 0.022233849745243787} +{"step": 42200, "loss": 0.02111042042262852, "loss_real": 0.016311874561943114, "loss_synth": 0.02077367462217808, "lr": 4.6615075049030575e-05, "elapsed": 1131.9060764770256, "steps_per_second": 37.74300905760205, "loss_extra": 0.0222793841548264} +{"step": 42400, "loss": 0.02114136845804751, "loss_real": 0.01613271695561707, "loss_synth": 0.02085549739189446, "lr": 4.489637418298455e-05, "elapsed": 1136.8172021330101, "steps_per_second": 37.75604499155242, "loss_extra": 0.022296174839138986} +{"step": 42600, "loss": 0.02101856271736324, "loss_real": 0.015811790488660337, "loss_synth": 0.020737175503745674, "lr": 4.321890460626433e-05, "elapsed": 1141.7360145670245, "steps_per_second": 37.76871000541583, "loss_extra": 0.022203323505818842} +{"step": 42800, "loss": 0.02108802817761898, "loss_real": 0.015840104511007667, "loss_synth": 0.020799293713644147, "lr": 4.158293121076186e-05, "elapsed": 1146.6480943270144, "steps_per_second": 37.78148956661878, "loss_extra": 0.022287254063412545} +{"step": 43000, "loss": 0.0210224153008312, "loss_real": 0.015776446722447872, "loss_synth": 0.02076785247772932, "lr": 3.99887123356411e-05, "elapsed": 1151.5913301720284, "steps_per_second": 37.79312387516121, "loss_extra": 0.022187274480238557} +{"step": 43200, "loss": 0.021171291703358294, "loss_real": 0.016026101247407495, "loss_synth": 0.020865543643012643, "lr": 3.843649972654328e-05, "elapsed": 1156.548258565017, "steps_per_second": 37.80420450677431, "loss_extra": 0.022369611095637083} +{"step": 43400, "loss": 0.02104262661188841, "loss_real": 0.015809198427014053, "loss_synth": 0.020717367809265853, "lr": 3.69265384958331e-05, "elapsed": 1161.4815888890298, "steps_per_second": 37.81596700655207, "loss_extra": 0.022275703912600874} +{"step": 43600, "loss": 0.02109858289361, "loss_real": 0.0158773842966184, "loss_synth": 0.020786356898024678, "lr": 3.545906708389291e-05, "elapsed": 1166.39165451203, "steps_per_second": 37.82839235144389, "loss_extra": 0.022316557755693793} +{"step": 43800, "loss": 0.02102964370511472, "loss_real": 0.016096889711916446, "loss_synth": 0.02070450412109494, "lr": 3.403431722147019e-05, "elapsed": 1171.3147246310255, "steps_per_second": 37.84028713507757, "loss_extra": 0.022210366670042277} +{"step": 44000, "loss": 0.02098939542658627, "loss_real": 0.016186449523083866, "loss_synth": 0.02067618845961988, "lr": 3.265251389308442e-05, "elapsed": 1176.2616793750203, "steps_per_second": 37.85130342440164, "loss_extra": 0.0221356843598187} +{"step": 44200, "loss": 0.021023839954286815, "loss_real": 0.015726667027920485, "loss_synth": 0.02072083396837115, "lr": 3.1313875301499545e-05, "elapsed": 1181.1670349170454, "steps_per_second": 37.86357558300799, "loss_extra": 0.022245833165943623} +{"step": 44400, "loss": 0.02105315063148737, "loss_real": 0.016137720216065646, "loss_synth": 0.020703355902805923, "lr": 3.0018612833267117e-05, "elapsed": 1186.0905449700076, "steps_per_second": 37.87515847094931, "loss_extra": 0.02225541434250772} +{"step": 44600, "loss": 0.02100727066397667, "loss_real": 0.016021648375317454, "loss_synth": 0.02071731069125235, "lr": 2.8766931025346027e-05, "elapsed": 1191.0241554109962, "steps_per_second": 37.88631942167352, "loss_extra": 0.022162147257477047} +{"step": 44800, "loss": 0.021009098635986448, "loss_real": 0.015852258531376718, "loss_synth": 0.020662813475355507, "lr": 2.755902753280375e-05, "elapsed": 1195.932639893028, "steps_per_second": 37.898192714145445, "loss_extra": 0.022249807473272085} +{"step": 45000, "loss": 0.020970465680584312, "loss_real": 0.015884880269877614, "loss_synth": 0.020634366925805808, "lr": 2.639509309760422e-05, "elapsed": 1200.8857117590378, "steps_per_second": 37.90854387097974, "loss_extra": 0.02218865228816867} +{"step": 45200, "loss": 0.020978265376761555, "loss_real": 0.015612454321235418, "loss_synth": 0.020645256508141755, "lr": 2.5275311518487436e-05, "elapsed": 1206.7516750739887, "steps_per_second": 37.889791674413765, "loss_extra": 0.022242058366537094} +{"step": 45400, "loss": 0.021006376873701813, "loss_real": 0.01613305734936148, "loss_synth": 0.02067474021576345, "lr": 2.4199859621945708e-05, "elapsed": 1211.7440212279907, "steps_per_second": 37.89884151857589, "loss_extra": 0.02218324343673885} +{"step": 45600, "loss": 0.02096713592298329, "loss_real": 0.015927538583055137, "loss_synth": 0.02061900426633656, "lr": 2.316890723430054e-05, "elapsed": 1216.6408549009939, "steps_per_second": 37.9108263906643, "loss_extra": 0.022189314970746638} +{"step": 45800, "loss": 0.020906903902068733, "loss_real": 0.015753947757184507, "loss_synth": 0.02056155257858336, "lr": 2.218261715488513e-05, "elapsed": 1221.5742308460176, "steps_per_second": 37.92156667756305, "loss_extra": 0.022146007977426052} +{"step": 46000, "loss": 0.020980730224400758, "loss_real": 0.01599663181230426, "loss_synth": 0.020669588139280676, "lr": 2.1241145130336496e-05, "elapsed": 1226.6524769010139, "steps_per_second": 37.92768863862092, "loss_extra": 0.022156434524804355} +{"step": 46200, "loss": 0.020843016374856235, "loss_real": 0.01554868342820555, "loss_synth": 0.02045513402670622, "lr": 2.0344639830001105e-05, "elapsed": 1231.5737174029928, "steps_per_second": 37.93865040346822, "loss_extra": 0.02214903271757066} +{"step": 46400, "loss": 0.020988565944135187, "loss_real": 0.01581008380278945, "loss_synth": 0.020701685920357704, "lr": 1.949324282245851e-05, "elapsed": 1236.515736891015, "steps_per_second": 37.94887897590253, "loss_extra": 0.022173881083726883} +{"step": 46600, "loss": 0.020887659825384618, "loss_real": 0.01566904101986438, "loss_synth": 0.02053529690951109, "lr": 1.8687088553165976e-05, "elapsed": 1241.4378152980353, "steps_per_second": 37.95964178935341, "loss_extra": 0.022145153591409325} +{"step": 46800, "loss": 0.020924713164567947, "loss_real": 0.015616821506991983, "loss_synth": 0.02064220099709928, "lr": 1.7926304323227836e-05, "elapsed": 1246.3922330019996, "steps_per_second": 37.96932240861305, "loss_extra": 0.022128161480650305} +{"step": 47000, "loss": 0.02100780579261482, "loss_real": 0.015920940865762533, "loss_synth": 0.020693345861509442, "lr": 1.721101026929328e-05, "elapsed": 1251.3129403950297, "steps_per_second": 37.979960068170435, "loss_extra": 0.0222046675439924} +{"step": 47200, "loss": 0.020916852904483675, "loss_real": 0.01592015705537051, "loss_synth": 0.0205940474383533, "lr": 1.6541319344585365e-05, "elapsed": 1256.2329302690341, "steps_per_second": 37.990535451427796, "loss_extra": 0.02210636019706726} +{"step": 47400, "loss": 0.020969928950071336, "loss_real": 0.015710624610073866, "loss_synth": 0.020656179003417492, "lr": 1.5917337301064426e-05, "elapsed": 1261.1550155809964, "steps_per_second": 38.00096354472213, "loss_extra": 0.02219604143872857} +{"step": 47600, "loss": 0.02092237741686404, "loss_real": 0.016056788046844305, "loss_synth": 0.020610097385942935, "lr": 1.533916267272854e-05, "elapsed": 1266.0983878810075, "steps_per_second": 38.01066352119981, "loss_extra": 0.022078626453876496} +{"step": 47800, "loss": 0.020933749321848154, "loss_real": 0.015794036258012057, "loss_synth": 0.02062196683138609, "lr": 1.480688676005397e-05, "elapsed": 1270.9972631729906, "steps_per_second": 38.02163291859045, "loss_extra": 0.022137126103043556} +{"step": 48000, "loss": 0.020889852661639452, "loss_real": 0.015662615336477757, "loss_synth": 0.020577221605926753, "lr": 1.432059361557764e-05, "elapsed": 1275.9180218830006, "steps_per_second": 38.03185771859745, "loss_extra": 0.022109280154109002} +{"step": 48200, "loss": 0.020899162059649826, "loss_real": 0.015935757062397898, "loss_synth": 0.02056769661605358, "lr": 1.3880360030624374e-05, "elapsed": 1280.814914698014, "steps_per_second": 38.04271967581837, "loss_extra": 0.022091508815065025} +{"step": 48400, "loss": 0.020897894520312547, "loss_real": 0.015962193538434803, "loss_synth": 0.020568557791411878, "lr": 1.3486255523180529e-05, "elapsed": 1285.7535677900305, "steps_per_second": 38.052248622913766, "loss_extra": 0.022083308631554246} +{"step": 48600, "loss": 0.0208719692658633, "loss_real": 0.015658958163112403, "loss_synth": 0.020543673736974598, "lr": 1.313834232691649e-05, "elapsed": 1290.6653204450267, "steps_per_second": 38.0625057438749, "loss_extra": 0.02210452312603593} +{"step": 48800, "loss": 0.02091192684136331, "loss_real": 0.01596527488902211, "loss_synth": 0.02059693873859942, "lr": 1.2836675381359077e-05, "elapsed": 1295.5911673200317, "steps_per_second": 38.07226560233039, "loss_extra": 0.02208495570346713} +{"step": 49000, "loss": 0.020955416299402715, "loss_real": 0.015915231881663203, "loss_synth": 0.02061184123158455, "lr": 1.2581302323216026e-05, "elapsed": 1300.4945809830097, "steps_per_second": 38.082614695105576, "loss_extra": 0.02217316006310284} +{"step": 49200, "loss": 0.02090903190895915, "loss_real": 0.015825803847983478, "loss_synth": 0.020611258354038, "lr": 1.2372263478853567e-05, "elapsed": 1305.4368306660326, "steps_per_second": 38.09173984467329, "loss_extra": 0.02208864607848227} +{"step": 49400, "loss": 0.020979281719774007, "loss_real": 0.015779478386975826, "loss_synth": 0.02065817192196846, "lr": 1.2209591857928498e-05, "elapsed": 1310.3773863849929, "steps_per_second": 38.100845203162336, "loss_extra": 0.022202385999262334} +{"step": 49600, "loss": 0.02089942985214293, "loss_real": 0.01572228238452226, "loss_synth": 0.020558531377464533, "lr": 1.2093313148175555e-05, "elapsed": 1315.3105948820012, "steps_per_second": 38.11009657267407, "loss_extra": 0.022138303061947227} +{"step": 49800, "loss": 0.020843188045546412, "loss_real": 0.015472057987935842, "loss_synth": 0.020547844832763076, "lr": 1.2023445711350887e-05, "elapsed": 1320.2180105370353, "steps_per_second": 38.12003067996196, "loss_extra": 0.02207039893604815} +{"step": 50000, "loss": 0.02091786530800164, "loss_real": 0.015683676381595433, "loss_synth": 0.020550420740619302, "lr": 1.2000000580332747e-05, "elapsed": 1325.1335181930335, "steps_per_second": 38.12965513566355, "loss_extra": 0.022193081583827733} diff --git a/shared/package-files/c3/c3770a0ea1092e434be6e5c96fc14af6c4480905f7389f5a519a5b4100ff3b3a/recipe.json b/shared/package-files/c3/c3770a0ea1092e434be6e5c96fc14af6c4480905f7389f5a519a5b4100ff3b3a/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..5ec53b5d52ac036c07e82c7e971087266159ef62 --- /dev/null +++ b/shared/package-files/c3/c3770a0ea1092e434be6e5c96fc14af6c4480905f7389f5a519a5b4100ff3b3a/recipe.json @@ -0,0 +1,59 @@ +{ + "args": { + "store": "/workspace/research/inv", + "out": "runs/I5h-ff512x6-real08-heavy8", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 100000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "heavy_boost": 8.0, + "heavy_lo": 450.0, + "heavy_hi": 850.0, + "lr": 0.0006, + "weight_decay": 0.0001, + "warmup": 2000, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 5000, + "retrieve_every": 10000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.0, + "contrast_k": 31, + "contrast_tau": 0.05, + "init": null, + "max_steps_this_run": 0 + }, + "parameters": 24997832, + "model": { + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "pair_dim": 64, + "fp_bits": 4096, + "max_energy": 200.0 + }, + "real_rows": 194119, + "synth_rows": 2333477, + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "gpu": "NVIDIA H100 80GB HBM3", + "load_seconds": 20.895511648152024 +} diff --git a/shared/package-files/c5/c5188db412d90efe82de7ab3f915caafefbd673e1ddd3af00de858cf53412dda/after-I14.sh b/shared/package-files/c5/c5188db412d90efe82de7ab3f915caafefbd673e1ddd3af00de858cf53412dda/after-I14.sh new file mode 100644 index 0000000000000000000000000000000000000000..08ee56bb1213658496fc98ae72a6ef80171bbe67 --- /dev/null +++ b/shared/package-files/c5/c5188db412d90efe82de7ab3f915caafefbd673e1ddd3af00de858cf53412dda/after-I14.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# E69 / E70: when I14 (150k-step inverse network) is done, start I16 (I9b recipe + spurious-peak augmentation) and +# score I14 alone and in ensembles, alone and inside the full release rule (lab; labels: evaluation only) +cd /workspace/research +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps GLACIER_SOURCE=/workspace/research/ms-pred/src OMP_NUM_THREADS=4 +PY=/opt/glacier/bin/python +I9b=runs/I9b-ff512x6-real08-corpus2+train3/step-0050000-ema.pt +I13=runs/I13-ff512x6-real08-corpus2+train3-seed2/step-0050000-ema.pt +I14=runs/I14-ff512x6-real08-corpus2+train3-150k/step-0150000-ema.pt +while kill -0 $1 2>/dev/null; do sleep 5; done +[ -f $I14 ] || { echo "I14 checkpoint missing" > logs/after-I14.err; exit 1; } +N=I16-ff512x6-real08-corpus2+train3-noise05 +taskset -c 3-10 $PY allcond/inv/train_inv.py --out runs/$N --real-frac 0.08 --extra-store inv/selfsim/corpus2+train3.npz --extra-frac 0.5 \ + --steps 50000 --batch 512 --lr 0.0006 --warmup 2000 --dim 512 --layers 6 --heads 8 --dropout 0.1 --seed 1 \ + --noise-rate 0.5 --noise-max 12 --noise-shape 3 > logs/$N.log 2>&1 & +taskset -c 11-14 $PY allcond/inv/eval_score.py evals/score/I14.pkl $I14 > logs/eval-score-I14.log 2>&1 +taskset -c 11-14 $PY allcond/inv/eval_score.py evals/score/I9b+I14.pkl $I9b $I14 > logs/eval-score-I9b+I14.log 2>&1 +taskset -c 11-14 $PY allcond/inv/eval_score.py evals/score/I9b+I13+I14.pkl $I9b $I13 $I14 > logs/eval-score-I9b+I13+I14.log 2>&1 +echo scored > logs/after-I14.scored +export CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=2 +c=11 +for name in I14 I9b+I14 I9b+I13+I14; do + ( taskset -c $c-$((c+1)) $PY allcond/analysis/inv_swap.py prepare --score evals/score/$name.pkl:pow070 --out evals/fullfold/swap-$name/pred > logs/swap-$name.log 2>&1 + taskset -c $c-$((c+1)) $PY allcond/analysis/netprop.py evaluate --neigh evals/netprop/neigh-ref.npz --pred evals/fullfold/swap-$name/pred \ + --variants 10:3:half=0.5 --lams 1/1 --m 10 --tau 0.02 --brief --save evals/netprop/term-swap-$name.pkl >> logs/swap-$name.log 2>&1 + taskset -c $c-$((c+1)) $PY allcond/analysis/inv_swap.py compare --pred evals/fullfold/swap-$name/pred --term evals/netprop/term-swap-$name.pkl 2>/dev/null >> logs/swap-$name.log ) & + c=$((c+2)) +done +wait +echo done > logs/after-I14.done diff --git a/shared/package-files/c5/c51f184e4e4cf75d10c45abb3adefc6d9fc43df87fc3e8cffc5bd5ab27c7041e/synthlib-build-bin001.log b/shared/package-files/c5/c51f184e4e4cf75d10c45abb3adefc6d9fc43df87fc3e8cffc5bd5ab27c7041e/synthlib-build-bin001.log new file mode 100644 index 0000000000000000000000000000000000000000..fd81aeb82cab452603be772f57c0e3f0bcbc7b69 --- /dev/null +++ b/shared/package-files/c5/c51f184e4e4cf75d10c45abb3adefc6d9fc43df87fc3e8cffc5bd5ab27c7041e/synthlib-build-bin001.log @@ -0,0 +1,4 @@ +spectra 2317437, structures 432467, peaks 115219117 (kept 115218962), 3 s +frag: 114902616 entries, empty rows 0, 10 s +loss: 114903533 entries, empty rows 0, 18 s +fingerprints (432467, 512), empty 0, 30 s diff --git a/shared/package-files/c5/c53f5a3788c3f06834456346a09f833700ee38ee9c3e7ea794680eda03ef2b59/fullfold-5Ms-I9b+I13-L-ion-net.report.json b/shared/package-files/c5/c53f5a3788c3f06834456346a09f833700ee38ee9c3e7ea794680eda03ef2b59/fullfold-5Ms-I9b+I13-L-ion-net.report.json new file mode 100644 index 0000000000000000000000000000000000000000..9c4553c8dc5aa5729a9df68cfce4c98851264239 --- /dev/null +++ b/shared/package-files/c5/c53f5a3788c3f06834456346a09f833700ee38ee9c3e7ea794680eda03ef2b59/fullfold-5Ms-I9b+I13-L-ion-net.report.json @@ -0,0 +1,123 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.8021514231303721, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.679162949859038, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.8021514231303721, + "hit_rate_at_20": 0.9163621390704617, + "hit_rate_at_5": 0.8718925317823871 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.030830202274949817, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.009501343789872024, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.056130566938685164 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8633269806697522, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.6124129195693477, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.8017637048115105, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 1.0, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.9434931506849316, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.9329929802169751, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.84, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.9519230769230769, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.6651152951131796, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7736625514403292, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7967029624673033, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.8434504792332268, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.667354306343476, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.9364084651736182, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.8021514231303721, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7445318166611886, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8469376196029735 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/c5/c53f5a3788c3f06834456346a09f833700ee38ee9c3e7ea794680eda03ef2b59/fullfold-5Ms-I9b+I13-L-ion-net.score.log b/shared/package-files/c5/c53f5a3788c3f06834456346a09f833700ee38ee9c3e7ea794680eda03ef2b59/fullfold-5Ms-I9b+I13-L-ion-net.score.log new file mode 100644 index 0000000000000000000000000000000000000000..9c4553c8dc5aa5729a9df68cfce4c98851264239 --- /dev/null +++ b/shared/package-files/c5/c53f5a3788c3f06834456346a09f833700ee38ee9c3e7ea794680eda03ef2b59/fullfold-5Ms-I9b+I13-L-ion-net.score.log @@ -0,0 +1,123 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": true, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.8021514231303721, + "saturation": "upper", + "score": 1.0, + "unclipped_score": 1.679162949859038, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.8021514231303721, + "hit_rate_at_20": 0.9163621390704617, + "hit_rate_at_5": 0.8718925317823871 + }, + "paired_baseline_delta": { + "confidence": 0.95, + "estimate": 0.030830202274949817, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.009501343789872024, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.056130566938685164 + }, + "queries": 19429, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.8633269806697522, + "queries": 14692 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.6124129195693477, + "queries": 4737 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.8017637048115105, + "queries": 19391 + }, + "33-128": { + "hit_rate_at_1": 1.0, + "queries": 38 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.9434931506849316, + "queries": 4088 + }, + "40-59.999": { + "hit_rate_at_1": 0.9329929802169751, + "queries": 1567 + }, + "<20": { + "hit_rate_at_1": 0.84, + "queries": 1200 + }, + ">=60": { + "hit_rate_at_1": 0.9519230769230769, + "queries": 3120 + }, + "missing": { + "hit_rate_at_1": 0.6651152951131796, + "queries": 9454 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.7736625514403292, + "queries": 486 + }, + "Orbitrap": { + "hit_rate_at_1": 0.7967029624673033, + "queries": 16439 + }, + "QTOF": { + "hit_rate_at_1": 0.8434504792332268, + "queries": 2504 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.667354306343476, + "queries": 9695 + }, + "glacier_released": { + "hit_rate_at_1": 0.9364084651736182, + "queries": 9734 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.8021514231303721, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.7445318166611886, + "molecule_groups": 3185, + "queries": 19429, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.8469376196029735 + }, + "valid_rankings": 19429 +} diff --git a/shared/package-files/c5/c5886073aa78e100cb4d11cc05363f824fff1a251233e5ef8b136851daae3971/coverage-4M.log b/shared/package-files/c5/c5886073aa78e100cb4d11cc05363f824fff1a251233e5ef8b136851daae3971/coverage-4M.log new file mode 100644 index 0000000000000000000000000000000000000000..39ce520951cc4fdde56eec4997af6032feb82f70 --- /dev/null +++ b/shared/package-files/c5/c5886073aa78e100cb4d11cc05363f824fff1a251233e5ef8b136851daae3971/coverage-4M.log @@ -0,0 +1,54 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 89.52446571200562} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 93.74778667101054} +ind Dmean all=0.4997 dom=0.7406 non=0.2578 h5=0.6480 h20=0.7240 | diff=+0.0000 [+0.0000,+0.0000] +agg Dmean all=0.6500 dom=0.8168 non=0.4824 h5=0.8348 h20=0.9095 | diff=+0.0000 [+0.0000,+0.0000] +ind flat0.25 all=0.4869 dom=0.7293 non=0.2435 h5=0.6373 h20=0.7170 | diff=-0.0128 [-0.0191,-0.0067] +agg flat0.25 all=0.6389 dom=0.8080 non=0.4691 h5=0.8047 h20=0.8760 | diff=-0.0111 [-0.0269,+0.0058] +ind 1-cov_q all=0.4231 dom=0.6373 non=0.2081 h5=0.5977 h20=0.7052 | diff=-0.0765 [-0.0880,-0.0651] +agg 1-cov_q all=0.5814 dom=0.7735 non=0.3886 h5=0.7518 h20=0.8541 | diff=-0.0686 [-0.0962,-0.0424] +ind 1-cov_n all=0.4123 dom=0.6268 non=0.1970 h5=0.5903 h20=0.7000 | diff=-0.0873 [-0.0991,-0.0760] +agg 1-cov_n all=0.5915 dom=0.7790 non=0.4033 h5=0.7519 h20=0.8527 | diff=-0.0584 [-0.0859,-0.0324] +ind 1-prec20 all=0.4130 dom=0.6159 non=0.2094 h5=0.6040 h20=0.6994 | diff=-0.0866 [-0.0969,-0.0781] +agg 1-prec20 all=0.5668 dom=0.7616 non=0.3713 h5=0.7685 h20=0.8663 | diff=-0.0831 [-0.1056,-0.0619] +ind 1-prec50 all=0.4017 dom=0.6010 non=0.2015 h5=0.5955 h20=0.7009 | diff=-0.0980 [-0.1080,-0.0886] +agg 1-prec50 all=0.5633 dom=0.7552 non=0.3707 h5=0.7454 h20=0.8490 | diff=-0.0866 [-0.1100,-0.0651] +ind Dmean+0.1*(1-cov_q) all=0.5055 dom=0.7496 non=0.2603 h5=0.6503 h20=0.7247 | diff=+0.0058 [+0.0037,+0.0079] +agg Dmean+0.1*(1-cov_q) all=0.6582 dom=0.8275 non=0.4883 h5=0.8388 h20=0.9103 | diff=+0.0083 [-0.0035,+0.0219] +ind Dmean+0.25*(1-cov_q) all=0.5094 dom=0.7557 non=0.2622 h5=0.6509 h20=0.7242 | diff=+0.0098 [+0.0064,+0.0132] +agg Dmean+0.25*(1-cov_q) all=0.6570 dom=0.8256 non=0.4878 h5=0.8377 h20=0.9095 | diff=+0.0071 [-0.0092,+0.0241] +ind Dmean+0.5*(1-cov_q) all=0.5106 dom=0.7583 non=0.2619 h5=0.6504 h20=0.7241 | diff=+0.0109 [+0.0064,+0.0156] +agg Dmean+0.5*(1-cov_q) all=0.6470 dom=0.8210 non=0.4722 h5=0.8381 h20=0.8995 | diff=-0.0030 [-0.0226,+0.0180] +ind Dmean+1.0*(1-cov_q) all=0.5057 dom=0.7549 non=0.2555 h5=0.6478 h20=0.7251 | diff=+0.0060 [+0.0006,+0.0118] +agg Dmean+1.0*(1-cov_q) all=0.6362 dom=0.8243 non=0.4473 h5=0.7926 h20=0.8982 | diff=-0.0137 [-0.0379,+0.0098] +ind Dmean+0.1*(1-cov_n) all=0.5056 dom=0.7513 non=0.2590 h5=0.6508 h20=0.7246 | diff=+0.0060 [+0.0041,+0.0080] +agg Dmean+0.1*(1-cov_n) all=0.6626 dom=0.8273 non=0.4972 h5=0.8421 h20=0.9101 | diff=+0.0126 [+0.0017,+0.0256] +ind Dmean+0.25*(1-cov_n) all=0.5082 dom=0.7552 non=0.2601 h5=0.6518 h20=0.7239 | diff=+0.0085 [+0.0053,+0.0118] +agg Dmean+0.25*(1-cov_n) all=0.6659 dom=0.8256 non=0.5056 h5=0.8445 h20=0.9095 | diff=+0.0160 [+0.0004,+0.0326] +ind Dmean+0.5*(1-cov_n) all=0.5099 dom=0.7596 non=0.2592 h5=0.6519 h20=0.7240 | diff=+0.0102 [+0.0062,+0.0147] +agg Dmean+0.5*(1-cov_n) all=0.6537 dom=0.8321 non=0.4746 h5=0.8362 h20=0.9020 | diff=+0.0038 [-0.0169,+0.0241] +ind Dmean+1.0*(1-cov_n) all=0.5037 dom=0.7528 non=0.2535 h5=0.6491 h20=0.7257 | diff=+0.0040 [-0.0014,+0.0097] +agg Dmean+1.0*(1-cov_n) all=0.6429 dom=0.8267 non=0.4583 h5=0.8010 h20=0.8994 | diff=-0.0071 [-0.0288,+0.0144] +ind Dmean+0.1*(1-prec20) all=0.4982 dom=0.7376 non=0.2578 h5=0.6469 h20=0.7224 | diff=-0.0015 [-0.0031,+0.0001] +agg Dmean+0.1*(1-prec20) all=0.6479 dom=0.8161 non=0.4791 h5=0.8358 h20=0.9093 | diff=-0.0020 [-0.0069,+0.0023] +ind Dmean+0.25*(1-prec20) all=0.4954 dom=0.7351 non=0.2549 h5=0.6450 h20=0.7220 | diff=-0.0042 [-0.0067,-0.0019] +agg Dmean+0.25*(1-prec20) all=0.6455 dom=0.8145 non=0.4758 h5=0.8352 h20=0.9091 | diff=-0.0045 [-0.0102,+0.0005] +ind Dmean+0.5*(1-prec20) all=0.4896 dom=0.7275 non=0.2509 h5=0.6425 h20=0.7209 | diff=-0.0100 [-0.0137,-0.0067] +agg Dmean+0.5*(1-prec20) all=0.6454 dom=0.8129 non=0.4773 h5=0.8317 h20=0.9073 | diff=-0.0045 [-0.0141,+0.0056] +ind Dmean+1.0*(1-prec20) all=0.4768 dom=0.7093 non=0.2433 h5=0.6370 h20=0.7203 | diff=-0.0229 [-0.0280,-0.0186] +agg Dmean+1.0*(1-prec20) all=0.6373 dom=0.8060 non=0.4680 h5=0.8276 h20=0.8973 | diff=-0.0126 [-0.0252,+0.0000] +ind Dmean+0.1*(1-prec50) all=0.4980 dom=0.7391 non=0.2560 h5=0.6458 h20=0.7227 | diff=-0.0016 [-0.0029,-0.0004] +agg Dmean+0.1*(1-prec50) all=0.6504 dom=0.8166 non=0.4834 h5=0.8361 h20=0.9093 | diff=+0.0004 [-0.0022,+0.0035] +ind Dmean+0.25*(1-prec50) all=0.4957 dom=0.7354 non=0.2551 h5=0.6446 h20=0.7211 | diff=-0.0040 [-0.0062,-0.0019] +agg Dmean+0.25*(1-prec50) all=0.6529 dom=0.8265 non=0.4786 h5=0.8344 h20=0.9094 | diff=+0.0029 [-0.0055,+0.0139] +ind Dmean+0.5*(1-prec50) all=0.4914 dom=0.7304 non=0.2514 h5=0.6418 h20=0.7194 | diff=-0.0083 [-0.0115,-0.0053] +agg Dmean+0.5*(1-prec50) all=0.6484 dom=0.8233 non=0.4727 h5=0.8030 h20=0.9082 | diff=-0.0016 [-0.0108,+0.0103] +ind Dmean+1.0*(1-prec50) all=0.4822 dom=0.7187 non=0.2448 h5=0.6373 h20=0.7202 | diff=-0.0174 [-0.0222,-0.0129] +agg Dmean+1.0*(1-prec50) all=0.6471 dom=0.8203 non=0.4731 h5=0.8003 h20=0.9084 | diff=-0.0029 [-0.0160,+0.0114] +ind Dmean+0.1*(flat0.25) all=0.4997 dom=0.7408 non=0.2577 h5=0.6472 h20=0.7232 | diff=+0.0001 [-0.0008,+0.0009] +agg Dmean+0.1*(flat0.25) all=0.6513 dom=0.8197 non=0.4822 h5=0.8451 h20=0.9095 | diff=+0.0013 [-0.0001,+0.0038] +ind Dmean+0.25*(flat0.25) all=0.4995 dom=0.7415 non=0.2565 h5=0.6472 h20=0.7229 | diff=-0.0002 [-0.0016,+0.0015] +agg Dmean+0.25*(flat0.25) all=0.6523 dom=0.8242 non=0.4797 h5=0.8448 h20=0.9084 | diff=+0.0024 [-0.0062,+0.0130] +ind Dmean+0.5*(flat0.25) all=0.4985 dom=0.7404 non=0.2556 h5=0.6467 h20=0.7223 | diff=-0.0012 [-0.0032,+0.0009] +agg Dmean+0.5*(flat0.25) all=0.6525 dom=0.8217 non=0.4826 h5=0.8407 h20=0.9078 | diff=+0.0025 [-0.0082,+0.0147] +ind Dmean+1.0*(flat0.25) all=0.4988 dom=0.7420 non=0.2546 h5=0.6459 h20=0.7217 | diff=-0.0009 [-0.0035,+0.0018] +agg Dmean+1.0*(flat0.25) all=0.6547 dom=0.8241 non=0.4846 h5=0.8123 h20=0.9049 | diff=+0.0047 [-0.0075,+0.0177] diff --git a/shared/package-files/c5/c5b5f1c84044f4898cb1580c056cf894baec817f982617c19d39c2965ad1b429/missed-pools-sjhb.log b/shared/package-files/c5/c5b5f1c84044f4898cb1580c056cf894baec817f982617c19d39c2965ad1b429/missed-pools-sjhb.log new file mode 100644 index 0000000000000000000000000000000000000000..a4cf2e98aa2e501623c1f749ede3b5929f7f52e4 --- /dev/null +++ b/shared/package-files/c5/c5b5f1c84044f4898cb1580c056cf894baec817f982617c19d39c2965ad1b429/missed-pools-sjhb.log @@ -0,0 +1,28 @@ +missed pools 402 of 3386; missed queries 3764 of 19429 (0.1937) + pools with 1-1 spectra: 51 missed pools, 51 queries (0.0026), label rank 2-5 in 0.57 + pools with 2-5 spectra: 234 missed pools, 683 queries (0.0352), label rank 2-5 in 0.54 + pools with 6-20 spectra: 76 missed pools, 875 queries (0.0450), label rank 2-5 in 0.41 + pools with 21-100 spectra: 40 missed pools, 1613 queries (0.0830), label rank 2-5 in 0.40 + pools with 101-10000 spectra: 1 missed pools, 542 queries (0.0279), label rank 2-5 in 0.00 + 542 spectra | label rank 28 of 256 | m/z 969.54 | [('[M+Na]+', 430), ('[M+H]+', 112)] | Orbitrap | energy recorded 0.00 | median peaks 8 + 76 spectra | label rank 13 of 256 | m/z 855.47 | [('[M+Na]+', 52), ('[M+H]+', 24)] | Orbitrap | energy recorded 0.00 | median peaks 8 + 72 spectra | label rank 34 of 256 | m/z 927.53 | [('[M+H]+', 45), ('[M+Na]+', 27)] | Orbitrap | energy recorded 0.28 | median peaks 6 + 69 spectra | label rank 3 of 256 | m/z 554.31 | [('[M+H]+', 35), ('[M+Na]+', 34)] | Orbitrap | energy recorded 0.00 | median peaks 3 + 64 spectra | label rank 3 of 256 | m/z 731.39 | [('[M+H]+', 41), ('[M+Na]+', 23)] | Orbitrap | energy recorded 0.00 | median peaks 4 + 62 spectra | label rank 9 of 256 | m/z 917.55 | [('[M+Na]+', 36), ('[M+H]+', 26)] | Orbitrap | energy recorded 0.00 | median peaks 6 + 61 spectra | label rank 2 of 256 | m/z 783.27 | [('[M+H]+', 38), ('[M+Na]+', 23)] | Orbitrap | energy recorded 0.00 | median peaks 9 + 60 spectra | label rank 250 of 256 | m/z 333.10 | [('[M+Na]+', 42), ('[M+H]+', 18)] | Orbitrap | energy recorded 0.00 | median peaks 20 + 58 spectra | label rank 35 of 256 | m/z 739.42 | [('[M+Na]+', 42), ('[M+H]+', 16)] | Orbitrap | energy recorded 0.00 | median peaks 7 + 54 spectra | label rank 5 of 256 | m/z 959.52 | [('[M+Na]+', 28), ('[M+H]+', 26)] | Orbitrap | energy recorded 0.44 | median peaks 18 + 51 spectra | label rank 16 of 256 | m/z 491.36 | [('[M+H]+', 28), ('[M+Na]+', 23)] | Orbitrap | energy recorded 0.00 | median peaks 23 + 50 spectra | label rank 38 of 256 | m/z 709.22 | [('[M+H]+', 28), ('[M+Na]+', 22)] | Orbitrap | energy recorded 0.00 | median peaks 6 + 48 spectra | label rank 98 of 256 | m/z 965.50 | [('[M+Na]+', 28), ('[M+H]+', 20)] | Orbitrap | energy recorded 0.00 | median peaks 2 + 47 spectra | label rank 24 of 256 | m/z 935.49 | [('[M+H]+', 24), ('[M+Na]+', 23)] | Orbitrap | energy recorded 0.00 | median peaks 4 + 44 spectra | label rank 252 of 256 | m/z 607.25 | [('[M+Na]+', 44)] | Orbitrap | energy recorded 0.00 | median peaks 10 + 43 spectra | label rank 16 of 256 | m/z 871.47 | [('[M+Na]+', 22), ('[M+H]+', 21)] | Orbitrap | energy recorded 0.00 | median peaks 4 + 43 spectra | label rank 46 of 256 | m/z 763.18 | [('[M+Na]+', 24), ('[M+H]+', 19)] | Orbitrap | energy recorded 0.00 | median peaks 4 + 42 spectra | label rank 12 of 256 | m/z 819.38 | [('[M+H]+', 22), ('[M+Na]+', 20)] | Orbitrap | energy recorded 0.00 | median peaks 7 + 39 spectra | label rank 3 of 256 | m/z 438.29 | [('[M+H]+', 22), ('[M+Na]+', 17)] | Orbitrap | energy recorded 0.03 | median peaks 8 + 39 spectra | label rank 3 of 256 | m/z 508.29 | [('[M+H]+', 24), ('[M+Na]+', 15)] | Orbitrap | energy recorded 0.00 | median peaks 18 + 35 spectra | label rank 8 of 256 | m/z 551.25 | [('[M+Na]+', 20), ('[M+H]+', 15)] | Orbitrap | energy recorded 0.00 | median peaks 9 + 34 spectra | label rank 4 of 256 | m/z 683.36 | [('[M+H]+', 20), ('[M+Na]+', 14)] | Orbitrap | energy recorded 0.00 | median peaks 9 diff --git a/shared/package-files/c5/c5bb73f2da342aba80421da2a0eb07c1be26d27399db1960dddfae52bcea7fdd/replay-published-z3hoccsj-val-tiny.log b/shared/package-files/c5/c5bb73f2da342aba80421da2a0eb07c1be26d27399db1960dddfae52bcea7fdd/replay-published-z3hoccsj-val-tiny.log new file mode 100644 index 0000000000000000000000000000000000000000..b64710673e9a5844ed2d0ae2fcbcfa7b6f60fbdd --- /dev/null +++ b/shared/package-files/c5/c5bb73f2da342aba80421da2a0eb07c1be26d27399db1960dddfae52bcea7fdd/replay-published-z3hoccsj-val-tiny.log @@ -0,0 +1,13 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 5, "inverse_members": 3, "library": true, "workers": 13} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.9041886140039423} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 1.9344531050010119} +{"event": "candidate_store", "pools": 40, "pairs": 9390, "seconds": 1.3259409140009666} +{"event": "library", "scored": 180, "search_seconds": 1.2110331090079853, "seconds": 1.7037359020032454} +{"event": "inverse_annotated", "pools": 40, "pairs": 9390, "formulae": 1921, "unsupported_candidates": 75, "seconds": 6.189799751155078e-05} +{"event": "inverse", "scored": 180, "seconds": 1.5060114270017948} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 119.83842516700679} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 0.511199229003978, "total_seconds": 141.46739678599988} +{"event": "measured", "exit_code": 0, "wall_seconds": 143.5, "user_seconds": 260.4, "system_seconds": 10.6, "max_rss_gib": 2.56} +{"event": "replay_checked", "exit_code": 0, "package_files": 1472, "package_unchanged": true, "processes_left": 0, "rankings": 180} diff --git a/shared/package-files/c5/c5f1121fbe920c92dca0d11bcd26a501654189c26c8a9d3aad39116eb5e55a7d/replay-5Ms-I9b+I13-L-ion-compare.log b/shared/package-files/c5/c5f1121fbe920c92dca0d11bcd26a501654189c26c8a9d3aad39116eb5e55a7d/replay-5Ms-I9b+I13-L-ion-compare.log new file mode 100644 index 0000000000000000000000000000000000000000..e5282ce26ce751bb59096c3069ac393b5dd8aca7 --- /dev/null +++ b/shared/package-files/c5/c5f1121fbe920c92dca0d11bcd26a501654189c26c8a9d3aad39116eb5e55a7d/replay-5Ms-I9b+I13-L-ion-compare.log @@ -0,0 +1,6 @@ +== tiny +{"a": 180, "b": 19429, "common": 180, "same_top1": 180, "same_top5": 180, "same_ranking": 96, "differing": 84, "first_difference_min": 29, "first_difference_median": 81.0, "top5_differing_queries": []} +== edge +{"a": 204, "b": 19429, "common": 180, "same_top1": 177, "same_top5": 157, "same_ranking": 76, "differing": 104, "first_difference_min": 1, "first_difference_median": 48.0, "top5_differing_queries": ["MassSpecGymID0023401", "MassSpecGymID0023402", "MassSpecGymID0023405", "MassSpecGymID0023407", "Mass +== sub +{"a": 2147, "b": 19429, "common": 2147, "same_top1": 2147, "same_top5": 2147, "same_ranking": 1896, "differing": 251, "first_difference_min": 8, "first_difference_median": 118, "top5_differing_queries": []} diff --git a/shared/package-files/c7/c71bf11c24f6d4644cead782bcb80e5193f1d6a55c591aa35b539ad00c1a01ca/corpus2.manifest.json b/shared/package-files/c7/c71bf11c24f6d4644cead782bcb80e5193f1d6a55c591aa35b539ad00c1a01ca/corpus2.manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..9d12c1cfd0448678e787e7da0b9f0a986eecb586 --- /dev/null +++ b/shared/package-files/c7/c71bf11c24f6d4644cead782bcb80e5193f1d6a55c591aa35b539ad00c1a01ca/corpus2.manifest.json @@ -0,0 +1,55 @@ +{ + "schema": "allcond-inverse-selfsim/v1", + "merged": [ + "inv/selfsim/sub75.npz", + "inv/selfsim/sub25.npz" + ], + "parts": [ + { + "name": "sub75", + "source": "synth", + "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 651127, + "failed": 0, + "rows": 651127, + "seconds": 635.7592854518443, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 651083, + "without_peak": 44, + "mean_annotated_peaks": 15.61580167198345, + "mean_candidates": 20.62178653319552, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 25.62758301384747 + }, + { + "name": "sub25", + "source": "synth", + "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", + "bundle": "builds/5Ms-I1+I3x2-L", + "members": "1,3", + "structures": 435076, + "tasks": 217012, + "failed": 0, + "rows": 217012, + "seconds": 227.74617605702952, + "schema": "allcond-inverse-selfsim/v1", + "floor": 0.02, + "spectra": 217000, + "without_peak": 12, + "mean_annotated_peaks": 15.62026728110599, + "mean_candidates": 20.61567563084069, + "ppm": 20.0, + "floor_da": 0.004, + "max_peaks": 24, + "annotate_seconds": 10.8742212112993 + } + ], + "spectra": 868083, + "structures": 434944 +} diff --git a/shared/package-files/c7/c726e750d79eb02bee608f5ddbe5760dd0dd182fd57c66aa25f65df1bfb34524/validation.jsonl b/shared/package-files/c7/c726e750d79eb02bee608f5ddbe5760dd0dd182fd57c66aa25f65df1bfb34524/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..48133b3e20ca096266d0822dd8220bcf8417d5dd --- /dev/null +++ b/shared/package-files/c7/c726e750d79eb02bee608f5ddbe5760dd0dd182fd57c66aa25f65df1bfb34524/validation.jsonl @@ -0,0 +1,10 @@ +{"step": 5000, "elapsed": 151.00557545910124, "val_loss": 0.03534691064661717, "val_cos": 0.6487005898278668, "val_loss_ema": 0.0337743482806187, "val_cos_ema": 0.6620741028432048} +{"step": 10000, "elapsed": 283.40176780102775, "val_loss": 0.030395358593810314, "val_cos": 0.7026839786651076, "val_loss_ema": 0.028747913577159143, "val_cos_ema": 0.716240550027504, "ind_cos": 0.43934324978125483, "agg_cos": 0.46785732667661745, "ind_nll": 0.2882804055792887, "agg_nll": 0.27170724175202016, "retrieval_seconds": 12.520354838925414} +{"step": 15000, "elapsed": 403.42947550606914, "val_loss": 0.02750924452192116, "val_cos": 0.732525467326548, "val_loss_ema": 0.02653670150220434, "val_cos_ema": 0.7410338981636664} +{"step": 20000, "elapsed": 504.34144732903223, "val_loss": 0.026206592455950393, "val_cos": 0.746940947749659, "val_loss_ema": 0.02517344112397222, "val_cos_ema": 0.7567181081397332, "ind_cos": 0.518297390498739, "agg_cos": 0.5548407020433372, "ind_nll": 0.40177054917906224, "agg_nll": 0.39235163930207423, "retrieval_seconds": 11.32653521001339} +{"step": 25000, "elapsed": 615.5103161340812, "val_loss": 0.02529357237886785, "val_cos": 0.7582650315933978, "val_loss_ema": 0.02445412457673412, "val_cos_ema": 0.7655488262150008} +{"step": 30000, "elapsed": 751.3598122720141, "val_loss": 0.024347838067475848, "val_cos": 0.768878658553258, "val_loss_ema": 0.02406346140816402, "val_cos_ema": 0.7719602286892339, "ind_cos": 0.5451644449019507, "agg_cos": 0.5734211745329147, "ind_nll": 0.4392403108754954, "agg_nll": 0.4354315713623964, "retrieval_seconds": 13.833086180966347} +{"step": 35000, "elapsed": 879.3827004210325, "val_loss": 0.02420593737647834, "val_cos": 0.7713175516463792, "val_loss_ema": 0.02357340327771449, "val_cos_ema": 0.7770265770360993} +{"step": 40000, "elapsed": 980.7470724279992, "val_loss": 0.023832665253510178, "val_cos": 0.7758750485541909, "val_loss_ema": 0.023472262457165754, "val_cos_ema": 0.7788119613802177, "ind_cos": 0.5526275155695095, "agg_cos": 0.5817077564465489, "ind_nll": 0.4579237222708323, "agg_nll": 0.4428946420299552, "retrieval_seconds": 11.548225487000309} +{"step": 45000, "elapsed": 1093.3165971450508, "val_loss": 0.023565148539069235, "val_cos": 0.7788497718254607, "val_loss_ema": 0.023284549861371753, "val_cos_ema": 0.7809753496504902} +{"step": 50000, "elapsed": 1234.6558678090805, "val_loss": 0.023378890432818895, "val_cos": 0.7806081271673465, "val_loss_ema": 0.023333811663005667, "val_cos_ema": 0.7807247753438803, "ind_cos": 0.5531422100983067, "agg_cos": 0.5820165731638273, "ind_nll": 0.46404858716351843, "agg_nll": 0.4514385712079881, "retrieval_seconds": 11.417422970989719} diff --git a/shared/package-files/c7/c7e7412affa058720b1b69c1f35541cacb93db39ca1a9ceeb740f9e95422424e/swap-prepare-N5-recur-mof-5.log b/shared/package-files/c7/c7e7412affa058720b1b69c1f35541cacb93db39ca1a9ceeb740f9e95422424e/swap-prepare-N5-recur-mof-5.log new file mode 100644 index 0000000000000000000000000000000000000000..857f84e58f1766b745a00868be27a4f50b5437d6 --- /dev/null +++ b/shared/package-files/c7/c7e7412affa058720b1b69c1f35541cacb93db39ca1a9ceeb740f9e95422424e/swap-prepare-N5-recur-mof-5.log @@ -0,0 +1 @@ +wrote /workspace/research/evals/fullfold/swap-N5-recur-mof-5/pred 19429 diff --git a/shared/package-files/c7/c7fd095963cc713d939563f94ba100875b666c7d8df20629ece7a482f8d1be56/structure_curve.sh b/shared/package-files/c7/c7fd095963cc713d939563f94ba100875b666c7d8df20629ece7a482f8d1be56/structure_curve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9a0b45b05ab3f0c57d1703554a82bdf4e4c484b --- /dev/null +++ b/shared/package-files/c7/c7fd095963cc713d939563f94ba100875b666c7d8df20629ece7a482f8d1be56/structure_curve.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# E59: learning curve of the inverse model in the number of synthetic structures (I3 recipe, 50k steps, seed 1) +cd /workspace/research +for frac in 0.25 0.5 0.125; do + name=I7-ff512x6-real08-struct$frac + CUDA_MPS_PIPE_DIRECTORY=/tmp/mps taskset -c 0-7 /opt/glacier/bin/python allcond/inv/train_inv.py --out runs/$name --real-frac 0.08 --synth-structures $frac --steps 50000 --seed 1 > logs/$name.log 2>&1 +done +echo finished at $(date -u +%H:%M:%S) >> logs/structure-curve.done diff --git a/shared/package-files/ce/ce191753555a4332bd8305c7e717bf5ca1e8549cd6295ff94ffe6bd1730c0874/eval-score-I25.log b/shared/package-files/ce/ce191753555a4332bd8305c7e717bf5ca1e8549cd6295ff94ffe6bd1730c0874/eval-score-I25.log new file mode 100644 index 0000000000000000000000000000000000000000..ef5d444f92fbb309d9e360aff474ae6c6da08bd0 --- /dev/null +++ b/shared/package-files/ce/ce191753555a4332bd8305c7e717bf5ca1e8549cd6295ff94ffe6bd1730c0874/eval-score-I25.log @@ -0,0 +1,41 @@ +19429 queries, 1 members, 38.3 s +cos pool rule all=0.6039 dom=0.8043 non=0.4028 h5=0.7292 macro=0.6970 +cen pool rule all=0.5826 dom=0.7862 non=0.3781 h5=0.7262 macro=0.6731 +cos_pm pool rule all=0.6039 dom=0.8043 non=0.4028 h5=0.7292 macro=0.6970 +dot pool rule all=0.5609 dom=0.7662 non=0.3547 h5=0.7129 macro=0.6790 +geo pool rule all=0.5821 dom=0.7974 non=0.3659 h5=0.7244 macro=0.6893 +idf05 pool rule all=0.6053 dom=0.8098 non=0.3999 h5=0.7340 macro=0.7047 +idf1 pool rule all=0.6078 dom=0.8112 non=0.4035 h5=0.7401 macro=0.7050 +lin pool rule all=0.5593 dom=0.7566 non=0.3612 h5=0.6922 macro=0.6542 +log01 pool rule all=0.6008 dom=0.7889 non=0.4120 h5=0.7561 macro=0.6884 +log05 pool rule all=0.6059 dom=0.8113 non=0.3998 h5=0.7329 macro=0.7058 +log20 pool rule all=0.6044 dom=0.8114 non=0.3965 h5=0.7255 macro=0.7053 +nll02 pool rule all=0.4429 dom=0.6778 non=0.2071 h5=0.6145 macro=0.5594 +nll10 pool rule all=0.4118 dom=0.6334 non=0.1893 h5=0.5755 macro=0.5112 +poolcen pool rule all=0.5771 dom=0.7787 non=0.3746 h5=0.7265 macro=0.6725 +pow020 pool rule all=0.5352 dom=0.7533 non=0.3161 h5=0.7354 macro=0.6548 +pow030 pool rule all=0.5512 dom=0.7714 non=0.3301 h5=0.7508 macro=0.6689 +pow040 pool rule all=0.5740 dom=0.7898 non=0.3573 h5=0.7322 macro=0.6893 +pow05 pool rule all=0.5928 dom=0.7990 non=0.3858 h5=0.7383 macro=0.6988 +pow05idf025 pool rule all=0.5964 dom=0.8004 non=0.3916 h5=0.7462 macro=0.7005 +pow05idf05 pool rule all=0.5991 dom=0.8021 non=0.3952 h5=0.7487 macro=0.7026 +pow05m pool rule all=0.5928 dom=0.7990 non=0.3858 h5=0.7383 macro=0.6988 +pow05s pool rule all=0.6012 dom=0.8088 non=0.3927 h5=0.7336 macro=0.6985 +pow060 pool rule all=0.6046 dom=0.8058 non=0.4025 h5=0.7310 macro=0.7044 +pow060idf025 pool rule all=0.6058 dom=0.8096 non=0.4012 h5=0.7364 macro=0.7073 +pow060idf050 pool rule all=0.6089 dom=0.8099 non=0.4070 h5=0.7430 macro=0.7079 +pow060m pool rule all=0.6046 dom=0.8058 non=0.4025 h5=0.7310 macro=0.7044 +pow065 pool rule all=0.6082 dom=0.8095 non=0.4061 h5=0.7269 macro=0.7047 +pow070 pool rule all=0.6052 dom=0.8092 non=0.4004 h5=0.7280 macro=0.7044 +pow070idf025 pool rule all=0.6071 dom=0.8133 non=0.4001 h5=0.7335 macro=0.7079 +pow070idf050 pool rule all=0.6065 dom=0.8112 non=0.4010 h5=0.7373 macro=0.7085 +pow070m pool rule all=0.6052 dom=0.8092 non=0.4004 h5=0.7280 macro=0.7044 +pow075 pool rule all=0.6045 dom=0.8082 non=0.3999 h5=0.7278 macro=0.7026 +pow080 pool rule all=0.6052 dom=0.8094 non=0.4001 h5=0.7272 macro=0.7023 +pow080m pool rule all=0.6052 dom=0.8094 non=0.4001 h5=0.7272 macro=0.7023 +pow085 pool rule all=0.6033 dom=0.8061 non=0.3997 h5=0.7297 macro=0.6994 +pow085idf025 pool rule all=0.6041 dom=0.8082 non=0.3992 h5=0.7315 macro=0.7023 +pow085idf050 pool rule all=0.6065 dom=0.8111 non=0.4010 h5=0.7339 macro=0.7079 +pow090 pool rule all=0.6025 dom=0.8062 non=0.3979 h5=0.7313 macro=0.6979 +pow2 pool rule all=0.5707 dom=0.7776 non=0.3630 h5=0.6956 macro=0.6713 +tani pool rule all=0.5685 dom=0.7733 non=0.3629 h5=0.7150 macro=0.6748 diff --git a/shared/package-files/ce/ce87bd2be1ab11e7373fc6996014b0329f1b98af5a9c910e9902492ecfa4dc61/make_edge_root.py b/shared/package-files/ce/ce87bd2be1ab11e7373fc6996014b0329f1b98af5a9c910e9902492ecfa4dc61/make_edge_root.py new file mode 100644 index 0000000000000000000000000000000000000000..9777c6f0aae26be3e63266405bfdb2e3b2020a19 --- /dev/null +++ b/shared/package-files/ce/ce87bd2be1ab11e7373fc6996014b0329f1b98af5a9c910e9902492ecfa4dc61/make_edge_root.py @@ -0,0 +1,104 @@ +"""Robustness input: the tiny validation subset with deliberately odd queries and candidates. + +make_edge_root.py SOURCE_ROOT OUT_ROOT + +No labels are read. The released package must write one complete ranking (a permutation of the +pool's candidate ids) for every query of this input without crashing. `check` verifies that. + +make_edge_root.py check OUT_ROOT RANKINGS.jsonl +""" +import copy +import hashlib +import json +import sys +from pathlib import Path + + +def read(path): + return [json.loads(line) for line in open(path)] + + +def write(path, rows): + with open(path, 'w') as stream: + for row in rows: + stream.write(json.dumps(row, separators=(',', ':')) + '\n') + + +def check(root, rankings): + queries = read(Path(root) / 'queries.jsonl') + pools = {p['candidate_pool_id']: [c['candidate_id'] for c in p['candidates']] for p in read(Path(root) / 'candidate_pools.jsonl')} + ranked = {r['query_id']: r['ranking'] for r in read(rankings)} + bad = 0 + for q in queries: + got = ranked.get(q['query_id']) + if got is None or sorted(got) != sorted(pools[q['candidate_pool_id']]): + bad += 1 + print('BAD', q['query_id'], q.get('note')) + print(f'queries {len(queries)} rankings {len(ranked)} incomplete {bad}') + return bad + + +def main(): + if sys.argv[1] == 'check': + sys.exit(1 if check(sys.argv[2], sys.argv[3]) else 0) + source, out = Path(sys.argv[1]), Path(sys.argv[2]) + queries, pools = read(source / 'queries.jsonl'), read(source / 'candidate_pools.jsonl') + by_pool = {p['candidate_pool_id']: p for p in pools} + extra_queries, extra_pools = [], [] + + def clone(index, note, pool_edit=None, **changes): + q = copy.deepcopy(queries[index]) + q['query_id'] = hashlib.sha256(f'edge-{note}'.encode()).hexdigest() + q.update(changes) + if pool_edit is not None: + pool = copy.deepcopy(by_pool[q['candidate_pool_id']]) + pool['candidate_pool_id'] = hashlib.sha256(f'edge-pool-{note}'.encode()).hexdigest() + pool_edit(pool['candidates']) + q['candidate_pool_id'] = pool['candidate_pool_id'] + extra_pools.append(pool) + extra_queries.append(q) + + def cand(smiles): + return {'candidate_id': hashlib.sha256(smiles.encode()).hexdigest(), 'smiles': smiles} + + clone(0, 'no-peaks', mzs=[], intensities=[]) + clone(1, 'zero-intensities', intensities=[0.0] * len(queries[1]['mzs'])) + clone(2, 'one-peak', mzs=[91.0542], intensities=[1.0]) + clone(3, 'peaks-above-precursor', mzs=[queries[3]['precursor_mz'] + 5.0, queries[3]['precursor_mz'] + 9.0], intensities=[1.0, 0.5]) + clone(4, 'unknown-adduct', adduct='[M+K]+') + clone(5, 'ammonium-adduct', adduct='[M+NH4]+') + clone(6, 'negative-adduct', adduct='[M-H]-') + clone(7, 'instrument-none', instrument_type=None) + clone(8, 'instrument-unknown', instrument_type='FT-ICR') + clone(9, 'energy-none', collision_energy=None) + clone(10, 'energy-zero', collision_energy=0.0) + clone(11, 'energy-huge', collision_energy=400.0) + clone(12, 'energy-fraction', collision_energy=17.3) + clone(13, 'precursor-huge', precursor_mz=1830.52, mzs=[150.1, 900.4, 1620.7, 1700.2], intensities=[0.2, 1.0, 0.4, 0.1]) + clone(14, 'precursor-tiny', precursor_mz=45.03, mzs=[18.03, 27.02, 44.9], intensities=[1.0, 0.3, 0.2]) + clone(15, 'many-peaks', mzs=[50.0 + 0.37 * i for i in range(900)], intensities=[((i * 37) % 101 + 1) / 101 for i in range(900)]) + clone(16, 'unsorted-duplicate-peaks', mzs=[200.1, 100.05, 200.1, 150.07], intensities=[0.5, 1.0, 0.5, 0.2]) + clone(17, 'single-candidate', pool_edit=lambda c: c.__delitem__(slice(1, None))) + clone(18, 'two-candidates', pool_edit=lambda c: c.__delitem__(slice(2, None))) + clone(19, 'odd-candidates', pool_edit=lambda c: c.extend([ + cand('not a smiles'), cand(''), cand('[Na+].[Cl-]'), cand('C[Se]C'), cand('c1ccccc1[Hg]Cl'), cand('[Fe+2]'), + cand('CC(=O)O.CCN'), cand('C[N+](C)(C)C'), cand('[O-]C(=O)c1ccccc1'), cand('C' * 180), cand('[2H]C([2H])([2H])O'), + cand('N[C@@H](C)C(=O)' + 'N[C@@H](C)C(=O)' * 40 + 'O'), cand('C1CC1' * 1), cand('[13CH3]O'), cand('B(O)(O)c1ccccc1'), + cand('C[Si](C)(C)O'), cand('FC(F)(F)S(=O)(=O)O'), cand('[H][H]'), cand('C')])) + clone(20, 'all-odd-candidates', pool_edit=lambda c: (c.clear(), c.extend([cand('not a smiles'), cand('[Na+].[Cl-]'), cand('[Fe+2]')]))) + clone(21, 'sodium-no-peaks', adduct='[M+Na]+', mzs=[], intensities=[]) + clone(22, 'int-typed-values', collision_energy=30, precursor_mz=int(round(queries[22]['precursor_mz']))) + clone(23, 'energy-none-unknown-instrument-sodium', adduct='[M+Na]+', collision_energy=None, instrument_type=None) + out.mkdir(parents=True, exist_ok=True) + notes = {} + for q, note in zip(extra_queries, [None] * len(extra_queries)): + pass + write(out / 'queries.jsonl', queries + extra_queries) + write(out / 'candidate_pools.jsonl', pools + extra_pools) + json.dump({'schema': 'development-robustness-input', 'queries': len(queries) + len(extra_queries), + 'pools': len(pools) + len(extra_pools), 'edge_queries': len(extra_queries)}, open(out / 'manifest.json', 'w'), indent=2) + print('queries', len(queries) + len(extra_queries), 'pools', len(pools) + len(extra_pools)) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/ce/ced1c3e2fc94989d2ff07b4491caea365a91c6e68429e90b2732ad471fb6e329/publish.py b/shared/package-files/ce/ced1c3e2fc94989d2ff07b4491caea365a91c6e68429e90b2732ad471fb6e329/publish.py new file mode 100644 index 0000000000000000000000000000000000000000..362be9385cf87596294033945846f7615a24f1ec --- /dev/null +++ b/shared/package-files/ce/ced1c3e2fc94989d2ff07b4491caea365a91c6e68429e90b2732ad471fb6e329/publish.py @@ -0,0 +1,205 @@ +#!/usr/bin/env python3 +"""Build, release and document the GLACIER all-condition retrieval package. + +``build`` assembles one complete, standalone package directory (used for the + relocated validation replay). +``release`` copies a validated build byte-for-byte into a new immutable + generation of the submission and switches the manifest atomically. +``records`` copies EXPERIMENTS.md and research records (file-by-file, each + file replaced atomically) into the submission root. +""" + +import argparse +import hashlib +import json +import os +from pathlib import Path +import shutil +import sys + +HERE = Path(__file__).resolve().parent +RESEARCH = HERE.parent + + +def sha256(path): + h = hashlib.sha256() + with Path(path).open('rb') as f: + for block in iter(lambda: f.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + + +INFER_SH = '''#!/usr/bin/env bash +set -euo pipefail +package_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +scratch="$(mktemp -d)" +trap 'rm -rf "$scratch"' EXIT +export PYTHONDONTWRITEBYTECODE=1 DGLBACKEND=pytorch MPLCONFIGDIR="$scratch/mpl" NUMBA_CACHE_DIR="$scratch/numba" +if [ ! -w "${HOME:-/nonexistent}" ]; then export HOME="$scratch"; fi +"${MASSSPECGYM_GLACIER_PYTHON:-/opt/glacier/bin/python}" "$package_root/infer.py" "$@" +''' + + +ROOT_INFER_SH = '''#!/usr/bin/env bash +set -euo pipefail +root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +for candidate in python3 "${MASSSPECGYM_GLACIER_PYTHON:-/opt/glacier/bin/python}" /opt/conda/bin/python3; do + if command -v "$candidate" >/dev/null 2>&1; then exec "$candidate" "$root/dispatch.py" "$@"; fi +done +echo "infer.sh: no Python interpreter found" >&2 +exit 1 +''' + + +def build(args): + import torch + out = args.output.resolve() + if out.exists(): + raise FileExistsError(out) + out.mkdir(parents=True) + members, provenance = [], [] + for path in args.checkpoint: + saved = torch.load(path, map_location='cpu', weights_only=False) + training = saved['task_training'] + if training.get('pretrained_assets') != [] or not str(training.get('initialization', '')).startswith(('random', 'own-checkpoint:')): + raise ValueError(f'{path}: not a train-fold, scratch-initialized checkpoint') + digest = sha256(path) + members.append({'state_dict': saved['state_dict'], 'hyper_parameters': saved['hyper_parameters'], + 'global_step': saved['global_step'], 'weights': saved['weights'], + 'task_training': training, 'source_checkpoint_sha256': digest}) + provenance.append({'source': str(path), 'sha256': digest, 'global_step': saved['global_step'], + 'weights': saved['weights'], 'subset': training.get('subset'), 'seed': training.get('seed'), + 'elapsed_seconds': training.get('elapsed_seconds'), + 'data_manifest_sha256': training.get('data_manifest_sha256')}) + torch.save({'format': 'glacier-members/v1', 'members': members}, out / 'model.pt') + config = json.loads((HERE / 'pkg' / 'model_config.json').read_text()) + for item in args.set: + key, value = item.split('=', 1) + config[key] = json.loads(value) + config['checkpoint'] = 'model.pt' + config['method'] = 'native-glacier-all-conditions-forward-simulation' + config['inference_runtime'] = '/opt/glacier/bin/python' + config['members'] = provenance + (out / 'model_config.json').write_text(json.dumps(config, indent=2) + '\n') + manifest = {'schema': 'massspecgym-retrieval-model/v1', + 'checkpoint': {'path': 'model.pt', 'sha256': sha256(out / 'model.pt'), 'format': 'pytorch'}, + 'model_config': 'model_config.json', + 'training_provenance': {'data': 'MassSpecGym v1.5 train fold', 'pretrained_assets': []}} + (out / 'model_manifest.json').write_text(json.dumps(manifest, indent=2) + '\n') + for name in ['infer.py', 'fastfeat.py']: + shutil.copyfile(HERE / 'pkg' / name, out / name) + (out / 'infer.sh').write_text(INFER_SH) + (out / 'infer.sh').chmod(0o755) + source_root = args.source_root.resolve() + shutil.copytree(source_root / 'src' / 'ms_pred', out / 'vendor' / 'ms_pred', + ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + shutil.copyfile(source_root / 'LICENSE', out / 'LICENSE.ms-pred') + shutil.copytree(HERE, out / 'training', ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + readme = args.readme.read_text() if args.readme else '# GLACIER all-condition retrieval package\n' + (out / 'README.md').write_text(readme) + for path in [out, *out.rglob('*')]: + path.chmod(0o755 if path.is_dir() or path.stat().st_mode & 0o111 else 0o644) + print(json.dumps({'built': str(out), 'checkpoint_sha256': manifest['checkpoint']['sha256'], + 'members': provenance, 'config': {k: v for k, v in config.items() if k != 'members'}}, indent=2)) + + +def release(args): + sys.path.insert(0, str(RESEARCH / 'starter')) + from publication import publish_directory + source = args.source.resolve() + manifest = json.loads((source / 'model_manifest.json').read_text()) + if sha256(source / manifest['checkpoint']['path']) != manifest['checkpoint']['sha256']: + raise ValueError('staged checkpoint hash mismatch') + if args.readme: + readme = args.readme.read_text() + + def copy(stage): + shutil.copytree(source, stage, dirs_exist_ok=True) + if args.readme: + (stage / 'README.md').write_text(readme) + + destination = args.output_dir.resolve() + publish_directory(destination, copy) + # The stock root launcher needs `python3` on PATH; fall back to the documented runtimes. + temporary = destination / '.infer.sh.tmp' + temporary.write_text(ROOT_INFER_SH) + temporary.chmod(0o755) + os.replace(temporary, destination / 'infer.sh') + current = json.loads((destination / 'model_manifest.json').read_text()) + selected = Path(current['model_config']).parts[1] + # Keep the selected generation and its predecessor; older ones are unreferenced. + generations = sorted((p for p in (destination / '.versions').iterdir() if p.is_dir()), + key=lambda p: p.stat().st_mtime, reverse=True) + keep = {selected} + for path in generations: + if path.name != selected and len(keep) < 2: + keep.add(path.name) + for path in generations: + if path.name not in keep: + shutil.rmtree(path, ignore_errors=True) + print(json.dumps({'released': selected, 'checkpoint_sha256': current['checkpoint']['sha256'], 'kept': sorted(keep)})) + + +def records(args): + destination = args.output_dir.resolve() + + def put(source, relative): + target = destination / relative + target.parent.mkdir(parents=True, exist_ok=True) + target.parent.chmod(0o755) + if target.exists() and target.stat().st_size == source.stat().st_size and target.stat().st_mtime >= source.stat().st_mtime: + return + temporary = target.with_name(target.name + '.tmp') + shutil.copyfile(source, temporary) + temporary.chmod(0o644) + os.replace(temporary, target) + + put(RESEARCH / 'EXPERIMENTS.md', 'EXPERIMENTS.md') + skip = {'__pycache__'} + for path in sorted(HERE.rglob('*')): + if path.is_file() and not (set(path.parts) & skip) and path.suffix != '.pyc': + put(path, Path('research') / 'source' / path.relative_to(HERE)) + for run in sorted((RESEARCH / 'runs').iterdir()): + for name in ['recipe.json', 'metrics.jsonl', 'validation.jsonl', 'result.json']: + if (run / name).is_file(): + put(run / name, Path('research') / 'runs' / run.name / name) + if (run / 'training-source').is_dir(): + for path in sorted((run / 'training-source').rglob('*')): + if path.is_file() and not (set(path.parts) & skip): + put(path, Path('research') / 'runs' / run.name / 'training-source' / path.relative_to(run / 'training-source')) + for path in sorted((RESEARCH / 'logs').glob('*')): + if path.is_file() and path.stat().st_size < 50 * 1024 * 1024: + put(path, Path('research') / 'logs' / path.name) + for path in sorted((RESEARCH / 'evals').glob('*/report*.json')) + sorted((RESEARCH / 'evals').glob('*/*.log')) \ + + sorted((RESEARCH / 'evals').glob('*/summary*.json')): + put(path, Path('research') / 'evals' / path.parent.name / path.name) + for name in ['manifest.json', 'preparation.json']: + if (RESEARCH / 'prep_all' / name).is_file(): + put(RESEARCH / 'prep_all' / name, Path('research') / 'prep_all' / name) + for path in [destination / 'research', *(destination / 'research').rglob('*')]: + if path.is_dir(): + path.chmod(0o755) + print(json.dumps({'records': str(destination / 'research')})) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + sub = parser.add_subparsers(dest='command', required=True) + b = sub.add_parser('build') + b.add_argument('--checkpoint', type=Path, action='append', required=True) + b.add_argument('--set', action='append', default=[]) + b.add_argument('--output', type=Path, required=True) + b.add_argument('--source-root', type=Path, default=RESEARCH / 'ms-pred') + b.add_argument('--readme', type=Path) + r = sub.add_parser('release') + r.add_argument('--source', type=Path, required=True) + r.add_argument('--output-dir', type=Path, default=Path('/workspace/submission')) + r.add_argument('--readme', type=Path) + c = sub.add_parser('records') + c.add_argument('--output-dir', type=Path, default=Path('/workspace/submission')) + args = parser.parse_args() + {'build': build, 'release': release, 'records': records}[args.command](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/ce/cef98e17aa9debaf6027393280b4f4a62f0aedd0c0cf3e6c7324ffbabe55f14b/train_set.py b/shared/package-files/ce/cef98e17aa9debaf6027393280b4f4a62f0aedd0c0cf3e6c7324ffbabe55f14b/train_set.py new file mode 100644 index 0000000000000000000000000000000000000000..3519f9ca84a2fa239533f1685170500b36852ebc --- /dev/null +++ b/shared/package-files/ce/cef98e17aa9debaf6027393280b4f4a62f0aedd0c0cf3e6c7324ffbabe55f14b/train_set.py @@ -0,0 +1,249 @@ +#!/usr/bin/env python3 +"""Train the set-level inverse model (``pkg/inverse.SetFormer``). + +One training item = a random subset of the spectra of one training structure (experimental +train fold, grouped by fingerprint + formula; synthetic corpus, grouped by structure), merged +into one annotated peak list (``inverse.merge_sets``), target = Morgan-4096 of the structure. +At inference all queries sharing a candidate pool are merged the same way under every +candidate formula. Validation labels are only used to report retrieval. +""" +import argparse +import copy +import json +import math +import sys +import time +from pathlib import Path + +import numpy as np +import torch +import torch.nn.functional as F + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +sys.path.insert(0, str(HERE)) +import inverse +import invdata +from train_inv import targets_of +from invrun import SetPools + + +class Grouped: + """Padded store whose rows are grouped by structure.""" + + def __init__(self, path, device, by_fingerprint): + self.data = invdata.load_padded(path, device) + mol = self.data['mol'].cpu().numpy() + if by_fingerprint: # same fingerprint and formula = same training structure + fps = self.data['fps'].cpu().numpy() + root = self.data['root'].cpu().numpy() + first = np.zeros(len(fps), dtype=np.int64) + first[mol[::-1]] = np.arange(len(mol))[::-1] + key = np.concatenate([fps, root[first].astype(np.int16).view(np.uint8).reshape(len(fps), -1)], axis=1) + _, group_of_mol = np.unique(key, axis=0, return_inverse=True) + group = group_of_mol.reshape(-1)[mol] + else: + group = mol + order = np.argsort(group, kind='stable') + count = np.bincount(group) + start = np.concatenate([[0], np.cumsum(count)[:-1]]) + self.group = torch.from_numpy(group).to(device) + self.rows = torch.from_numpy(order).to(device) + self.start = torch.from_numpy(start).to(device) + self.size = torch.from_numpy(count).to(device) + self.groups = len(count) + self.n = len(group) + + def sample(self, anchors, max_set, single, augment, gen): + d, device = self.data, anchors.device + b = anchors.shape[0] + rand = lambda *shape: torch.rand(*shape, device=device, generator=gen) + g = self.group[anchors] + n = self.size[g] + members = torch.ceil(n.clamp(max=max_set).float() ** rand(b)).long().clamp(min=1) # log-uniform set size + members = torch.where(rand(b) < single, torch.ones_like(members), members) + pick = self.start[g].unsqueeze(1) + torch.minimum((rand(b, max_set) * n.unsqueeze(1)).long(), (n - 1).unsqueeze(1)) + rows = self.rows[pick] + rows[:, 0] = anchors + use = torch.arange(max_set, device=device).unsqueeze(0) < members.unsqueeze(1) + peaks = d['peaks'][rows] # [B, M, K, E] + inten = d['inten'][rows].float() + count = d['count'][rows].long() + k, e = peaks.shape[2], peaks.shape[3] + position = torch.arange(k, device=device).view(1, 1, k) + valid = (position < count.unsqueeze(-1)) & use.unsqueeze(-1) + if augment: + if augment.get('truncate', 0) > 0: + cut = rand(b, max_set) < augment['truncate'] + limit = (augment['min_keep'] + rand(b, max_set) * (k + 1 - augment['min_keep'])).long() + limit = torch.where(cut, limit, torch.full_like(limit, k)) + valid = valid & (position < limit.unsqueeze(-1)) + if augment.get('peak_drop', 0) > 0: + rate = rand(b, max_set, 1) * augment['peak_drop'] + kept = valid & (rand(b, max_set, k) >= rate) + valid = torch.where(kept.flatten(1).any(1).view(b, 1, 1), kept, valid) + if augment.get('jitter', 0) > 0: + inten = (inten * torch.exp(torch.randn(b, max_set, k, device=device, generator=gen) * augment['jitter'])).clamp(max=1.0) + adduct = d['adduct'][rows].long() + spectra = torch.stack([(use & (adduct == 0)).sum(1), (use & (adduct == 1)).sum(1)], dim=1).float() + merged, channels, mask = inverse.merge_sets(peaks.view(b, max_set * k, e).long(), inten.view(b, max_set * k), + adduct.unsqueeze(-1).expand(-1, -1, k).reshape(b, max_set * k), + valid.view(b, max_set * k), spectra) + instrument = d['instrument'][rows].long() + same = ((instrument == instrument[:, :1]) | ~use).all(1) + instrument = torch.where(same, instrument[:, 0], torch.full_like(instrument[:, 0], 2)) + energy = d['energy'][rows].float() + known = use & ~torch.isnan(energy) + energy = (torch.nan_to_num(energy, nan=0.0) * known).sum(1) / known.sum(1) # 0/0 = NaN: none recorded + if augment: + if augment.get('energy_drop', 0) > 0: + energy = torch.where(rand(b) < augment['energy_drop'], torch.full_like(energy, float('nan')), energy) + if augment.get('instrument_drop', 0) > 0: + instrument = torch.where(rand(b) < augment['instrument_drop'], torch.full_like(instrument, 2), instrument) + return (d['root'][anchors].long(), merged, channels, mask, spectra, instrument, energy), d['fps'][d['mol'][anchors]] + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('--store', type=Path, default=Path('/workspace/research/inv')) + p.add_argument('--out', type=Path, required=True) + p.add_argument('--pools', default='pools-validation-input.npz') + p.add_argument('--input', type=Path, default=Path('/workspace/research/validation-input')) + p.add_argument('--steps', type=int, default=100000) + p.add_argument('--batch', type=int, default=512) + p.add_argument('--real-frac', type=float, default=0.2) + p.add_argument('--real-balance', type=float, default=0.5) + p.add_argument('--max-set', type=int, default=32) + p.add_argument('--single', type=float, default=0.25, help='probability of a one-spectrum set') + p.add_argument('--lr', type=float, default=6e-4) + p.add_argument('--weight-decay', type=float, default=1e-4) + p.add_argument('--warmup', type=int, default=2000) + p.add_argument('--ema', type=float, default=0.999) + p.add_argument('--dim', type=int, default=512) + p.add_argument('--layers', type=int, default=6) + p.add_argument('--heads', type=int, default=8) + p.add_argument('--dropout', type=float, default=0.1) + p.add_argument('--peak-drop', type=float, default=0.3) + p.add_argument('--truncate', type=float, default=0.3) + p.add_argument('--min-keep', type=int, default=4) + p.add_argument('--jitter', type=float, default=0.15) + p.add_argument('--synth-energy-drop', type=float, default=0.3) + p.add_argument('--synth-instrument-drop', type=float, default=0.3) + p.add_argument('--cosine-loss', type=float, default=0.0, help='weight of 1 - cos(sigmoid(logits), fingerprint)') + p.add_argument('--validate-every', type=int, default=5000) + p.add_argument('--retrieve-every', type=int, default=10000) + p.add_argument('--retrieve-pools', type=int, default=0) + p.add_argument('--seed', type=int, default=1) + args = p.parse_args() + + torch.manual_seed(args.seed) + np.random.seed(args.seed) + device = torch.device('cuda') + torch.backends.cuda.matmul.allow_tf32 = True + torch.backends.cudnn.allow_tf32 = True + args.out.mkdir(parents=True, exist_ok=True) + started = time.monotonic() + real = Grouped(args.store / 'real-train.npz', device, True) + synth = Grouped(args.store / 'synth.npz', device, False) + real_weight = real.size[real.group].float() ** -args.real_balance + pools = SetPools(args.store / args.pools, device) if args.pools else None + target = targets_of(args.input, args.store / f'targets-{args.input.name}.npy') if pools else None + subset = None if not args.retrieve_pools else list(range(0, len(pools.members), args.retrieve_pools)) + + model = inverse.SetFormer(dim=args.dim, layers=args.layers, heads=args.heads, dropout=args.dropout).to(device) + ema = copy.deepcopy(model).eval() + for q in ema.parameters(): + q.requires_grad_(False) + decay, no_decay = [], [] + for name, q in model.named_parameters(): + (no_decay if q.ndim < 2 else decay).append(q) + opt = torch.optim.AdamW([{'params': decay, 'weight_decay': args.weight_decay}, {'params': no_decay, 'weight_decay': 0.0}], + lr=args.lr, betas=(0.9, 0.98)) + schedule = lambda s: min(1.0, (s + 1) / args.warmup) * (0.02 + 0.98 * 0.5 * (1 + math.cos(math.pi * min(1.0, s / args.steps)))) + step = 0 + last = args.out / 'last.pt' + if last.exists(): + state = torch.load(last, map_location=device) + model.load_state_dict(state['model']) + ema.load_state_dict(state['ema']) + opt.load_state_dict(state['opt']) + step = state['step'] + recipe = {'args': {k: str(v) if isinstance(v, Path) else v for k, v in vars(args).items()}, + 'parameters': sum(q.numel() for q in model.parameters()), 'model': model.config, 'class': 'SetFormer', + 'real_rows': real.n, 'real_groups': real.groups, 'synth_rows': synth.n, 'synth_groups': synth.groups, + 'stores': {f.name: json.loads(f.read_text()).get('sha256') for f in sorted(args.store.glob('*.manifest.json'))}, + 'gpu': torch.cuda.get_device_name(0), 'load_seconds': time.monotonic() - started} + (args.out / 'recipe.json').write_text(json.dumps(recipe, indent=1) + '\n') + print(json.dumps(recipe), flush=True) + + gen = torch.Generator(device=device) + gen.manual_seed(args.seed * 1000003 + step) + n_real = max(1, round(args.batch * args.real_frac)) + n_synth = args.batch - n_real + aug_real = dict(peak_drop=args.peak_drop, truncate=args.truncate, min_keep=args.min_keep, jitter=args.jitter) + aug_synth = dict(aug_real, energy_drop=args.synth_energy_drop, instrument_drop=args.synth_instrument_drop) + + def checkpoint(path, full): + state = {'ema': ema.state_dict(), 'config': model.config, 'class': 'SetFormer', 'step': step} + if full: + state.update(model=model.state_dict(), opt=opt.state_dict()) + tmp = path.with_suffix('.tmp') + torch.save(state, tmp) + tmp.replace(path) + + log = (args.out / 'metrics.jsonl').open('a') + run_started, run_step, window = time.monotonic(), step, [] + model.train() + while step < args.steps: + for group in opt.param_groups: + group['lr'] = args.lr * schedule(step) + anchors = torch.multinomial(real_weight, n_real, replacement=True, generator=gen) + a_in, a_fp = real.sample(anchors, args.max_set, args.single, aug_real, gen) + anchors = torch.randint(0, synth.n, (n_synth,), device=device, generator=gen) + b_in, b_fp = synth.sample(anchors, args.max_set, args.single, aug_synth, gen) + inputs = [torch.cat(x) for x in zip(a_in, b_in)] + bits = inverse.unpack_bits(torch.cat([a_fp, b_fp])) + with torch.autocast('cuda', dtype=torch.bfloat16): + logits = model(*inputs) + logits = logits.float() + per = F.binary_cross_entropy_with_logits(logits, bits, reduction='none').mean(1) + loss = per.mean() + if args.cosine_loss > 0: + loss = loss + args.cosine_loss * (1 - F.cosine_similarity(torch.sigmoid(logits), bits, dim=-1)).mean() + opt.zero_grad(set_to_none=True) + loss.backward() + torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) + opt.step() + step += 1 + with torch.no_grad(): + d = min(args.ema, (1 + step) / (10 + step)) + for a, b in zip(ema.parameters(), model.parameters()): + a.lerp_(b, 1 - d) + window.append((loss.item(), per[:n_real].mean().item(), per[n_real:].mean().item())) + if step % 200 == 0: + w = np.mean(window, axis=0) + window = [] + log.write(json.dumps({'step': step, 'loss': float(w[0]), 'bce_real': float(w[1]), 'bce_synth': float(w[2]), + 'lr': opt.param_groups[0]['lr'], 'elapsed': time.monotonic() - started, + 'steps_per_second': (step - run_step) / (time.monotonic() - run_started)}) + '\n') + log.flush() + if step % args.validate_every == 0 or step == args.steps: + row = {'step': step, 'elapsed': time.monotonic() - started} + if pools is not None: + tick = time.monotonic() + full = step % args.retrieve_every == 0 or step == args.steps + chosen = subset if full else list(range(0, len(pools.members), 8)) + row.update({('' if full else 'sub_') + k: v for k, v in pools.evaluate(ema, target, chosen).items()}) + row['retrieval_seconds'] = time.monotonic() - tick + if full: + checkpoint(args.out / f'step-{step:07d}-ema.pt', False) + print(json.dumps(row), flush=True) + with (args.out / 'validation.jsonl').open('a') as stream: + stream.write(json.dumps(row) + '\n') + checkpoint(last, True) + model.train() + checkpoint(last, True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/ce/ceffb67c33014f10badc72a7ab430aedd094cd78ff36d2867a5c455f49bd9db0/swap-I18-w-0.75_0.05_0.5.log b/shared/package-files/ce/ceffb67c33014f10badc72a7ab430aedd094cd78ff36d2867a5c455f49bd9db0/swap-I18-w-0.75_0.05_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..0bee2b6d6b6a4b8b45edd27dbc2bfd27599f1c4f --- /dev/null +++ b/shared/package-files/ce/ceffb67c33014f10badc72a7ab430aedd094cd78ff36d2867a5c455f49bd9db0/swap-I18-w-0.75_0.05_0.5.log @@ -0,0 +1,2 @@ +without consensus term: Hit@1 0.7737 (ref 0.7713; +0.0024 [-0.0024, +0.0075]) macro 0.8656 (+0.0065 [+0.0018, +0.0109]) pools +43 -21 cap30 +0.0028 | Hit@5 0.8812 (+0.0015) Hit@20 0.9342 (-0.0035) + domain 0.9340 (+0.0027) other 0.6128 (+0.0022) | Orbitrap no energy 0.5786 (+0.0022) | above 850 0.4218 (+0.0072) below 850 0.8539 (+0.0013) diff --git a/shared/package-files/d0/d04572ec7baff05843efe02f50a19f3fbd0ea16283cfa14ba181b0869ccac372/tolerance_strata.py b/shared/package-files/d0/d04572ec7baff05843efe02f50a19f3fbd0ea16283cfa14ba181b0869ccac372/tolerance_strata.py new file mode 100644 index 0000000000000000000000000000000000000000..72b4e01decea22f7185f878317c421d27613b1e8 --- /dev/null +++ b/shared/package-files/d0/d04572ec7baff05843efe02f50a19f3fbd0ea16283cfa14ba181b0869ccac372/tolerance_strata.py @@ -0,0 +1,160 @@ +"""Matching tolerance by acquisition stratum (lab, E50 b; validation labels: evaluation only). + +tolerance_strata.py INPUT_ROOT STACK_DIR OUT_PREFIX --rules NAME=PPM/FLOOR_MDA[/MERGE_MDA],... + +Observation (error analysis of generation-z3hoccsj): 18.5 of the 25.2 lost points sit in +Orbitrap spectra without a recorded collision energy (8,069 validation queries, per-spectrum +Hit@1 0.20-0.30). Their peak m/z scatter by 10-50 mDa between repeat spectra of one molecule +(541.147 / .152 / .162 / .165; satellite pairs such as 403.321 / 403.334), far outside the +released matching window for Orbitrap spectra (max(10 ppm, 1 mDa)), so the simulators match +almost nothing for any candidate. + +For every rule the script computes the released distance of the mean prediction (`Dmean`) with +the window max(m/z x PPM, FLOOR) for all queries; rule `released` keeps the released +per-instrument windows. With MERGE, observed peaks closer than MERGE mDa are merged first +(intensity-weighted m/z, summed intensity). Output: OUT_PREFIX-NAME.pkl with key `Dmean`, and a +per-stratum table of the forward-only per-spectrum and pool-rule Hit@1. +""" +import argparse +import math +import pickle +import sys +from pathlib import Path + +import numpy as np +import torch + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import scorelab + +EPS = 1e-22 + + +def js(p_obs, q): + unmatched = (1.0 - p_obs.sum(-1)).clamp_min(0) + mix = (p_obs + q) / 2 + value = (-(mix * torch.log(mix + EPS)) + 0.5 * p_obs * torch.log(p_obs + EPS) + 0.5 * q * torch.log(q + EPS)).sum(-1) + return (value + 0.5 * unmatched * math.log(2)) / math.log(2) + + +def observed(query, merge): + """Released observed-peak treatment (window 0.5, power 0.5, 50 strongest), optional merging first.""" + mzs = np.asarray(query['mzs'], dtype=np.float64) + inten = np.asarray(query['intensities'], dtype=np.float64) + precursor = float(query['precursor_mz']) + keep = (mzs <= precursor + 1) & (inten > 0) & (mzs < precursor - 0.5) + mzs, inten = mzs[keep], inten[keep] + if inten.size == 0: + return None + if merge > 0 and len(mzs) > 1: + order = np.argsort(mzs) + mzs, inten = mzs[order], inten[order] + group = np.concatenate([[0], np.cumsum(np.diff(mzs) > merge)]) + total = np.bincount(group, weights=inten) + mzs = np.bincount(group, weights=inten * mzs) / total + inten = total + value = (inten / float(inten.max())) ** 0.5 + strongest = np.argsort(value)[::-1][:50] + mzs, value = mzs[strongest], value[strongest] + above = value > 0.001 + if not above.any(): + return None + return mzs[above], value[above] + + +def compute(root, stack, rules, top=None): + """Distance of the mean prediction for every query of `root` under every rule: (queries, pools, results). + + top: keep only the strongest `top` stored peaks of every simulation (E55: truncation study).""" + queries, pools, plan, masses, intens, done = scorelab.load(root, [stack]) + if top: + masses, intens = np.ascontiguousarray(masses[:, :, :top]), np.ascontiguousarray(intens[:, :, :top]) + members = masses.shape[0] + device = torch.device('cuda') + t_masses, t_intens = torch.from_numpy(masses), torch.from_numpy(intens) + results = {name: [None] * len(queries) for name in rules} + for key, group in plan.groups.items(): + tasks = group['tasks'] + have = tasks >= 0 + have[have] = done[tasks[have]] + if not have.any(): + continue + rows = torch.from_numpy(np.where(have, tasks, 0)) + have_t = torch.from_numpy(have).to(device) + mass = t_masses[:, rows].to(device).double() + raw = t_intens[:, rows].to(device).double().clamp_min(0) ** 0.75 + for q in group['queries']: + query = plan.queries[q] + precursor = float(query['precursor_mz']) + used = torch.where((mass < precursor - 0.5) & (mass > 0), raw, torch.zeros_like(raw)) + total = used.sum(2) + usable = total > 0 + any_usable = usable.any(0) + prob = used / total.clamp_min(1e-30).unsqueeze(2) + cache = {} + for name, rule in rules.items(): + if rule is None: + ppm, floor = (10.0, 1e-3) if query.get('instrument_type') == 'Orbitrap' else (20.0, 4e-3) + merge = 0.0 + else: + ppm, floor, merge = rule[0], rule[1] * 1e-3, rule[2] * 1e-3 + if merge not in cache: + obs = observed(query, merge) + if obs is None: + cache[merge] = None + else: + obs_mz = torch.from_numpy(obs[0]).to(device) + obs_q = torch.from_numpy(obs[1]).to(device) + err, nearest = (mass.unsqueeze(3) - obs_mz.view(1, 1, 1, -1)).abs().min(dim=3) + cache[merge] = (obs_mz, obs_q / obs_q.sum(), err, nearest) + if cache[merge] is None: + continue + obs_mz, obs_q, err, nearest = cache[merge] + close = (err <= torch.clamp(obs_mz * ppm * 1e-6, min=floor)[nearest]) & (used > 0) + p_obs = torch.zeros(members, mass.shape[1], obs_mz.shape[0], device=device, dtype=prob.dtype) + p_obs.scatter_add_(2, nearest, torch.where(close, prob, torch.zeros_like(prob))) + d = torch.where(any_usable, js(p_obs.mean(0), obs_q), torch.ones(mass.shape[1], device=device, dtype=prob.dtype)) + results[name][q] = torch.where(have_t, d, torch.ones_like(d)).cpu().numpy() + return queries, pools, results + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('root', type=Path) + p.add_argument('stack', type=Path) + p.add_argument('prefix') + p.add_argument('--rules', required=True) + p.add_argument('--top', type=int, help='keep the strongest TOP stored peaks per simulation (stored order is descending)') + args = p.parse_args() + rules = {} + for item in args.rules.split(','): + name, _, text = item.partition('=') + rules[name] = None if not text else (tuple(float(x) for x in text.split('/')) + (0.0,))[:3] + queries, pools, results = compute(args.root, args.stack, rules, args.top) + ev = scorelab.Evaluator(queries, pools) + first = next(iter(results.values())) + adduct = np.array([q['adduct'] for q in queries]) + energy = np.array([q.get('collision_energy') is not None for q in queries]) + orbi = np.array([q.get('instrument_type') == 'Orbitrap' for q in queries]) + coarse = np.array([abs(float(q['precursor_mz']) * 100 - round(float(q['precursor_mz']) * 100)) < 1e-6 for q in queries]) + strata = { + 'all': np.ones(len(queries), bool), + 'domain': (adduct == '[M+H]+') & energy, + 'Orbitrap no CE [M+H]+': orbi & ~energy & (adduct == '[M+H]+'), + 'Orbitrap no CE [M+Na]+': orbi & ~energy & (adduct == '[M+Na]+'), + 'Orbitrap no CE, precursor 2 decimals': orbi & ~energy & coarse, + 'Orbitrap no CE, precursor finer': orbi & ~energy & ~coarse, + 'Orbitrap with CE': orbi & energy, + 'not Orbitrap': ~orbi, + } + print('stratum sizes: ' + ', '.join(f'{k} {int(v.sum())}' for k, v in strata.items())) + for name in rules: + ind, agg = ev.ranks(results[name], 0.0, first), ev.ranks(results[name], 1.0, first) + text = ' | '.join(f'{k}: {np.mean(ind[m] == 0):.4f} / {np.mean(agg[m] == 0):.4f}' for k, m in strata.items()) + print(f'{name:12s} per spectrum / pool rule {text}', flush=True) + with open(f'{args.prefix}-{name}.pkl', 'wb') as stream: + pickle.dump({'Dmean': results[name]}, stream) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/d0/d073917af118a138b0fced5895ea1e48478d1e6a36130073ae6a539a50fc031a/recur-merged-10-sqrt.log b/shared/package-files/d0/d073917af118a138b0fced5895ea1e48478d1e6a36130073ae6a539a50fc031a/recur-merged-10-sqrt.log new file mode 100644 index 0000000000000000000000000000000000000000..e161181975f7191ed07b873393123a2438c57956 --- /dev/null +++ b/shared/package-files/d0/d073917af118a138b0fced5895ea1e48478d1e6a36130073ae6a539a50fc031a/recur-merged-10-sqrt.log @@ -0,0 +1,2 @@ +merged tol 10 mDa: 17307 of 19429 spectra in groups of >= 3; peaks 432025 -> 1838331; 0 s +wrote /workspace/research/inv/recur/merged-10-sqrt.npz 207 s diff --git a/shared/package-files/d0/d0a7ac85d0687efd9c5936831975874211916b495f925ff8f91da0386392641e/inv_alone_strata.py b/shared/package-files/d0/d0a7ac85d0687efd9c5936831975874211916b495f925ff8f91da0386392641e/inv_alone_strata.py new file mode 100644 index 0000000000000000000000000000000000000000..de9e2e8cb6aad02ed073a83d558289861e267b06 --- /dev/null +++ b/shared/package-files/d0/d0a7ac85d0687efd9c5936831975874211916b495f925ff8f91da0386392641e/inv_alone_strata.py @@ -0,0 +1,32 @@ +"""Pool-rule Hit@1 of inverse-branch score files (evals/score/NAME.pkl, key pow070) by adduct x instrument x +recorded-energy stratum and, for Orbitrap rows, by precursor m/z bin (lab, E70; labels: evaluation only). + +inv_alone_strata.py NAME [NAME ...] +""" +import pickle, sys +import numpy as np +sys.path.insert(0, '/workspace/research/allcond/analysis') +import netprop, scorelab +queries, pools = netprop.load(None) +ev = scorelab.Evaluator(queries, pools) +mz = np.array([float(q['precursor_mz']) for q in queries]) +strata = {} +for i, q in enumerate(queries): + key = (q['adduct'], str(q.get('instrument_type')), 'energy' if q.get('collision_energy') is not None else 'none') + strata.setdefault(key, []).append(i) +names = sys.argv[1:] +hits = {} +for name in names: + rows = pickle.load(open(f'/workspace/research/evals/score/{name}.pkl', 'rb'))['pow070'] + hits[name] = ev.ranks(rows, 1.0) == 0 +print('stratum | queries | ' + ' | '.join(names)) +for key, idx in sorted(strata.items(), key=lambda kv: -len(kv[1])): + idx = np.array(idx) + if len(idx) < 150: + continue + print(' '.join(key), '|', len(idx), '|', ' | '.join(f'{hits[n][idx].mean():.4f}' for n in names)) + if key[1] == 'Orbitrap': + for lo, hi in ((0, 500), (500, 850), (850, 5000)): + sel = idx[(mz[idx] >= lo) & (mz[idx] < hi)] + if len(sel): + print(f' m/z [{lo}, {hi})', '|', len(sel), '|', ' | '.join(f'{hits[n][sel].mean():.4f}' for n in names)) diff --git a/shared/package-files/d0/d0b399ed8fb63ffdfa684f313a257c47d5b415ee4762c521cd3d2d78f4ada397/I17-ff512x6-real08-corpus2+train3-noise10.log b/shared/package-files/d0/d0b399ed8fb63ffdfa684f313a257c47d5b415ee4762c521cd3d2d78f4ada397/I17-ff512x6-real08-corpus2+train3-noise10.log new file mode 100644 index 0000000000000000000000000000000000000000..754fa74baf78cdfa00414b62c82f0bbb8aaf6781 --- /dev/null +++ b/shared/package-files/d0/d0b399ed8fb63ffdfa684f313a257c47d5b415ee4762c521cd3d2d78f4ada397/I17-ff512x6-real08-corpus2+train3-noise10.log @@ -0,0 +1,12 @@ +{"extra_rows": 2031301, "extra_structures": 434950} +{"args": {"store": "/workspace/research/inv", "out": "runs/I17-ff512x6-real08-corpus2+train3-noise10", "pools": "pools-validation-input.npz", "input": "/workspace/research/validation-input", "steps": 50000, "batch": 512, "real_frac": 0.08, "real_balance": 0.5, "no_synth": false, "target": "", "heavy_boost": 1.0, "synth_structures": 1.0, "extra_store": "inv/selfsim/corpus2+train3.npz", "extra_frac": 0.5, "heavy_lo": 450.0, "heavy_hi": 850.0, "lr": 0.0006, "weight_decay": 0.0001, "warmup": 2000, "ema": 0.999, "dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "peak_drop": 0.3, "truncate": 0.3, "min_keep": 4, "jitter": 0.15, "synth_energy_drop": 0.3, "synth_instrument_drop": 0.3, "validate_every": 5000, "retrieve_every": 10000, "retrieve_pools": 0, "seed": 1, "contrast_weight": 0.0, "contrast_k": 31, "contrast_tau": 0.05, "noise_rate": 1.0, "noise_max": 12, "noise_scatter": 0.35, "noise_shape": 3.0, "init": null, "max_steps_this_run": 0}, "parameters": 24997832, "model": {"dim": 512, "layers": 6, "heads": 8, "dropout": 0.1, "pair_dim": 64, "fp_bits": 4096, "max_energy": 200.0}, "real_rows": 194119, "synth_rows": 2333477, "stores": {"gen-x1.manifest.json": null, "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc"}, "gpu": "NVIDIA H100 80GB HBM3", "load_seconds": 13.599964391905814, "extra_store": {"path": "inv/selfsim/corpus2+train3.npz", "rows": 2031301, "manifest": {"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/corpus2.npz", "inv/selfsim/train3.npz"], "parts": [{"schema": "allcond-inverse-selfsim/v1", "merged": ["inv/selfsim/sub75.npz", "inv/selfsim/sub25.npz"], "parts": [{"name": "sub75", "source": "synth", "conditions": "from-rows 2 hash-range 0.25,1 (534 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 651127, "failed": 0, "rows": 651127, "seconds": 635.7592854518443, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 651083, "without_peak": 44, "mean_annotated_peaks": 15.61580167198345, "mean_candidates": 20.62178653319552, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 25.62758301384747}, {"name": "sub25", "source": "synth", "conditions": "from-rows 2 hash-range 0,0.25 (485 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 217012, "failed": 0, "rows": 217012, "seconds": 227.74617605702952, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 217000, "without_peak": 12, "mean_annotated_peaks": 15.62026728110599, "mean_candidates": 20.61567563084069, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 10.8742212112993}], "spectra": 868083, "structures": 434944}, {"name": "train3", "source": "synth", "conditions": "from-train 3 window 2000 seed 0 hash-range 0,1 (301 conditions)", "bundle": "builds/5Ms-I1+I3x2-L", "members": "1,3", "structures": 435076, "tasks": 1163260, "failed": 0, "rows": 1163260, "seconds": 1262.926542488858, "schema": "allcond-inverse-selfsim/v1", "floor": 0.02, "spectra": 1163218, "without_peak": 42, "mean_annotated_peaks": 17.868643710809152, "mean_candidates": 25.376552103570997, "ppm": 20.0, "floor_da": 0.004, "max_peaks": 24, "annotate_seconds": 43.40271363919601}], "spectra": 2031301, "structures": 434950}}} +{"step": 5000, "elapsed": 128.5905942399986, "val_loss": 0.03658443228866763, "val_cos": 0.6432314955253744, "val_loss_ema": 0.034572340381992805, "val_cos_ema": 0.6593297166827776} +{"step": 10000, "elapsed": 244.78934392391238, "val_loss": 0.03306697551144753, "val_cos": 0.6828797244333535, "val_loss_ema": 0.030355249002703956, "val_cos_ema": 0.7065622572290455, "ind_cos": 0.45174738792526636, "agg_cos": 0.4881362911112255, "ind_nll": 0.31247104843275514, "agg_nll": 0.28977301971280045, "retrieval_seconds": 11.89206473797094} +{"step": 15000, "elapsed": 353.87013195292093, "val_loss": 0.030492373910270047, "val_cos": 0.7128152177278488, "val_loss_ema": 0.02926900016340546, "val_cos_ema": 0.7239483519119293} +{"step": 20000, "elapsed": 451.3959116329206, "val_loss": 0.029352488805645314, "val_cos": 0.7260349255421985, "val_loss_ema": 0.029197512630623843, "val_cos_ema": 0.7307384996935959, "ind_cos": 0.5025477379175459, "agg_cos": 0.5371866797055947, "ind_nll": 0.39538833702197745, "agg_nll": 0.38380771012404136, "retrieval_seconds": 11.314506559981965} +{"step": 25000, "elapsed": 561.3123248519842, "val_loss": 0.029448751745764425, "val_cos": 0.732797547973149, "val_loss_ema": 0.028832736548629386, "val_cos_ema": 0.7382193006829353} +{"step": 30000, "elapsed": 658.4637399489293, "val_loss": 0.029309833072476026, "val_cos": 0.7359795375751133, "val_loss_ema": 0.02829319671531904, "val_cos_ema": 0.7448544118167431, "ind_cos": 0.5190694322919347, "agg_cos": 0.5547892325904575, "ind_nll": 0.4258582531267693, "agg_nll": 0.41546142364506666, "retrieval_seconds": 11.373320165090263} +{"step": 35000, "elapsed": 767.2320784149924, "val_loss": 0.02948163797424778, "val_cos": 0.7391136829529955, "val_loss_ema": 0.028961391724832846, "val_cos_ema": 0.7428854916257591} +{"step": 40000, "elapsed": 865.2322233179584, "val_loss": 0.02905146012592625, "val_cos": 0.7438504936041163, "val_loss_ema": 0.028742833073456157, "val_cos_ema": 0.7458477370731252, "ind_cos": 0.5226722939935149, "agg_cos": 0.5592670749909928, "ind_nll": 0.4324463430953729, "agg_nll": 0.4226671470482269, "retrieval_seconds": 11.393193318042904} +{"step": 45000, "elapsed": 975.4173009499209, "val_loss": 0.0286924501682458, "val_cos": 0.7465928880877168, "val_loss_ema": 0.02895729174499339, "val_cos_ema": 0.7454667550560695} +{"step": 50000, "elapsed": 1073.6813751059817, "val_loss": 0.028857320327754864, "val_cos": 0.746391471129658, "val_loss_ema": 0.02882994458840924, "val_cos_ema": 0.7465592746144616, "ind_cos": 0.5209738020484842, "agg_cos": 0.5579288692161203, "ind_nll": 0.4354315713623964, "agg_nll": 0.43059344279170314, "retrieval_seconds": 11.345649866969325} diff --git a/shared/package-files/d0/d0cdc638724325297393af4008f21c7ae4cc75f74709670ffe605bd0ae2c5ee6/ensemble-mean-3S-30k.log b/shared/package-files/d0/d0cdc638724325297393af4008f21c7ae4cc75f74709670ffe605bd0ae2c5ee6/ensemble-mean-3S-30k.log new file mode 100644 index 0000000000000000000000000000000000000000..5dcc72defda3cdfb55a92348af24e06e632a077f --- /dev/null +++ b/shared/package-files/d0/d0cdc638724325297393af4008f21c7ae4cc75f74709670ffe605bd0ae2c5ee6/ensemble-mean-3S-30k.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 134.07893528000568} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 138.39467478000734} +ind meanD all=0.4966 dom=0.7376 non=0.2546 h5=0.6457 h20=0.7217 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6376 dom=0.8061 non=0.4683 h5=0.8376 h20=0.8921 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.4999 dom=0.7418 non=0.2569 h5=0.6486 h20=0.7228 | diff=+0.0033 [+0.0010,+0.0054] +agg Dmean all=0.6474 dom=0.8201 non=0.4741 h5=0.8419 h20=0.8944 | diff=+0.0099 [-0.0002,+0.0200] +ind gmean all=0.4946 dom=0.7349 non=0.2533 h5=0.6442 h20=0.7208 | diff=-0.0020 [-0.0035,-0.0006] +agg gmean all=0.6312 dom=0.8008 non=0.4610 h5=0.8370 h20=0.8925 | diff=-0.0063 [-0.0154,+0.0000] diff --git a/shared/package-files/d8/d8c1fea317807a82fc4e7da718058abeea5fafc6f04e93c7f5df1bbc68616043/publish.py b/shared/package-files/d8/d8c1fea317807a82fc4e7da718058abeea5fafc6f04e93c7f5df1bbc68616043/publish.py new file mode 100644 index 0000000000000000000000000000000000000000..b01bde05081e2b435c28135ecd33b5b038a12228 --- /dev/null +++ b/shared/package-files/d8/d8c1fea317807a82fc4e7da718058abeea5fafc6f04e93c7f5df1bbc68616043/publish.py @@ -0,0 +1,247 @@ +#!/usr/bin/env python3 +"""Build, release and document the GLACIER all-condition retrieval package. + +``build`` assembles one complete, standalone package directory (used for the + relocated validation replay). +``release`` copies a validated build byte-for-byte into a new immutable + generation of the submission and switches the manifest atomically. +``records`` copies EXPERIMENTS.md and research records (file-by-file, each + file replaced atomically) into the submission root. +""" + +import argparse +import hashlib +import json +import os +from pathlib import Path +import shutil +import sys + +HERE = Path(__file__).resolve().parent +RESEARCH = HERE.parent + + +def sha256(path): + h = hashlib.sha256() + with Path(path).open('rb') as f: + for block in iter(lambda: f.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + + +INFER_SH = '''#!/usr/bin/env bash +set -euo pipefail +package_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +scratch="$(mktemp -d)" +trap 'rm -rf "$scratch"' EXIT +export PYTHONDONTWRITEBYTECODE=1 DGLBACKEND=pytorch MPLCONFIGDIR="$scratch/mpl" NUMBA_CACHE_DIR="$scratch/numba" +if [ ! -w "${HOME:-/nonexistent}" ]; then export HOME="$scratch"; fi +"${MASSSPECGYM_GLACIER_PYTHON:-/opt/glacier/bin/python}" "$package_root/infer.py" "$@" +''' + + +ROOT_INFER_SH = '''#!/usr/bin/env bash +set -euo pipefail +root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +for candidate in python3 "${MASSSPECGYM_GLACIER_PYTHON:-/opt/glacier/bin/python}" /opt/conda/bin/python3; do + if command -v "$candidate" >/dev/null 2>&1; then exec "$candidate" "$root/dispatch.py" "$@"; fi +done +echo "infer.sh: no Python interpreter found" >&2 +exit 1 +''' + + +def build(args): + import torch + out = args.output.resolve() + if out.exists(): + raise FileExistsError(out) + out.mkdir(parents=True) + members, provenance = [], [] + for path in args.checkpoint: + saved = torch.load(path, map_location='cpu', weights_only=False) + training = saved['task_training'] + if training.get('pretrained_assets') != [] or not str(training.get('initialization', '')).startswith(('random', 'own-checkpoint:')): + raise ValueError(f'{path}: not a train-fold, scratch-initialized checkpoint') + digest = sha256(path) + members.append({'state_dict': saved['state_dict'], 'hyper_parameters': saved['hyper_parameters'], + 'global_step': saved['global_step'], 'weights': saved['weights'], + 'task_training': training, 'source_checkpoint_sha256': digest}) + provenance.append({'source': str(path), 'sha256': digest, 'global_step': saved['global_step'], + 'weights': saved['weights'], 'subset': training.get('subset'), 'seed': training.get('seed'), + 'elapsed_seconds': training.get('elapsed_seconds'), + 'data_manifest_sha256': training.get('data_manifest_sha256'), + 'initialization': training.get('initialization'), + 'training_data': 'MassSpecGym v1.5 train fold' + ( + ' + supplied synthetic_augmentation corpus (auxiliary intensity term)' + if training.get('synthetic') else ''), + 'synthetic': training.get('synthetic')}) + bundle = {'format': 'glacier-members/v1', 'members': members} + inverse_provenance = [] + for path in args.inverse or []: + saved = torch.load(path, map_location='cpu', weights_only=True) + digest = sha256(path) + recipe = json.loads((path.parent / 'recipe.json').read_text()) + bundle.setdefault('inverse', []).append({'ema': saved['ema'], 'config': saved['config'], + 'class': saved.get('class', 'FormulaFormer'), 'step': saved['step'], + 'source_checkpoint_sha256': digest}) + inverse_provenance.append({'source': str(path), 'sha256': digest, 'step': saved['step'], + 'class': saved.get('class', 'FormulaFormer'), 'weights': 'ema', + 'initialization': 'random', 'seed': recipe['args']['seed'], + 'training_data': 'MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus', + 'stores': recipe.get('stores'), 'recipe': recipe['args']}) + library_provenance = None + if args.library: + library_provenance = json.loads((args.library.parent / 'manifest.json').read_text()) + if library_provenance['sha256'] != sha256(args.library) or library_provenance.get('fold') != 'train': + raise ValueError(f'{args.library}: not the recorded train-fold library') + bundle['library'] = torch.load(args.library, map_location='cpu', weights_only=True) + library_provenance['training_data'] = 'MassSpecGym v1.5 train fold' + torch.save(bundle, out / 'model.pt') + config = json.loads((HERE / 'pkg' / 'model_config.json').read_text()) + for item in args.set: + key, value = item.split('=', 1) + config[key] = json.loads(value) + if inverse_provenance: + if not isinstance(config.get('inverse'), dict): + raise ValueError('--inverse needs --set inverse={...} (fusion options)') + config['inverse_members'] = inverse_provenance + elif config.get('inverse'): + raise ValueError('fusion options without --inverse checkpoints') + if library_provenance: + if not isinstance(config.get('library'), dict): + raise ValueError('--library needs --set library={...} (neighbour and fusion options)') + config['library_asset'] = library_provenance + elif config.get('library'): + raise ValueError('library options without --library asset') + config['checkpoint'] = 'model.pt' + config['method'] = ('native-glacier-all-conditions-forward-simulation' + + ('+formula-transformer-inverse-fusion' if inverse_provenance else '') + + ('+train-library-neighbour-fusion' if library_provenance else '')) + config['inference_runtime'] = '/opt/glacier/bin/python' + config['members'] = provenance + (out / 'model_config.json').write_text(json.dumps(config, indent=2) + '\n') + manifest = {'schema': 'massspecgym-retrieval-model/v1', + 'checkpoint': {'path': 'model.pt', 'sha256': sha256(out / 'model.pt'), 'format': 'pytorch'}, + 'model_config': 'model_config.json', + 'training_provenance': {'data': 'MassSpecGym v1.5 train fold', 'pretrained_assets': []}} + (out / 'model_manifest.json').write_text(json.dumps(manifest, indent=2) + '\n') + for name in ['infer.py', 'fastfeat.py', 'inverse.py', 'invrun.py', 'library.py']: + shutil.copyfile(HERE / 'pkg' / name, out / name) + (out / 'infer.sh').write_text(INFER_SH) + (out / 'infer.sh').chmod(0o755) + source_root = args.source_root.resolve() + shutil.copytree(source_root / 'src' / 'ms_pred', out / 'vendor' / 'ms_pred', + ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + shutil.copyfile(source_root / 'LICENSE', out / 'LICENSE.ms-pred') + shutil.copytree(HERE, out / 'training', ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + readme = args.readme.read_text() if args.readme else '# GLACIER all-condition retrieval package\n' + (out / 'README.md').write_text(readme) + for path in [out, *out.rglob('*')]: + path.chmod(0o755 if path.is_dir() or path.stat().st_mode & 0o111 else 0o644) + print(json.dumps({'built': str(out), 'checkpoint_sha256': manifest['checkpoint']['sha256'], + 'members': provenance, 'config': {k: v for k, v in config.items() if k != 'members'}}, indent=2)) + + +def release(args): + sys.path.insert(0, str(RESEARCH / 'starter')) + from publication import publish_directory + source = args.source.resolve() + manifest = json.loads((source / 'model_manifest.json').read_text()) + if sha256(source / manifest['checkpoint']['path']) != manifest['checkpoint']['sha256']: + raise ValueError('staged checkpoint hash mismatch') + if args.readme: + readme = args.readme.read_text() + + def copy(stage): + shutil.copytree(source, stage, dirs_exist_ok=True) + if args.readme: + (stage / 'README.md').write_text(readme) + + destination = args.output_dir.resolve() + publish_directory(destination, copy) + # The stock root launcher needs `python3` on PATH; fall back to the documented runtimes. + temporary = destination / '.infer.sh.tmp' + temporary.write_text(ROOT_INFER_SH) + temporary.chmod(0o755) + os.replace(temporary, destination / 'infer.sh') + current = json.loads((destination / 'model_manifest.json').read_text()) + selected = Path(current['model_config']).parts[1] + # Keep the selected generation and its predecessor; older ones are unreferenced. + generations = sorted((p for p in (destination / '.versions').iterdir() if p.is_dir()), + key=lambda p: p.stat().st_mtime, reverse=True) + keep = {selected} + for path in generations: + if path.name != selected and len(keep) < 2: + keep.add(path.name) + for path in generations: + if path.name not in keep: + shutil.rmtree(path, ignore_errors=True) + print(json.dumps({'released': selected, 'checkpoint_sha256': current['checkpoint']['sha256'], 'kept': sorted(keep)})) + + +def records(args): + destination = args.output_dir.resolve() + + def put(source, relative): + target = destination / relative + target.parent.mkdir(parents=True, exist_ok=True) + target.parent.chmod(0o755) + if target.exists() and target.stat().st_size == source.stat().st_size and target.stat().st_mtime >= source.stat().st_mtime: + return + temporary = target.with_name(target.name + '.tmp') + shutil.copyfile(source, temporary) + temporary.chmod(0o644) + os.replace(temporary, target) + + put(RESEARCH / 'EXPERIMENTS.md', 'EXPERIMENTS.md') + skip = {'__pycache__'} + for path in sorted(HERE.rglob('*')): + if path.is_file() and not (set(path.parts) & skip) and path.suffix != '.pyc': + put(path, Path('research') / 'source' / path.relative_to(HERE)) + for run in sorted((RESEARCH / 'runs').iterdir()): + for name in ['recipe.json', 'metrics.jsonl', 'validation.jsonl', 'result.json']: + if (run / name).is_file(): + put(run / name, Path('research') / 'runs' / run.name / name) + if (run / 'training-source').is_dir(): + for path in sorted((run / 'training-source').rglob('*')): + if path.is_file() and not (set(path.parts) & skip): + put(path, Path('research') / 'runs' / run.name / 'training-source' / path.relative_to(run / 'training-source')) + for path in sorted((RESEARCH / 'logs').glob('*')): + if path.is_file() and path.stat().st_size < 50 * 1024 * 1024: + put(path, Path('research') / 'logs' / path.name) + for path in sorted((RESEARCH / 'evals').glob('*/report*.json')) + sorted((RESEARCH / 'evals').glob('*/*.log')) \ + + sorted((RESEARCH / 'evals').glob('*/summary*.json')) + sorted((RESEARCH / 'evals').glob('*/summary*.txt')): + put(path, Path('research') / 'evals' / path.parent.name / path.name) + for name in ['manifest.json', 'preparation.json']: + if (RESEARCH / 'prep_all' / name).is_file(): + put(RESEARCH / 'prep_all' / name, Path('research') / 'prep_all' / name) + for path in [destination / 'research', *(destination / 'research').rglob('*')]: + if path.is_dir(): + path.chmod(0o755) + print(json.dumps({'records': str(destination / 'research')})) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + sub = parser.add_subparsers(dest='command', required=True) + b = sub.add_parser('build') + b.add_argument('--checkpoint', type=Path, action='append', required=True) + b.add_argument('--set', action='append', default=[]) + b.add_argument('--inverse', type=Path, action='append', help='inverse-branch EMA checkpoint (train_inv.py / train_set.py)') + b.add_argument('--library', type=Path, help='train-fold spectral library (build_library.py)') + b.add_argument('--output', type=Path, required=True) + b.add_argument('--source-root', type=Path, default=RESEARCH / 'ms-pred') + b.add_argument('--readme', type=Path) + r = sub.add_parser('release') + r.add_argument('--source', type=Path, required=True) + r.add_argument('--output-dir', type=Path, default=Path('/workspace/submission')) + r.add_argument('--readme', type=Path) + c = sub.add_parser('records') + c.add_argument('--output-dir', type=Path, default=Path('/workspace/submission')) + args = parser.parse_args() + {'build': build, 'release': release, 'records': records}[args.command](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/d8/d8e00d29972f9eb4ff32ab16e88e4ed9efdf2cfddfd13c98290c485b46ee6e2d/eval-B30k-sub.log b/shared/package-files/d8/d8e00d29972f9eb4ff32ab16e88e4ed9efdf2cfddfd13c98290c485b46ee6e2d/eval-B30k-sub.log new file mode 100644 index 0000000000000000000000000000000000000000..019b04f48604bdaa9aaca2cbdf4a2c875bba7c1f --- /dev/null +++ b/shared/package-files/d8/d8e00d29972f9eb4ff32ab16e88e4ed9efdf2cfddfd13c98290c485b46ee6e2d/eval-B30k-sub.log @@ -0,0 +1,11 @@ +{"event": "loaded", "queries": 2147, "pools": 413, "members": 1, "workers": 10} +{"event": "canonicalized", "unique_candidates": 105046, "unsupported": 928, "seconds": 7.038155023008585} +{"event": "planned", "queries": 2147, "groups": 1168, "molecules": 116802, "simulations": 295422, "seconds": 7.384077844093554} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 295422, "seconds": 26.09717529907357, "per_second": 2452.3726903988704} +{"event": "simulating", "finished": 128000, "total": 295422, "seconds": 54.31340753403492, "per_second": 2356.6924965956177} +{"event": "simulating", "finished": 192000, "total": 295422, "seconds": 84.66774693503976, "per_second": 2267.687601836264} +{"event": "simulating", "finished": 256000, "total": 295422, "seconds": 120.42724606802221, "per_second": 2125.764794583119} +{"event": "simulated", "finished": 295422, "total": 295422, "failed": 0, "seconds": 160.52185488201212} +{"event": "finished", "queries": 2147, "unscored": 0, "directly_scored": 2147, "scoring_seconds": 1.920636932947673, "total_seconds": 182.07508743496146} diff --git a/shared/package-files/df/df2a7c18c2ccdeae8219394fda374bae78151e2dfde14f81158d0b7b723ac23d/validation.jsonl b/shared/package-files/df/df2a7c18c2ccdeae8219394fda374bae78151e2dfde14f81158d0b7b723ac23d/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..a1771cdaf03c062f866f2f71d8d194d5e69b1c2a --- /dev/null +++ b/shared/package-files/df/df2a7c18c2ccdeae8219394fda374bae78151e2dfde14f81158d0b7b723ac23d/validation.jsonl @@ -0,0 +1,4 @@ +{"step": 46000, "elapsed_seconds": 13259.363614329064, "validation_loss": 0.5682799583300948, "validation_loss_ema": 0.5617907987907529} +{"step": 47000, "elapsed_seconds": 13547.064763365066, "validation_loss": 0.5652839476242661, "validation_loss_ema": 0.5623764898627996} +{"step": 48000, "elapsed_seconds": 13877.90905588807, "validation_loss": 0.5649867970496416, "validation_loss_ema": 0.5618297383189201} +{"step": 49000, "elapsed_seconds": 14180.89154956107, "validation_loss": 0.562397638335824, "validation_loss_ema": 0.5612926306203008} diff --git a/shared/package-files/df/df523cac2cc9202c70714c1730b58d645e58280d4ea33877d2f8ee5f822b2167/library-hybrid.log b/shared/package-files/df/df523cac2cc9202c70714c1730b58d645e58280d4ea33877d2f8ee5f822b2167/library-hybrid.log new file mode 100644 index 0000000000000000000000000000000000000000..3d4e69dabdef10784176694f07c72cd9a50922ae --- /dev/null +++ b/shared/package-files/df/df523cac2cc9202c70714c1730b58d645e58280d4ea33877d2f8ee5f822b2167/library-hybrid.log @@ -0,0 +1,17 @@ +released rule without consensus: Hit@1 0.7685 domain 0.9301 other 0.6062 macro 0.8650 +r 0: label Tanimoto of the heaviest voter 0.161 (domain 0.153 other 0.169), weighted 0.146 | alone per spectrum 0.1683 pool mean 0.2543 (0.2265 / 0.2822) macro 0.2227 + library weight 0/0.4: Hit@1 0.7685 (+0.0000 [+0.0000, +0.0000]) macro 0.8650 (+0.0000 [+0.0000, +0.0000]) pools +0 -0 | domain 0.9301 other 0.6062 + library weight 0/0.8: Hit@1 0.7625 (-0.0060 [-0.0159, +0.0017]) macro 0.8639 (-0.0012 [-0.0038, +0.0015]) pools +10 -14 | domain 0.9304 other 0.5938 + library weight 0.2/0.4: Hit@1 0.7708 (+0.0023 [+0.0002, +0.0056]) macro 0.8665 (+0.0015 [+0.0000, +0.0032]) pools +6 -1 | domain 0.9339 other 0.6070 +r 1: label Tanimoto of the heaviest voter 0.204 (domain 0.192 other 0.217), weighted 0.174 | alone per spectrum 0.2261 pool mean 0.3343 (0.3439 / 0.3246) macro 0.3116 + library weight 0/0.4: Hit@1 0.7629 (-0.0056 [-0.0168, +0.0029]) macro 0.8636 (-0.0015 [-0.0030, +0.0000]) pools +1 -6 | domain 0.9301 other 0.5949 + library weight 0/0.8: Hit@1 0.7528 (-0.0157 [-0.0377, +0.0013]) macro 0.8633 (-0.0018 [-0.0056, +0.0018]) pools +16 -22 | domain 0.9302 other 0.5746 + library weight 0.2/0.4: Hit@1 0.7651 (-0.0034 [-0.0150, +0.0061]) macro 0.8647 (-0.0003 [-0.0027, +0.0018]) pools +7 -8 | domain 0.9337 other 0.5958 +r 2: label Tanimoto of the heaviest voter 0.232 (domain 0.221 other 0.243), weighted 0.197 | alone per spectrum 0.2701 pool mean 0.3807 (0.4132 / 0.3481) macro 0.3712 + library weight 0/0.4: Hit@1 0.7627 (-0.0058 [-0.0172, +0.0027]) macro 0.8639 (-0.0012 [-0.0032, +0.0009]) pools +4 -8 | domain 0.9297 other 0.5950 + library weight 0/0.8: Hit@1 0.7491 (-0.0194 [-0.0416, -0.0023]) macro 0.8624 (-0.0027 [-0.0068, +0.0015]) pools +20 -29 | domain 0.9294 other 0.5681 + library weight 0.2/0.4: Hit@1 0.7657 (-0.0028 [-0.0145, +0.0066]) macro 0.8656 (+0.0006 [-0.0021, +0.0032]) pools +11 -9 | domain 0.9340 other 0.5966 +r 4: label Tanimoto of the heaviest voter 0.265 (domain 0.253 other 0.277), weighted 0.234 | alone per spectrum 0.3210 pool mean 0.4154 (0.4731 / 0.3574) macro 0.4315 + library weight 0/0.4: Hit@1 0.7516 (-0.0169 [-0.0395, +0.0008]) macro 0.8630 (-0.0021 [-0.0053, +0.0012]) pools +11 -18 | domain 0.9289 other 0.5736 + library weight 0/0.8: Hit@1 0.7425 (-0.0260 [-0.0504, -0.0065]) macro 0.8594 (-0.0056 [-0.0103, -0.0006]) pools +24 -43 | domain 0.9304 other 0.5538 + library weight 0.2/0.4: Hit@1 0.7551 (-0.0134 [-0.0353, +0.0046]) macro 0.8644 (-0.0006 [-0.0044, +0.0032]) pools +20 -22 | domain 0.9345 other 0.5750 diff --git a/shared/package-files/df/dfa0c08a0d8cf6b905cbb5b68c341a1c3cfa9cab87a0312826832c4f36abc6ed/altfp.py b/shared/package-files/df/dfa0c08a0d8cf6b905cbb5b68c341a1c3cfa9cab87a0312826832c4f36abc6ed/altfp.py new file mode 100644 index 0000000000000000000000000000000000000000..30f539c6c5395cc3dc5554fa5d9919e57c61492c --- /dev/null +++ b/shared/package-files/df/dfa0c08a0d8cf6b905cbb5b68c341a1c3cfa9cab87a0312826832c4f36abc6ed/altfp.py @@ -0,0 +1,176 @@ +#!/usr/bin/env python3 +"""Alternative fingerprint targets for the inverse branch (lab, E56). + +altfp.py build NAME [--workers N] -> inv/alt-NAME/{synth,real-train,real-validation}.fps.npy and + pools-validation-input.cand_fps.npy, aligned with the stores of + prepare_inv.py (structure slots / candidate rows) +altfp.py stats NAME -> bit density per block on the train-fold structures + +Targets (packed bits, np.packbits order): + multi8192 AtomPair 2048 (count simulation) | TopologicalTorsion 2048 (count simulation) | + feature-Morgan radius 2 (FCFP4-like) 2048 | RDKit path fingerprint (paths <= 5) 2048 + ap4096 AtomPair 4096 (count simulation) + morgan3c Morgan radius 3, 4096 bits with count simulation +""" +import argparse +import csv +import json +import multiprocessing +import sys +import time +from pathlib import Path + +import numpy as np + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE.parent / 'pkg')) +import inverse + +STORE = Path('/workspace/research/inv') +DATA = Path('/workspace/data') +LABELS = DATA / 'synthetic_augmentation' / 'labels.tsv' +_CACHE = {} + + +def blocks(name): + from rdkit.Chem import rdFingerprintGenerator as G + if name not in _CACHE: + if name == 'multi8192': + _CACHE[name] = [G.GetAtomPairGenerator(fpSize=2048), G.GetTopologicalTorsionGenerator(fpSize=2048), + G.GetMorganGenerator(radius=2, fpSize=2048, atomInvariantsGenerator=G.GetMorganFeatureAtomInvGen()), + G.GetRDKitFPGenerator(maxPath=5, fpSize=2048)] + elif name == 'ap4096': + _CACHE[name] = [G.GetAtomPairGenerator(fpSize=4096)] + elif name == 'morgan3c': + _CACHE[name] = [G.GetMorganGenerator(radius=3, fpSize=4096, countSimulation=True)] + else: + raise KeyError(name) + return _CACHE[name] + + +BITS = {'multi8192': 8192, 'ap4096': 4096, 'morgan3c': 4096} + + +def fingerprint(mol, name): + return np.packbits(np.concatenate([g.GetFingerprintAsNumPy(mol).astype(bool) for g in blocks(name)])) + + +def chunk_job(job): + name, smiles, with_key = job + from rdkit import Chem, RDLogger + RDLogger.DisableLog('rdApp.*') + out = [] + for text in smiles: + mol = Chem.MolFromSmiles(text) if text else None + formula = inverse.mol_formula(mol) if mol is not None else None + if formula is None: + out.append(None) + continue + key = (inverse.fingerprint(mol).tobytes(), formula.astype(np.int16).tobytes()) if with_key else None + out.append((fingerprint(mol, name), key)) + return out + + +def compute(name, smiles, workers, with_key=False): + jobs = [(name, smiles[i:i + 2000], with_key) for i in range(0, len(smiles), 2000)] + with multiprocessing.Pool(workers) as pool: + return [d for part in pool.imap(chunk_job, jobs, chunksize=1) for d in part] + + +def build(args): + name, width = args.name, BITS[args.name] // 8 + out = STORE / f'alt-{name}' + out.mkdir(parents=True, exist_ok=True) + started = time.monotonic() + report = {} + for fold in ('train', 'validation'): + store = {k: v for k, v in np.load(STORE / f'real-{fold}.npz').items() if k in ('fps', 'row', 'mol')} + rows = [json.loads(line)['target_smiles'] for line in (DATA / f'{fold}.jsonl').open()] + slots = store['fps'].shape[0] + smiles = [None] * slots + for row, slot in zip(store['row'], store['mol']): + if smiles[slot] is None: + smiles[slot] = rows[row] + got = compute(name, smiles, args.workers, with_key=True) + assert all(g is not None for g in got) + assert all(g[1][0] == store['fps'][s].tobytes() for s, g in enumerate(got)), 'slot order differs from the store' + np.save(out / f'real-{fold}.fps.npy', np.stack([g[0] for g in got])) + report[f'real-{fold}'] = slots + print(json.dumps({'store': f'real-{fold}', 'structures': slots, 'seconds': time.monotonic() - started}), flush=True) + # synthetic corpus: slots are matched to the label SMILES by (released Morgan fingerprint, formula) + store = {k: v for k, v in np.load(STORE / 'synth.npz').items() if k in ('fps', 'root', 'mol')} + slots = store['fps'].shape[0] + first = np.full(slots, -1, dtype=np.int64) + mol = store['mol'] + first[mol[::-1]] = np.arange(len(mol))[::-1] + roots = store['root'][first] + smiles, seen = [], set() + with LABELS.open() as stream: + for row in csv.DictReader(stream, delimiter='\t'): + if row['smiles'] not in seen: + seen.add(row['smiles']) + smiles.append(row['smiles']) + got = compute(name, smiles, args.workers, with_key=True) + by_key = {} + for g in got: + if g is not None: + by_key.setdefault(g[1], []).append(g[0]) + fps = np.zeros((slots, width), dtype=np.uint8) + ambiguous = missing = 0 + for s in range(slots): + options = by_key.get((store['fps'][s].tobytes(), roots[s].astype(np.int16).tobytes())) + if not options: + missing += 1 + continue + ambiguous += len(options) > 1 and any((o != options[0]).any() for o in options[1:]) + fps[s] = options[0] if len(options) == 1 else options.pop(0) + assert missing == 0, missing + np.save(out / 'synth.fps.npy', fps) + report.update(synth=slots, synth_ambiguous_slots=int(ambiguous)) + print(json.dumps({'store': 'synth', 'structures': slots, 'ambiguous': int(ambiguous), 'seconds': time.monotonic() - started}), flush=True) + # inference-style candidate store of the validation fold + store = {k: v for k, v in np.load(STORE / 'pools-validation-input.npz').items() if k in ('pool_id', 'cand_formula')} + pools = {} + for line in open('/workspace/research/validation-input/candidate_pools.jsonl'): + pool = json.loads(line) + pools[pool['candidate_pool_id']] = [c['smiles'] for c in pool['candidates']] + smiles = [text for pid in store['pool_id'] for text in pools[str(pid)]] + supported = store['cand_formula'] >= 0 + assert len(smiles) == len(supported) + unique = sorted({text for text, ok in zip(smiles, supported) if ok}) + got = dict(zip(unique, compute(name, unique, args.workers))) + fps = np.zeros((len(smiles), width), dtype=np.uint8) + for n, (text, ok) in enumerate(zip(smiles, supported)): + if ok: + fps[n] = got[text][0] + np.save(out / 'pools-validation-input.cand_fps.npy', fps) + report.update(candidates=len(smiles), unique_supported=len(unique), seconds=time.monotonic() - started) + (out / 'manifest.json').write_text(json.dumps(dict(report, target=name, bits=BITS[name]), indent=1) + '\n') + print(json.dumps(report), flush=True) + + +def stats(args): + rows = [json.loads(line)['target_smiles'] for line in (DATA / 'train.jsonl').open()] + smiles = sorted(set(rows))[::10] + started = time.monotonic() + got = [g[0] for g in compute(args.name, smiles, args.workers) if g is not None] + seconds = time.monotonic() - started + bits = np.unpackbits(np.stack(got), axis=1) + print(f'{len(got)} structures, {seconds / len(got) * 1e3 * args.workers:.3f} ms per structure and core; on-bits mean {bits.sum(1).mean():.1f}') + for start in range(0, bits.shape[1], 2048): + block = bits[:, start:start + 2048] + print(f' bits {start:5d}-{start + 2047:5d}: on per molecule {block.sum(1).mean():7.1f}; bits ever on {int((block.sum(0) > 0).sum())}; ' + f'bits on in > 50 % {int((block.mean(0) > 0.5).sum())}') + + +def main(): + p = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + p.add_argument('mode', choices=['build', 'stats']) + p.add_argument('name') + p.add_argument('--workers', type=int, default=12) + args = p.parse_args() + {'build': build, 'stats': stats}[args.mode](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/df/dfaf3378f24c5249e4da10572687ecac98d53a03d14a3ff89ade15b37bec968b/replays-5Ms-N5-L-ion-net2.done b/shared/package-files/df/dfaf3378f24c5249e4da10572687ecac98d53a03d14a3ff89ade15b37bec968b/replays-5Ms-N5-L-ion-net2.done new file mode 100644 index 0000000000000000000000000000000000000000..2e8f5c12a189e1fff2e9dd092c445ded3eea6362 --- /dev/null +++ b/shared/package-files/df/dfaf3378f24c5249e4da10572687ecac98d53a03d14a3ff89ade15b37bec968b/replays-5Ms-N5-L-ion-net2.done @@ -0,0 +1 @@ +22:56:31 diff --git a/shared/package-files/df/dfc72b4aa314af95be8aef140b9c6a9a720a559f34ff6179fb35e435350c3ac9/corpus_footprint.py b/shared/package-files/df/dfc72b4aa314af95be8aef140b9c6a9a720a559f34ff6179fb35e435350c3ac9/corpus_footprint.py new file mode 100644 index 0000000000000000000000000000000000000000..c37776978f7fb6819ecb513217fe32555453a6fd --- /dev/null +++ b/shared/package-files/df/dfc72b4aa314af95be8aef140b9c6a9a720a559f34ff6179fb35e435350c3ac9/corpus_footprint.py @@ -0,0 +1,71 @@ +"""Does the supplied corpus carry a footprint of the held-out labels? (lab, E71; ANALYSIS ONLY - labels are read) + +corpus_footprint.py + +For (a) the validation labels (one per pool), (b) other validation candidates (5 per pool), (c) corpus structures +themselves (a random 3,386, the structure itself excluded): Tanimoto to the nearest corpus structure and the number of +corpus structures within Tanimoto 0.7 / 0.85. If the corpus was assembled around the benchmark's molecules and the +held-out ones were then removed, (a) sits in denser corpus neighbourhoods than (b) and even than (c). +A spectrum-free statistic of this kind is a label shortcut: never a feature, never a filter (E21 / E49). +""" +import sys +from pathlib import Path + +import numpy as np +import torch + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import netprop +import scorelab + +ROOT = netprop.ROOT + + +def stats(a, packed, device, exclude_self=False, chunk=40000): + a = a.to(device) + asum = a.sum(1) + top = torch.zeros(len(a), 2, device=device) + n7 = torch.zeros(len(a), device=device) + n85 = torch.zeros(len(a), device=device) + for low in range(0, len(packed), chunk): + b = torch.from_numpy(np.unpackbits(packed[low:low + chunk], axis=1)).to(device).float() + inter = a @ b.T + t = inter / (asum[:, None] + b.sum(1)[None, :] - inter).clamp_min(1.0) + top = torch.cat([top, t.topk(2, dim=1).values], 1).topk(2, dim=1).values + n7 += (t >= 0.7).sum(1) + n85 += (t >= 0.85).sum(1) + near = top[:, 1] if exclude_self else top[:, 0] + if exclude_self: + n7, n85 = n7 - 1, n85 - 1 + return near.cpu().numpy(), n7.cpu().numpy(), n85.cpu().numpy() + + +def main(): + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + store = np.load(ROOT / 'inv/pools-validation-input.npz') + sslot = {pid: n for n, pid in enumerate(store['pool_id'])} + starts, packed = store['pool_cand_start'], store['cand_fps'] + rng = np.random.default_rng(0) + lab, dec = [], [] + for pid, members in ev.by_pool.items(): + s, target = sslot[pid], int(ev.target[members[0]]) + size = int(starts[s + 1] - starts[s]) + lab.append(int(starts[s]) + target) + others = [n for n in range(size) if n != target] + dec += [int(starts[s]) + n for n in rng.permutation(others)[:5]] + corpus = np.load(ROOT / 'inv/synth.npz')['fps'] + device = torch.device('cuda') + unpack = lambda rows: torch.from_numpy(np.unpackbits(rows, axis=1).astype(np.float32)) + sample = np.sort(rng.permutation(len(corpus))[:len(lab)]) + print(f'corpus fingerprints {corpus.shape}') + for name, bits, self_in in (('(a) validation labels', unpack(packed[lab]), False), ('(b) other validation candidates', unpack(packed[dec]), False), + ('(c) corpus structures (self excluded)', unpack(corpus[sample]), True)): + near, n7, n85 = stats(bits, corpus, device, exclude_self=self_in) + print(f'{name}: {len(near)} | nearest corpus structure mean {near.mean():.3f} median {np.median(near):.3f} >= 0.7: {np.mean(near >= 0.7):.3f} ' + f'>= 0.85: {np.mean(near >= 0.85):.3f} | corpus structures within 0.7: mean {n7.mean():.1f} median {np.median(n7):.0f}; within 0.85: mean {n85.mean():.2f} ' + f'median {np.median(n85):.0f}', flush=True) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/df/dff81033da486741b50a1ea8eb5058eafc34f0d56b41cbef30e4ac1e1981ac38/eval-score-I9a.log b/shared/package-files/df/dff81033da486741b50a1ea8eb5058eafc34f0d56b41cbef30e4ac1e1981ac38/eval-score-I9a.log new file mode 100644 index 0000000000000000000000000000000000000000..50315b498a222694edee3ecdd0282890517a552d --- /dev/null +++ b/shared/package-files/df/dff81033da486741b50a1ea8eb5058eafc34f0d56b41cbef30e4ac1e1981ac38/eval-score-I9a.log @@ -0,0 +1,41 @@ +19429 queries, 1 members, 87.7 s +cos pool rule all=0.5643 dom=0.7953 non=0.3323 h5=0.6806 macro=0.6713 +cen pool rule all=0.5448 dom=0.7660 non=0.3227 h5=0.6692 macro=0.6382 +cos_pm pool rule all=0.5643 dom=0.7953 non=0.3323 h5=0.6806 macro=0.6713 +dot pool rule all=0.5503 dom=0.7443 non=0.3554 h5=0.6965 macro=0.6509 +geo pool rule all=0.5372 dom=0.7689 non=0.3047 h5=0.6596 macro=0.6571 +idf05 pool rule all=0.5756 dom=0.7974 non=0.3529 h5=0.6936 macro=0.6757 +idf1 pool rule all=0.5817 dom=0.8010 non=0.3614 h5=0.6941 macro=0.6763 +lin pool rule all=0.5177 dom=0.7252 non=0.3094 h5=0.6347 macro=0.6143 +log01 pool rule all=0.5710 dom=0.7978 non=0.3433 h5=0.6977 macro=0.6751 +log05 pool rule all=0.5796 dom=0.8107 non=0.3476 h5=0.7051 macro=0.6872 +log20 pool rule all=0.5767 dom=0.8065 non=0.3461 h5=0.6920 macro=0.6849 +nll02 pool rule all=0.4005 dom=0.6440 non=0.1561 h5=0.5516 macro=0.5121 +nll10 pool rule all=0.3568 dom=0.5764 non=0.1364 h5=0.4976 macro=0.4539 +poolcen pool rule all=0.5424 dom=0.7550 non=0.3290 h5=0.6712 macro=0.6320 +pow020 pool rule all=0.5260 dom=0.7455 non=0.3055 h5=0.6882 macro=0.6329 +pow030 pool rule all=0.5439 dom=0.7645 non=0.3223 h5=0.6886 macro=0.6471 +pow040 pool rule all=0.5615 dom=0.7839 non=0.3383 h5=0.6923 macro=0.6663 +pow05 pool rule all=0.5702 dom=0.7974 non=0.3421 h5=0.7051 macro=0.6787 +pow05idf025 pool rule all=0.5705 dom=0.7958 non=0.3443 h5=0.7101 macro=0.6790 +pow05idf05 pool rule all=0.5720 dom=0.7962 non=0.3469 h5=0.7116 macro=0.6807 +pow05m pool rule all=0.5702 dom=0.7974 non=0.3421 h5=0.7051 macro=0.6787 +pow05s pool rule all=0.5658 dom=0.7960 non=0.3347 h5=0.6995 macro=0.6784 +pow060 pool rule all=0.5733 dom=0.8031 non=0.3427 h5=0.6996 macro=0.6852 +pow060idf025 pool rule all=0.5762 dom=0.8052 non=0.3463 h5=0.7101 macro=0.6867 +pow060idf050 pool rule all=0.5786 dom=0.8039 non=0.3523 h5=0.7121 macro=0.6869 +pow060m pool rule all=0.5733 dom=0.8031 non=0.3427 h5=0.6996 macro=0.6852 +pow065 pool rule all=0.5741 dom=0.8055 non=0.3418 h5=0.6965 macro=0.6843 +pow070 pool rule all=0.5725 dom=0.8057 non=0.3384 h5=0.6964 macro=0.6840 +pow070idf025 pool rule all=0.5744 dom=0.8018 non=0.3461 h5=0.7012 macro=0.6846 +pow070idf050 pool rule all=0.5823 dom=0.8066 non=0.3572 h5=0.7026 macro=0.6864 +pow070m pool rule all=0.5725 dom=0.8057 non=0.3384 h5=0.6964 macro=0.6840 +pow075 pool rule all=0.5744 dom=0.8052 non=0.3427 h5=0.6944 macro=0.6831 +pow080 pool rule all=0.5710 dom=0.8009 non=0.3401 h5=0.6931 macro=0.6796 +pow080m pool rule all=0.5710 dom=0.8009 non=0.3401 h5=0.6931 macro=0.6796 +pow085 pool rule all=0.5698 dom=0.7977 non=0.3409 h5=0.6893 macro=0.6772 +pow085idf025 pool rule all=0.5716 dom=0.7996 non=0.3427 h5=0.6968 macro=0.6793 +pow085idf050 pool rule all=0.5788 dom=0.8004 non=0.3564 h5=0.6989 macro=0.6810 +pow090 pool rule all=0.5691 dom=0.7962 non=0.3412 h5=0.6870 macro=0.6760 +pow2 pool rule all=0.5154 dom=0.7389 non=0.2911 h5=0.6530 macro=0.6317 +tani pool rule all=0.5372 dom=0.7530 non=0.3205 h5=0.6708 macro=0.6488 diff --git a/shared/package-files/e5/e53af787da7efb49eb6ee4a82623bc3ca59c8633ca67c1d4e435534349418b51/metrics.jsonl b/shared/package-files/e5/e53af787da7efb49eb6ee4a82623bc3ca59c8633ca67c1d4e435534349418b51/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..93be164bc84d7030a90111d5979d3e9a17da9d60 --- /dev/null +++ b/shared/package-files/e5/e53af787da7efb49eb6ee4a82623bc3ca59c8633ca67c1d4e435534349418b51/metrics.jsonl @@ -0,0 +1,250 @@ +{"step": 200, "loss": 0.32976275082677603, "loss_real": 0.32846951570361854, "loss_synth": 0.3297327568754554, "lr": 5.999770185426209e-05, "elapsed": 17.031110554002225, "steps_per_second": 45.460283854514664, "loss_extra": 0.33001727556809785} +{"step": 400, "loss": 0.0483217784576118, "loss_real": 0.04416410641744733, "loss_synth": 0.04879937781020999, "lr": 0.0001199815230572914, "elapsed": 24.88678673398681, "steps_per_second": 32.63941532445958, "loss_extra": 0.04856850884854794} +{"step": 600, "loss": 0.04493691211566329, "loss_real": 0.03907118303701282, "loss_synth": 0.04547769932076335, "lr": 0.00017993754018322624, "elapsed": 30.493945249007083, "steps_per_second": 33.59033785280275, "loss_extra": 0.04541746148839593} +{"step": 800, "loss": 0.042861360665410755, "loss_real": 0.035634458716958764, "loss_synth": 0.04348146554082632, "lr": 0.0002398518371215969, "elapsed": 35.28670207806863, "steps_per_second": 35.31223660183702, "loss_extra": 0.043499402794986965} +{"step": 1000, "loss": 0.04181819444522262, "loss_real": 0.03414941349066794, "loss_synth": 0.04245721345767379, "lr": 0.0002997105087403322, "elapsed": 39.80044964503031, "steps_per_second": 36.80694722662366, "loss_extra": 0.042514169234782455} +{"step": 1200, "loss": 0.04092041555792093, "loss_real": 0.033373239571228626, "loss_synth": 0.04139288522303104, "lr": 0.00035949966454633923, "elapsed": 44.14137557602953, "steps_per_second": 38.08349897999173, "loss_extra": 0.041761108208447695} +{"step": 1400, "loss": 0.04009247114881873, "loss_real": 0.03253207035362721, "loss_synth": 0.04052872572094202, "lr": 0.0004192054323428467, "elapsed": 48.64767448406201, "steps_per_second": 38.87160328510463, "loss_extra": 0.04097152372822165} +{"step": 1600, "loss": 0.03944432932883501, "loss_real": 0.031614266503602266, "loss_synth": 0.03991061607375741, "lr": 0.0004788139618827038, "elapsed": 53.089424713049084, "steps_per_second": 39.54742049441929, "loss_extra": 0.04034032480791211} +{"step": 1800, "loss": 0.03878983546048403, "loss_real": 0.031132509782910347, "loss_synth": 0.03925074301660061, "lr": 0.000538311428516825, "elapsed": 57.43607461301144, "steps_per_second": 40.174617915343944, "loss_extra": 0.03966117773205042} +{"step": 2000, "loss": 0.038234465196728705, "loss_real": 0.030926217781379817, "loss_synth": 0.038620114773511884, "lr": 0.0005976840368369773, "elapsed": 61.77624104300048, "steps_per_second": 40.696251816975206, "loss_extra": 0.039120101407170295} +{"step": 2200, "loss": 0.03764698652550578, "loss_real": 0.030292854318395256, "loss_synth": 0.03793181288987398, "lr": 0.0005971982039200904, "elapsed": 66.0991930870805, "steps_per_second": 41.1464698492155, "loss_extra": 0.03864099046215415} +{"step": 2400, "loss": 0.03695655753836036, "loss_real": 0.029539038874208928, "loss_synth": 0.0372374240309, "lr": 0.000596666387431128, "elapsed": 70.41329273907468, "steps_per_second": 41.535694320762126, "loss_extra": 0.03796551622450352} +{"step": 2600, "loss": 0.03639219371601939, "loss_real": 0.029557178681716322, "loss_synth": 0.0366573473252356, "lr": 0.0005960886713500785, "elapsed": 74.42152103106491, "steps_per_second": 42.078104838334866, "loss_extra": 0.03731560146436095} +{"step": 2800, "loss": 0.035882795825600625, "loss_real": 0.028920982489362358, "loss_synth": 0.03608337208628654, "lr": 0.0005954651469050082, "elapsed": 78.4250984780956, "steps_per_second": 42.557439030295434, "loss_extra": 0.03689253609627485} +{"step": 3000, "loss": 0.03531682243570686, "loss_real": 0.028429124532267452, "loss_synth": 0.035504752527922394, "lr": 0.0005947959125576553, "elapsed": 82.35426111205015, "steps_per_second": 43.027658332923764, "loss_extra": 0.03632627919316292} +{"step": 3200, "loss": 0.03480588298290968, "loss_real": 0.027845512507483364, "loss_synth": 0.035031333155930044, "lr": 0.000594081073987881, "elapsed": 86.28739882004447, "steps_per_second": 43.4453621488857, "loss_extra": 0.035790604185312984} +{"step": 3400, "loss": 0.03442847840487957, "loss_real": 0.02783562014810741, "loss_synth": 0.034580776523798706, "lr": 0.0005933207440769824, "elapsed": 90.2655852260068, "steps_per_second": 43.79528978581332, "loss_extra": 0.035422194302082065} +{"step": 3600, "loss": 0.03404610129073262, "loss_real": 0.02775624381378293, "loss_synth": 0.034139674808830026, "lr": 0.0005925150428898661, "elapsed": 94.34534216602333, "steps_per_second": 44.05627260506718, "loss_extra": 0.035045653115957975} +{"step": 3800, "loss": 0.0337159688025713, "loss_real": 0.02724365453235805, "loss_synth": 0.03384689414873719, "lr": 0.0005916640976560898, "elapsed": 98.26083181402646, "steps_per_second": 44.3774028941578, "loss_extra": 0.0347100249864161} +{"step": 4000, "loss": 0.033379477206617596, "loss_real": 0.027097575683146715, "loss_synth": 0.03346300711855292, "lr": 0.0005907680427497705, "elapsed": 102.15766572102439, "steps_per_second": 44.67975786920057, "loss_extra": 0.03438764769583941} +{"step": 4200, "loss": 0.033024257887154816, "loss_real": 0.02677425689995289, "loss_synth": 0.0330900944583118, "lr": 0.000589827019668365, "elapsed": 110.32515680103097, "steps_per_second": 42.99160532474347, "loss_extra": 0.03404450452886522} +{"step": 4400, "loss": 0.03267066133208573, "loss_real": 0.026338828140869738, "loss_synth": 0.03276444640941918, "lr": 0.0005888411770103267, "elapsed": 118.6864060490625, "steps_per_second": 41.488008853512504, "loss_extra": 0.033677294179797174} +{"step": 4600, "loss": 0.03231557044200599, "loss_real": 0.026246934868395327, "loss_synth": 0.032379662320017814, "lr": 0.0005878106704516395, "elapsed": 125.09925660199951, "steps_per_second": 40.90067165366316, "loss_extra": 0.033306045606732365} +{"step": 4800, "loss": 0.03210261029191315, "loss_real": 0.025900021279230714, "loss_synth": 0.032145606772974136, "lr": 0.0005867356627212351, "elapsed": 130.43359353009146, "steps_per_second": 40.74636212125687, "loss_extra": 0.033137363344430924} +{"step": 5000, "loss": 0.031784708760678765, "loss_real": 0.02586121897213161, "loss_synth": 0.03173262894153595, "lr": 0.000585616323575296, "elapsed": 135.34661567304283, "steps_per_second": 40.74483192063285, "loss_extra": 0.03286564801819623} +{"step": 5200, "loss": 0.03156053920276463, "loss_real": 0.025646370900794864, "loss_synth": 0.03162117387168109, "lr": 0.000584452829770449, "elapsed": 140.9341917100828, "steps_per_second": 40.52920993425423, "loss_extra": 0.03252762150019407} +{"step": 5400, "loss": 0.03133612773381174, "loss_real": 0.025612108446657657, "loss_synth": 0.031290985448285936, "lr": 0.0005832453650358537, "elapsed": 145.72224493708927, "steps_per_second": 40.573871096550896, "loss_extra": 0.0323755044490099} +{"step": 5600, "loss": 0.03108859546482563, "loss_real": 0.02519034274853766, "loss_synth": 0.031051948498934508, "lr": 0.0005819941200441891, "elapsed": 150.34384919609874, "steps_per_second": 40.66452123584096, "loss_extra": 0.032149782422930005} +{"step": 5800, "loss": 0.03079347253777087, "loss_real": 0.025091472398489714, "loss_synth": 0.03070257930085063, "lr": 0.0005806992923815441, "elapsed": 154.96495494409464, "steps_per_second": 40.749427218091256, "loss_extra": 0.03187458148226142} +{"step": 6000, "loss": 0.030626190276816487, "loss_real": 0.025140027003362774, "loss_synth": 0.03055141490884125, "lr": 0.0005793610865162167, "elapsed": 159.7463634540327, "steps_per_second": 40.78450405261413, "loss_extra": 0.03165375264361501} +{"step": 6200, "loss": 0.030417811367660762, "loss_real": 0.02496577363461256, "loss_synth": 0.030342680709436534, "lr": 0.0005779797137664262, "elapsed": 164.27421540406067, "steps_per_second": 40.885622268797974, "loss_extra": 0.031439798707142474} +{"step": 6400, "loss": 0.03030527029186487, "loss_real": 0.024815607173368334, "loss_synth": 0.03019180217757821, "lr": 0.0005765553922669433, "elapsed": 168.6256625900278, "steps_per_second": 41.02721987140838, "loss_extra": 0.03137196935713291} +{"step": 6600, "loss": 0.030087767243385313, "loss_real": 0.02458820284344256, "loss_synth": 0.030045688273385166, "lr": 0.0005750883469346437, "elapsed": 172.87424424709752, "steps_per_second": 41.18755491269524, "loss_extra": 0.03108509977348149} +{"step": 6800, "loss": 0.029870482087135317, "loss_real": 0.024541703229770066, "loss_synth": 0.029824570175260304, "lr": 0.000573578809432992, "elapsed": 176.79783612303436, "steps_per_second": 41.421445079554964, "loss_extra": 0.03084196069277823} +{"step": 7000, "loss": 0.029664983991533517, "loss_real": 0.024035508828237653, "loss_synth": 0.02963405169546604, "lr": 0.000572027018135459, "elapsed": 180.85063655208796, "steps_per_second": 41.61242917338424, "loss_extra": 0.030673786168918013} +{"step": 7200, "loss": 0.029533106675371526, "loss_real": 0.0243404093477875, "loss_synth": 0.029398832209408282, "lr": 0.0005704332180878793, "elapsed": 184.84232089703437, "steps_per_second": 41.80925954918589, "loss_extra": 0.03056893212720752} +{"step": 7400, "loss": 0.02936099032871425, "loss_real": 0.024020049376413225, "loss_synth": 0.029161616610363126, "lr": 0.0005687976609697565, "elapsed": 188.8054766220739, "steps_per_second": 42.00397293323725, "loss_extra": 0.030487393559888006} +{"step": 7600, "loss": 0.02925460545346141, "loss_real": 0.02414707305841148, "loss_synth": 0.029131268374621867, "lr": 0.0005671206050545193, "elapsed": 192.72362824203447, "steps_per_second": 42.20066179488184, "loss_extra": 0.030264744628220798} +{"step": 7800, "loss": 0.02907499994151294, "loss_real": 0.023922952692955732, "loss_synth": 0.028871816443279387, "lr": 0.000565402315168738, "elapsed": 196.63905577501282, "steps_per_second": 42.38960185703367, "loss_extra": 0.030172380562871696} +{"step": 8000, "loss": 0.02890219216234982, "loss_real": 0.023931962186470628, "loss_synth": 0.02862156313844025, "lr": 0.0005636430626503045, "elapsed": 200.6485342080705, "steps_per_second": 42.54937373096015, "loss_extra": 0.030045103393495084} +{"step": 8200, "loss": 0.028840453904122113, "loss_real": 0.0236294405721128, "loss_synth": 0.028644925132393837, "lr": 0.0005618431253055855, "elapsed": 206.88798763102386, "steps_per_second": 42.212268429547954, "loss_extra": 0.02994045628234744} +{"step": 8400, "loss": 0.028633827148005365, "loss_real": 0.023361423276364802, "loss_synth": 0.028526388024911285, "lr": 0.000560002787365553, "elapsed": 217.19937681406736, "steps_per_second": 41.06219866121876, "loss_extra": 0.029656778508797287} +{"step": 8600, "loss": 0.028461356442421676, "loss_real": 0.023477479219436645, "loss_synth": 0.028247047383338213, "lr": 0.0005581223394409018, "elapsed": 226.07106844405644, "steps_per_second": 40.292466631439495, "loss_extra": 0.02954059964977205} +{"step": 8800, "loss": 0.028410615185275673, "loss_real": 0.02354942575097084, "loss_synth": 0.028222394725307822, "lr": 0.0005562020784761579, "elapsed": 233.04415901808534, "steps_per_second": 39.92514161675041, "loss_extra": 0.029442565655335783} +{"step": 9000, "loss": 0.0282310048956424, "loss_real": 0.023226453699171545, "loss_synth": 0.0279868277348578, "lr": 0.0005542423077027882, "elapsed": 238.95166155602783, "steps_per_second": 39.76670280273373, "loss_extra": 0.029343581115826963} +{"step": 9200, "loss": 0.028174719670787454, "loss_real": 0.0234617078024894, "loss_synth": 0.027938443748280407, "lr": 0.0005522433365913161, "elapsed": 244.1199714570539, "steps_per_second": 39.74282838925673, "loss_extra": 0.02922877924516797} +{"step": 9400, "loss": 0.02801460023969412, "loss_real": 0.023041010797023774, "loss_synth": 0.027809769688174127, "lr": 0.0005502054808024529, "elapsed": 249.17357583506964, "steps_per_second": 39.739258022218415, "loss_extra": 0.029082617545500396} +{"step": 9600, "loss": 0.027904341705143453, "loss_real": 0.02323754389770329, "loss_synth": 0.027659395569935442, "lr": 0.0005481290621372514, "elapsed": 254.09708476800006, "steps_per_second": 39.757245759522114, "loss_extra": 0.028959006229415538} +{"step": 9800, "loss": 0.027819879269227386, "loss_real": 0.02289307404309511, "loss_synth": 0.02758670656941831, "lr": 0.000546014408486289, "elapsed": 258.98469632607885, "steps_per_second": 39.780310315612454, "loss_extra": 0.028907990949228406} +{"step": 10000, "loss": 0.027636079173535107, "loss_real": 0.022686974499374627, "loss_synth": 0.027410099944099785, "lr": 0.0005438618537778916, "elapsed": 263.7339380350895, "steps_per_second": 39.824410626321544, "loss_extra": 0.02872090178541839} +{"step": 10200, "loss": 0.02759311973117292, "loss_real": 0.02288196732290089, "loss_synth": 0.02730077998712659, "lr": 0.0005416717379254006, "elapsed": 281.96547568100505, "steps_per_second": 37.871220104580686, "loss_extra": 0.028702682349830866} +{"step": 10400, "loss": 0.02739587761461735, "loss_real": 0.02251831063069403, "loss_synth": 0.02713680000975728, "lr": 0.0005394444067734975, "elapsed": 286.58218874502927, "steps_per_second": 37.96305949378193, "loss_extra": 0.028501230590045452} +{"step": 10600, "loss": 0.027266478706151245, "loss_real": 0.022493819184601308, "loss_synth": 0.027030946211889385, "lr": 0.0005371802120435915, "elapsed": 290.9519980500918, "steps_per_second": 38.08561130567177, "loss_extra": 0.02833016062155366} +{"step": 10800, "loss": 0.027153028501197697, "loss_real": 0.022538050701841714, "loss_synth": 0.026966314064338803, "lr": 0.0005348795112782779, "elapsed": 295.05155317799654, "steps_per_second": 38.24093299906257, "loss_extra": 0.028140705227851868} +{"step": 11000, "loss": 0.027071445509791375, "loss_real": 0.022015789113938807, "loss_synth": 0.026803108528256417, "lr": 0.0005325426677848778, "elapsed": 298.9842743379995, "steps_per_second": 38.41417772149998, "loss_extra": 0.02821695783175528} +{"step": 11200, "loss": 0.02709555733948946, "loss_real": 0.022561002308502793, "loss_synth": 0.026818872736766933, "lr": 0.0005301700505780687, "elapsed": 302.928194112028, "steps_per_second": 38.58123991205158, "loss_extra": 0.02815885159187019} +{"step": 11400, "loss": 0.027012054836377503, "loss_real": 0.022088009286671876, "loss_synth": 0.026881054025143385, "lr": 0.0005277620343216117, "elapsed": 306.9427150110714, "steps_per_second": 38.73452943188412, "loss_extra": 0.027997947931289673} +{"step": 11600, "loss": 0.026879986077547074, "loss_real": 0.02211715405806899, "loss_synth": 0.026541970325633883, "lr": 0.0005253189992691882, "elapsed": 310.8614769720007, "steps_per_second": 38.89617860350412, "loss_extra": 0.028044010000303387} +{"step": 11800, "loss": 0.026856902688741684, "loss_real": 0.022200489239767193, "loss_synth": 0.026502268156036735, "lr": 0.0005228413312043536, "elapsed": 314.76918680104427, "steps_per_second": 39.05506325568704, "loss_extra": 0.02801898704841733} +{"step": 12000, "loss": 0.026717549450695516, "loss_real": 0.02193714781664312, "loss_synth": 0.0264333572704345, "lr": 0.0005203294213796174, "elapsed": 318.7020638100803, "steps_per_second": 39.20666636912292, "loss_extra": 0.027831030013039708} +{"step": 12200, "loss": 0.026642565419897436, "loss_real": 0.022118805022910238, "loss_synth": 0.026336888195946814, "lr": 0.0005177836664546598, "elapsed": 322.6331269569928, "steps_per_second": 39.35465319908419, "loss_extra": 0.027732853954657914} +{"step": 12400, "loss": 0.026508710868656634, "loss_real": 0.02175537365488708, "loss_synth": 0.02623159940354526, "lr": 0.000515204468433695, "elapsed": 326.5127376540331, "steps_per_second": 39.50540861604861, "loss_extra": 0.02761043895035982} +{"step": 12600, "loss": 0.02646989935077727, "loss_real": 0.021783158387988805, "loss_synth": 0.026180828604847193, "lr": 0.0005125922346019892, "elapsed": 330.39577111403923, "steps_per_second": 39.65205566518361, "loss_extra": 0.027571966359391808} +{"step": 12800, "loss": 0.026451794886961578, "loss_real": 0.02167698595672846, "loss_synth": 0.026155567253008483, "lr": 0.0005099473774615467, "elapsed": 334.3384430860169, "steps_per_second": 39.78778472221155, "loss_extra": 0.0275762880500406} +{"step": 13000, "loss": 0.026280891867354512, "loss_real": 0.021460177036933602, "loss_synth": 0.025847488148137927, "lr": 0.00050727031466597, "elapsed": 338.22930656408425, "steps_per_second": 39.926579200009506, "loss_extra": 0.027549955360591412} +{"step": 13200, "loss": 0.0261535660084337, "loss_real": 0.021605754285119474, "loss_synth": 0.025800960306078195, "lr": 0.000504561468954508, "elapsed": 342.1220061390195, "steps_per_second": 40.061872476551045, "loss_extra": 0.027294762432575226} +{"step": 13400, "loss": 0.026121258847415448, "loss_real": 0.02141550070606172, "loss_synth": 0.025765798026695846, "lr": 0.0005018212680853004, "elapsed": 346.07479435100686, "steps_per_second": 40.1867630487402, "loss_extra": 0.0272927385289222} +{"step": 13600, "loss": 0.026017362317070365, "loss_real": 0.021607420155778528, "loss_synth": 0.025782326301559806, "lr": 0.0004990501447678302, "elapsed": 349.9783189020818, "steps_per_second": 40.31461369530808, "loss_extra": 0.027017535464838146} +{"step": 13800, "loss": 0.02593437167815864, "loss_real": 0.021245505213737487, "loss_synth": 0.02564612635411322, "lr": 0.0004962485365945929, "elapsed": 353.8664063680917, "steps_per_second": 40.44136884662294, "loss_extra": 0.02703598603606224} +{"step": 14000, "loss": 0.025997749334201216, "loss_real": 0.021382090728729965, "loss_synth": 0.025750940181314946, "lr": 0.0004934168859719962, "elapsed": 357.7588851150358, "steps_per_second": 40.564751821685114, "loss_extra": 0.02704538490623236} +{"step": 14200, "loss": 0.025812973910942675, "loss_real": 0.020861048838123678, "loss_synth": 0.025525457402691246, "lr": 0.0004905556400504991, "elapsed": 361.69131474907044, "steps_per_second": 40.68072605393173, "loss_extra": 0.0269595633354038} +{"step": 14400, "loss": 0.02582327723503113, "loss_real": 0.02120501275639981, "loss_synth": 0.025572082316502927, "lr": 0.0004876652506540011, "elapsed": 365.5680649720598, "steps_per_second": 40.80055228828422, "loss_extra": 0.026875732578337194} +{"step": 14600, "loss": 0.02567221099510789, "loss_real": 0.02112709801644087, "loss_synth": 0.02536412694491446, "lr": 0.00048474617420849446, "elapsed": 369.44217127899174, "steps_per_second": 40.9180777280798, "loss_extra": 0.026768605513498186} +{"step": 14800, "loss": 0.02563432808034122, "loss_real": 0.0209997334331274, "loss_synth": 0.025415425123646855, "lr": 0.000481798871669989, "elapsed": 373.3838371820748, "steps_per_second": 41.02539407585496, "loss_extra": 0.026657465109601618} +{"step": 15000, "loss": 0.0255383937433362, "loss_real": 0.02078501553274691, "loss_synth": 0.025233636749908327, "lr": 0.00047882380845172155, "elapsed": 377.26489006599877, "steps_per_second": 41.13722778071188, "loss_extra": 0.02666765721514821} +{"step": 15200, "loss": 0.025476775355637072, "loss_real": 0.020752578866668047, "loss_synth": 0.025225880285725, "lr": 0.0004758214543506626, "elapsed": 382.18155702902004, "steps_per_second": 41.13111748170246, "loss_extra": 0.026547335740178823} +{"step": 15400, "loss": 0.025467383777722716, "loss_real": 0.020803941166959702, "loss_synth": 0.0251290628220886, "lr": 0.0004727922834733288, "elapsed": 386.2277553899912, "steps_per_second": 41.22098819752489, "loss_extra": 0.026614444572478534} +{"step": 15600, "loss": 0.02543447630479932, "loss_real": 0.020592657760716976, "loss_synth": 0.025165995340794323, "lr": 0.0004697367741609171, "elapsed": 390.18689584103413, "steps_per_second": 41.31845817117567, "loss_extra": 0.0265429821703583} +{"step": 15800, "loss": 0.025288246218115092, "loss_real": 0.020651705712080002, "loss_synth": 0.024982276763767006, "lr": 0.0004666554089137685, "elapsed": 394.43242202699184, "steps_per_second": 41.38284101322234, "loss_extra": 0.026398418983444572} +{"step": 16000, "loss": 0.025316761769354344, "loss_real": 0.020866886638104917, "loss_synth": 0.025033629238605498, "lr": 0.00046354867431517584, "elapsed": 398.6394768340979, "steps_per_second": 41.44993842380297, "loss_extra": 0.026371764959767462} +{"step": 16200, "loss": 0.025129200452938677, "loss_real": 0.020429213349707424, "loss_synth": 0.024820850575342775, "lr": 0.0004604170609545466, "elapsed": 402.88826111808885, "steps_per_second": 41.511149797832616, "loss_extra": 0.026252766447141765} +{"step": 16400, "loss": 0.025103362472727896, "loss_real": 0.020270967143587768, "loss_synth": 0.024755627745762468, "lr": 0.00045726106334993325, "elapsed": 406.81896577600855, "steps_per_second": 41.604587467368745, "loss_extra": 0.026289149252697826} +{"step": 16600, "loss": 0.025125432955101133, "loss_real": 0.020522818453609943, "loss_synth": 0.024745884612202645, "lr": 0.0004540811798699431, "elapsed": 410.9896543220384, "steps_per_second": 41.67106085985134, "loss_extra": 0.026302979225292802} +{"step": 16800, "loss": 0.024986401638016104, "loss_real": 0.020436308356001975, "loss_synth": 0.024642603807151317, "lr": 0.00045087791265504006, "elapsed": 415.43460297898855, "steps_per_second": 41.7077394977992, "loss_extra": 0.02611922430805862} +{"step": 17000, "loss": 0.025019323527812956, "loss_real": 0.020413957107812165, "loss_synth": 0.024594945181161166, "lr": 0.0004476517675382507, "elapsed": 419.41129577707034, "steps_per_second": 41.79166985627109, "loss_extra": 0.02624198788776994} +{"step": 17200, "loss": 0.024874989679083227, "loss_real": 0.020345898605883123, "loss_synth": 0.02461861471645534, "lr": 0.00044440325396528766, "elapsed": 423.3206355490256, "steps_per_second": 41.88084235663661, "loss_extra": 0.025917111048474908} +{"step": 17400, "loss": 0.02487649742513895, "loss_real": 0.02036756141576916, "loss_synth": 0.024535880135372282, "lr": 0.00044113288491410207, "elapsed": 427.2207786249928, "steps_per_second": 41.96926413294836, "loss_extra": 0.025999002698808907} +{"step": 17600, "loss": 0.024791265623643994, "loss_real": 0.020080357221886516, "loss_synth": 0.024551168037578463, "lr": 0.00043784117681387844, "elapsed": 431.207660051994, "steps_per_second": 42.04732294556004, "loss_extra": 0.025848765643313527} +{"step": 17800, "loss": 0.024757437566295268, "loss_real": 0.02008690374903381, "loss_synth": 0.02432665300555527, "lr": 0.00043452864946348456, "elapsed": 435.1007676500594, "steps_per_second": 42.13325877734813, "loss_extra": 0.02599780189804733} +{"step": 18000, "loss": 0.02469447745010257, "loss_real": 0.020189288086257876, "loss_synth": 0.02437415612861514, "lr": 0.00043119582594938896, "elapsed": 438.9884544759989, "steps_per_second": 42.21816206366716, "loss_extra": 0.025796122113242746} +{"step": 18200, "loss": 0.024623901955783366, "loss_real": 0.0201289399061352, "loss_synth": 0.024283061139285564, "lr": 0.0004278432325630599, "elapsed": 442.90269092610106, "steps_per_second": 42.298920740730125, "loss_extra": 0.025744202239438893} +{"step": 18400, "loss": 0.024712778944522142, "loss_real": 0.020109047135338187, "loss_synth": 0.024361864514648914, "lr": 0.00042447139871785766, "elapsed": 446.8295447230339, "steps_per_second": 42.37699192171681, "loss_extra": 0.025862006433308125} +{"step": 18600, "loss": 0.024558293148875237, "loss_real": 0.019660592335276304, "loss_synth": 0.024184169620275496, "lr": 0.0004210808568654337, "elapsed": 450.722629341064, "steps_per_second": 42.45693601714737, "loss_extra": 0.025781702483072877} +{"step": 18800, "loss": 0.02451483394019306, "loss_real": 0.019696607189252972, "loss_synth": 0.024180769640952348, "lr": 0.00041767214241165117, "elapsed": 454.6176951910602, "steps_per_second": 42.53528111319715, "loss_extra": 0.025684546642005444} +{"step": 19000, "loss": 0.02443692596629262, "loss_real": 0.019291572882793845, "loss_synth": 0.024156804513186216, "lr": 0.00041424579363203725, "elapsed": 458.57545055507217, "steps_per_second": 42.606267105452936, "loss_extra": 0.025609755953773856} +{"step": 19200, "loss": 0.02443397763185203, "loss_real": 0.019544229293242097, "loss_synth": 0.024132206169888377, "lr": 0.00041080235158678376, "elapsed": 462.4801772570936, "steps_per_second": 42.681034880435135, "loss_extra": 0.025583959789946674} +{"step": 19400, "loss": 0.02436562883667648, "loss_real": 0.019902126267552375, "loss_synth": 0.02402794807218015, "lr": 0.00040734236003530744, "elapsed": 466.3808798920363, "steps_per_second": 42.754894978698466, "loss_extra": 0.02547731707803905} +{"step": 19600, "loss": 0.024332425948232414, "loss_real": 0.02005597610026598, "loss_synth": 0.02396411974914372, "lr": 0.0004038663653503835, "elapsed": 470.3512226080056, "steps_per_second": 42.82098001671227, "loss_extra": 0.02544211322441697} +{"step": 19800, "loss": 0.024295396571978926, "loss_real": 0.01965409690514207, "loss_synth": 0.023940779278054835, "lr": 0.000400374916431868, "elapsed": 474.2593152699992, "steps_per_second": 42.891711610376476, "loss_extra": 0.025454837726429105} +{"step": 20000, "loss": 0.024212060403078793, "loss_real": 0.019649211848154664, "loss_synth": 0.023826989326626063, "lr": 0.00039686856462001896, "elapsed": 478.157181121991, "steps_per_second": 42.962199353185994, "loss_extra": 0.025388197135180236} +{"step": 20200, "loss": 0.02419889804907143, "loss_real": 0.01946142753586173, "loss_synth": 0.0238968732021749, "lr": 0.00039334786360843476, "elapsed": 494.1225512640085, "steps_per_second": 41.95302677340221, "loss_extra": 0.025322677418589592} +{"step": 20400, "loss": 0.024135687639936804, "loss_real": 0.01961789289023727, "loss_synth": 0.023716649441048503, "lr": 0.00038981336935661813, "elapsed": 498.0806627130369, "steps_per_second": 42.0229522144591, "loss_extra": 0.025337820602580906} +{"step": 20600, "loss": 0.024146906398236752, "loss_real": 0.019438161905854942, "loss_synth": 0.02377283016219735, "lr": 0.00038626564000218466, "elapsed": 501.91393881104887, "steps_per_second": 42.10248591107117, "loss_extra": 0.02533744121901691} +{"step": 20800, "loss": 0.024024555180221795, "loss_real": 0.0193562564952299, "loss_synth": 0.023652495658025144, "lr": 0.00038270523577272616, "elapsed": 505.70533091109246, "steps_per_second": 42.184366106722294, "loss_extra": 0.025206055343151092} +{"step": 21000, "loss": 0.023989041792228816, "loss_real": 0.019223362668417395, "loss_synth": 0.02368789356201887, "lr": 0.0003791327188973438, "elapsed": 509.54290796106216, "steps_per_second": 42.26106840648517, "loss_extra": 0.025116848926991224} +{"step": 21200, "loss": 0.023947172183543444, "loss_real": 0.019295102073810994, "loss_synth": 0.023561738124117257, "lr": 0.00037554865351786614, "elapsed": 513.3535987040959, "steps_per_second": 42.33886835673607, "loss_extra": 0.025139170875772835} +{"step": 21400, "loss": 0.02394954881630838, "loss_real": 0.019324555611237883, "loss_synth": 0.023619003538042308, "lr": 0.00037195360559976446, "elapsed": 517.1479711399879, "steps_per_second": 42.41686497177327, "loss_extra": 0.02508218719623983} +{"step": 21600, "loss": 0.0238877984136343, "loss_real": 0.01911953045986593, "loss_synth": 0.02351696031168103, "lr": 0.0003683481428427801, "elapsed": 520.9707316560671, "steps_per_second": 42.49132411091582, "loss_extra": 0.02508544965647161} +{"step": 21800, "loss": 0.023867750773206353, "loss_real": 0.019250172725878655, "loss_synth": 0.023518703700974582, "lr": 0.0003647328345912784, "elapsed": 524.8883264450124, "steps_per_second": 42.55679168936259, "loss_extra": 0.02501752438955009} +{"step": 22000, "loss": 0.02388220059685409, "loss_real": 0.019088708120398222, "loss_synth": 0.023602277515456082, "lr": 0.0003611082517443419, "elapsed": 528.7701195110567, "steps_per_second": 42.62422191420682, "loss_extra": 0.024993704752996563} +{"step": 22200, "loss": 0.02371380416676402, "loss_real": 0.018898611464537682, "loss_synth": 0.023357422221452, "lr": 0.00035747496666562, "elapsed": 532.7130327530904, "steps_per_second": 42.68562847886937, "loss_extra": 0.024905212754383683} +{"step": 22400, "loss": 0.02371080657467246, "loss_real": 0.018930793828330933, "loss_synth": 0.02333616110496223, "lr": 0.00035383355309294483, "elapsed": 536.6712755149929, "steps_per_second": 42.744860487403535, "loss_extra": 0.02491428923793137} +{"step": 22600, "loss": 0.023756218375638127, "loss_real": 0.019019112400710584, "loss_synth": 0.023395011238753795, "lr": 0.00035018458604773206, "elapsed": 540.6151937310351, "steps_per_second": 42.80436568193424, "loss_extra": 0.024938865983858704} +{"step": 22800, "loss": 0.023630442963913083, "loss_real": 0.01885869340505451, "loss_synth": 0.023262380585074426, "lr": 0.0003465286417441785, "elapsed": 544.4500957319979, "steps_per_second": 42.87177488335236, "loss_extra": 0.024825935391709207} +{"step": 23000, "loss": 0.023601216319948434, "loss_real": 0.018904488366097212, "loss_synth": 0.02326184757053852, "lr": 0.0003428662974982705, "elapsed": 548.3883540550014, "steps_per_second": 42.92993535362351, "loss_extra": 0.02475510318763554} +{"step": 23200, "loss": 0.023552885074168445, "loss_real": 0.019079802101477982, "loss_synth": 0.023140925690531732, "lr": 0.00033919813163662, "elapsed": 552.6216662650695, "steps_per_second": 42.96375855542623, "loss_extra": 0.024740201318636537} +{"step": 23400, "loss": 0.023501093657687308, "loss_real": 0.01881150435190648, "loss_synth": 0.023192870216444134, "lr": 0.000335524723405139, "elapsed": 556.7328239870258, "steps_per_second": 43.00670864179175, "loss_extra": 0.024622727064415813} +{"step": 23600, "loss": 0.023462201990187167, "loss_real": 0.01894935346674174, "loss_synth": 0.02315195850096643, "lr": 0.00033184665287757097, "elapsed": 560.7510673489887, "steps_per_second": 43.05631204922635, "loss_extra": 0.024555141786113382} +{"step": 23800, "loss": 0.023492643516510724, "loss_real": 0.018844916578382255, "loss_synth": 0.023070414792746307, "lr": 0.0003281645008638895, "elapsed": 565.1106843410525, "steps_per_second": 43.078558992105734, "loss_extra": 0.02472052621655166} +{"step": 24000, "loss": 0.023440603744238616, "loss_real": 0.01872077280655503, "loss_synth": 0.0231120197288692, "lr": 0.0003244788488185826, "elapsed": 569.4553231920581, "steps_per_second": 43.10161698136432, "loss_extra": 0.024587765047326685} +{"step": 24200, "loss": 0.02335562838241458, "loss_real": 0.018564776303246617, "loss_synth": 0.02302696199156344, "lr": 0.00032079027874883385, "elapsed": 573.8457857000176, "steps_per_second": 43.12079676655858, "loss_extra": 0.024515210669487714} +{"step": 24400, "loss": 0.023413651892915367, "loss_real": 0.018686243831180036, "loss_synth": 0.023012019945308566, "lr": 0.00031709937312261613, "elapsed": 577.9209930660436, "steps_per_second": 43.163737247975476, "loss_extra": 0.02463486824184656} +{"step": 24600, "loss": 0.023233426520600915, "loss_real": 0.018465517396107314, "loss_synth": 0.022942636692896486, "lr": 0.0003134067147767145, "elapsed": 581.9530678190058, "steps_per_second": 43.2093364360634, "loss_extra": 0.02435130696743727} +{"step": 24800, "loss": 0.023233346343040466, "loss_real": 0.018639008137397467, "loss_synth": 0.022848951658234, "lr": 0.0003097128868246881, "elapsed": 585.9395153410733, "steps_per_second": 43.257736652644176, "loss_extra": 0.02441428041085601} +{"step": 25000, "loss": 0.023171330047771336, "loss_real": 0.018261961238458753, "loss_synth": 0.022761962302029135, "lr": 0.0003060184725647909, "elapsed": 590.1333126480458, "steps_per_second": 43.28991981812478, "loss_extra": 0.02443186115473509} +{"step": 25200, "loss": 0.023202653406187893, "loss_real": 0.01852320528589189, "loss_synth": 0.022890110462903977, "lr": 0.0003023240553878617, "elapsed": 595.0810261550359, "steps_per_second": 43.26556386954055, "loss_extra": 0.024326826268807052} +{"step": 25400, "loss": 0.02316916413605213, "loss_real": 0.01831231259275228, "loss_synth": 0.022789914421737195, "lr": 0.0002986302186851996, "elapsed": 599.136154428008, "steps_per_second": 43.30742645547483, "loss_extra": 0.02439058115705848} +{"step": 25600, "loss": 0.023181168027222157, "loss_real": 0.018298263172619046, "loss_synth": 0.022790911449119447, "lr": 0.00029493754575644036, "elapsed": 603.1307664830238, "steps_per_second": 43.35315656956672, "loss_extra": 0.024418071424588562} +{"step": 25800, "loss": 0.02312633176334202, "loss_real": 0.018170267837122084, "loss_synth": 0.022719805892556906, "lr": 0.0002912466197174462, "elapsed": 607.2047940370394, "steps_per_second": 43.39247566909821, "loss_extra": 0.024392145555466413} +{"step": 26000, "loss": 0.022996839778497816, "loss_real": 0.01833499959204346, "loss_synth": 0.02248075243085623, "lr": 0.00028755802340822527, "elapsed": 611.1760401839856, "steps_per_second": 43.4387175000982, "loss_extra": 0.02432063568383455} +{"step": 26200, "loss": 0.022936660684645175, "loss_real": 0.0182442290475592, "loss_synth": 0.022660769764333965, "lr": 0.0002838723393008943, "elapsed": 615.1643743790919, "steps_per_second": 43.483116564398394, "loss_extra": 0.024026592317968606} +{"step": 26400, "loss": 0.02304671548306942, "loss_real": 0.018250174163840713, "loss_synth": 0.022725530453026294, "lr": 0.00028019014940769974, "elapsed": 619.2174428050639, "steps_per_second": 43.522286542463156, "loss_extra": 0.024199836384505034} +{"step": 26600, "loss": 0.022995955599471925, "loss_real": 0.018135596266947687, "loss_synth": 0.02269276580773294, "lr": 0.000276512035189111, "elapsed": 623.2140699190786, "steps_per_second": 43.564963266083936, "loss_extra": 0.024142244756221773} +{"step": 26800, "loss": 0.02291788031347096, "loss_real": 0.018195887636393307, "loss_synth": 0.022538422765210273, "lr": 0.00027283857746200125, "elapsed": 627.2071396380197, "steps_per_second": 43.60733732780615, "loss_extra": 0.024116075159981848} +{"step": 27000, "loss": 0.022955230642110108, "loss_real": 0.01810132658109069, "loss_synth": 0.022544809179380537, "lr": 0.0002691703563079296, "elapsed": 631.2796026460128, "steps_per_second": 43.64356267585248, "loss_extra": 0.024207175290212036} +{"step": 27200, "loss": 0.022824345044791697, "loss_real": 0.018171768505126237, "loss_synth": 0.022510562324896455, "lr": 0.0002655079509815397, "elapsed": 635.2932827910408, "steps_per_second": 43.68343775513382, "loss_extra": 0.02394508364610374} +{"step": 27400, "loss": 0.02278419098816812, "loss_real": 0.01791084723547101, "loss_synth": 0.022501905411481858, "lr": 0.00026185193981908867, "elapsed": 639.2749785709893, "steps_per_second": 43.725033733199645, "loss_extra": 0.02391191984526813} +{"step": 27600, "loss": 0.02275374988093972, "loss_real": 0.01782552111893892, "loss_synth": 0.022372922822833062, "lr": 0.0002582029001471206, "elapsed": 643.2890530060977, "steps_per_second": 43.76385744751427, "loss_extra": 0.023989138025790453} +{"step": 27800, "loss": 0.02277284687384963, "loss_real": 0.01796957849059254, "loss_synth": 0.022415992356836795, "lr": 0.00025456140819130085, "elapsed": 647.3402030850993, "steps_per_second": 43.799631432964865, "loss_extra": 0.023962654611095785} +{"step": 28000, "loss": 0.022725414577871562, "loss_real": 0.018003814332187177, "loss_synth": 0.022391164405271412, "lr": 0.0002509280389854229, "elapsed": 651.3647002330981, "steps_per_second": 43.836780756504865, "loss_extra": 0.023878525458276272} +{"step": 28200, "loss": 0.022704355996102096, "loss_real": 0.017898795465007424, "loss_synth": 0.02235411502420902, "lr": 0.00024730336628060344, "elapsed": 655.3392475260189, "steps_per_second": 43.876874585629366, "loss_extra": 0.023887976240366697} +{"step": 28400, "loss": 0.022658043801784516, "loss_real": 0.017923292932100595, "loss_synth": 0.02230403940193355, "lr": 0.00024368796245468133, "elapsed": 659.4294983950676, "steps_per_second": 43.90861960195176, "loss_extra": 0.023833109894767404} +{"step": 28600, "loss": 0.022677186643704772, "loss_real": 0.017861318285577, "loss_synth": 0.02228608929552138, "lr": 0.00024008239842183163, "elapsed": 663.4096237510676, "steps_per_second": 43.94740115889029, "loss_extra": 0.023903280990198256} +{"step": 28800, "loss": 0.022617026017978787, "loss_real": 0.017835176163353027, "loss_synth": 0.02228928473778069, "lr": 0.00023648724354241227, "elapsed": 667.4144647720968, "steps_per_second": 43.984050974578444, "loss_extra": 0.02377412318252027} +{"step": 29000, "loss": 0.02258732883259654, "loss_real": 0.017741345157846807, "loss_synth": 0.022239918131381275, "lr": 0.00023290306553305494, "elapsed": 671.4627950410359, "steps_per_second": 44.017349370478755, "loss_extra": 0.023775153765454887} +{"step": 29200, "loss": 0.022588405031710862, "loss_real": 0.017719943751581015, "loss_synth": 0.02224988675676286, "lr": 0.00022933043037701642, "elapsed": 675.6343110750895, "steps_per_second": 44.0420565017612, "loss_extra": 0.023771280143409967} +{"step": 29400, "loss": 0.022512127831578254, "loss_real": 0.017852635155431926, "loss_synth": 0.022073932699859144, "lr": 0.00022576990223480343, "elapsed": 679.6084870960331, "steps_per_second": 44.07949279389388, "loss_extra": 0.02375795356929302} +{"step": 29600, "loss": 0.022485565869137646, "loss_real": 0.017722749626263978, "loss_synth": 0.022186878453940153, "lr": 0.00022222204335508425, "elapsed": 683.7935517840087, "steps_per_second": 44.102623543848395, "loss_extra": 0.023610425405204295} +{"step": 29800, "loss": 0.022506023980677126, "loss_real": 0.017909937324002385, "loss_synth": 0.022097858088091015, "lr": 0.00021868741398590414, "elapsed": 687.8337880130857, "steps_per_second": 44.13493232549749, "loss_extra": 0.023710932284593582} +{"step": 30000, "loss": 0.022517510699108245, "loss_real": 0.017520571365021168, "loss_synth": 0.02223350134678185, "lr": 0.00021516657228621528, "elapsed": 691.8416516490979, "steps_per_second": 44.16896191007579, "loss_extra": 0.023668428258970378} +{"step": 30200, "loss": 0.02243473972193897, "loss_real": 0.017831564443185927, "loss_synth": 0.02208968399092555, "lr": 0.00021166007423773693, "elapsed": 708.1753201810643, "steps_per_second": 43.41927324078958, "loss_extra": 0.023578037125989795} +{"step": 30400, "loss": 0.022394710183143617, "loss_real": 0.017617197851650418, "loss_synth": 0.02197678029537201, "lr": 0.0002081684735571596, "elapsed": 712.2251859050011, "steps_per_second": 43.45380439371304, "loss_extra": 0.02364086006768048} +{"step": 30600, "loss": 0.02242677630856633, "loss_real": 0.01751418633852154, "loss_synth": 0.0221217299066484, "lr": 0.00020469232160870657, "elapsed": 716.2135397479869, "steps_per_second": 43.4917401091008, "loss_extra": 0.023583987867459653} +{"step": 30800, "loss": 0.022391834883019327, "loss_real": 0.017295165993273257, "loss_synth": 0.02207998781464994, "lr": 0.00020123216731706737, "elapsed": 720.863581461017, "steps_per_second": 43.48857955223377, "loss_extra": 0.02358779807575047} +{"step": 31000, "loss": 0.022355862706899644, "loss_real": 0.017516709631308913, "loss_synth": 0.02197522033005953, "lr": 0.00019778855708071612, "elapsed": 725.6089217260014, "steps_per_second": 43.479647829657694, "loss_extra": 0.02357559185475111} +{"step": 31200, "loss": 0.02232451724819839, "loss_real": 0.01746519865002483, "loss_synth": 0.02195818455889821, "lr": 0.00019436203468562864, "elapsed": 730.3334897190798, "steps_per_second": 43.47209240149773, "loss_extra": 0.023533500395715237} +{"step": 31400, "loss": 0.022219836516305803, "loss_real": 0.01734757290687412, "loss_synth": 0.02186247861944139, "lr": 0.00019095314121941266, "elapsed": 734.7482301780256, "steps_per_second": 43.48328448704232, "loss_extra": 0.0234221320040524} +{"step": 31600, "loss": 0.022308329632505775, "loss_real": 0.01717685452196747, "loss_synth": 0.022032919181510804, "lr": 0.0001875624149858636, "elapsed": 738.8074008560507, "steps_per_second": 43.515637430614234, "loss_extra": 0.023474057409912347} +{"step": 31800, "loss": 0.022182598989456893, "loss_real": 0.017146009523421525, "loss_synth": 0.02183746769092977, "lr": 0.00018419039141996036, "elapsed": 742.8048483340535, "steps_per_second": 43.55131186676934, "loss_extra": 0.023401267696172} +{"step": 32000, "loss": 0.022188553204759955, "loss_real": 0.017285866318270563, "loss_synth": 0.02189236366190016, "lr": 0.0001808376030033136, "elapsed": 746.7811127990717, "steps_per_second": 43.58785546806545, "loss_extra": 0.023335225060582162} +{"step": 32200, "loss": 0.022170150317251683, "loss_real": 0.017406828198581935, "loss_synth": 0.02177624993957579, "lr": 0.0001775045791800812, "elapsed": 750.7708698650822, "steps_per_second": 43.623207945994295, "loss_extra": 0.023389907209202646} +{"step": 32400, "loss": 0.022111106626689435, "loss_real": 0.01700557740870863, "loss_synth": 0.021801785482093692, "lr": 0.00017419184627336242, "elapsed": 754.8301410770509, "steps_per_second": 43.654091277095446, "loss_extra": 0.02330609370023012} +{"step": 32600, "loss": 0.022000155663117766, "loss_real": 0.017060026437975467, "loss_synth": 0.02162757432088256, "lr": 0.00017089992740208575, "elapsed": 758.8142667270731, "steps_per_second": 43.68903793422309, "loss_extra": 0.023229400301352142} +{"step": 32800, "loss": 0.022036082660779357, "loss_real": 0.017010934459976854, "loss_synth": 0.021704790452495216, "lr": 0.00016762934239840198, "elapsed": 762.8192189229885, "steps_per_second": 43.722399638811076, "loss_extra": 0.023238983554765582} +{"step": 33000, "loss": 0.02199510673992336, "loss_real": 0.0169089780934155, "loss_synth": 0.02167522709816694, "lr": 0.000164380607725597, "elapsed": 766.867951116059, "steps_per_second": 43.75286710611689, "loss_extra": 0.023197237187996506} +{"step": 33200, "loss": 0.021988467201590537, "loss_real": 0.017056089560501277, "loss_synth": 0.02170796970836818, "lr": 0.00016115423639653619, "elapsed": 770.8955947930226, "steps_per_second": 43.784227002612326, "loss_extra": 0.023124671597033738} +{"step": 33400, "loss": 0.02209067330695689, "loss_real": 0.017137183975428343, "loss_synth": 0.021703335661441087, "lr": 0.0001579507378926539, "elapsed": 774.8648990989896, "steps_per_second": 43.81860897569008, "loss_extra": 0.023336932715028524} +{"step": 33600, "loss": 0.02203564679250121, "loss_real": 0.01707576052751392, "loss_synth": 0.02171994942240417, "lr": 0.00015477061808349973, "elapsed": 778.9738614980597, "steps_per_second": 43.844642979427306, "loss_extra": 0.02321168065071106} +{"step": 33800, "loss": 0.022074583759531377, "loss_real": 0.017042762688361107, "loss_synth": 0.021768203917890788, "lr": 0.0001516143791468568, "elapsed": 782.9656692279968, "steps_per_second": 43.877071310220934, "loss_extra": 0.023253836864605547} +{"step": 34000, "loss": 0.021950042508542537, "loss_real": 0.017021114765666426, "loss_synth": 0.02162030783481896, "lr": 0.00014848251948944142, "elapsed": 787.0039575740229, "steps_per_second": 43.90652966477078, "loss_extra": 0.023134676069021226} +{"step": 34200, "loss": 0.021945367651060223, "loss_real": 0.016846193713136018, "loss_synth": 0.02168046056292951, "lr": 0.00014537553366819925, "elapsed": 791.0006800000556, "steps_per_second": 43.93802857440108, "loss_extra": 0.023095024609938265} +{"step": 34400, "loss": 0.02193908070214093, "loss_real": 0.016925927735865116, "loss_synth": 0.021602417565882204, "lr": 0.0001422939123122089, "elapsed": 795.0812589640263, "steps_per_second": 43.96449341675677, "loss_extra": 0.023145245499908925} +{"step": 34600, "loss": 0.021920093931257725, "loss_real": 0.017031174213625492, "loss_synth": 0.0215379567630589, "lr": 0.00013923814204520548, "elapsed": 799.0635525020771, "steps_per_second": 43.99618144371849, "loss_extra": 0.023149957545101643} +{"step": 34800, "loss": 0.02183495876379311, "loss_real": 0.01692652757745236, "loss_synth": 0.021445844750851394, "lr": 0.00013620870540873793, "elapsed": 803.08029334608, "steps_per_second": 44.025631506598565, "loss_extra": 0.02307515911757946} +{"step": 35000, "loss": 0.021826521176844835, "loss_real": 0.016727992575615646, "loss_synth": 0.02151438965462148, "lr": 0.00013320608078596944, "elapsed": 807.116191314999, "steps_per_second": 44.05372147492353, "loss_extra": 0.023023090809583664} +{"step": 35200, "loss": 0.021773813655599952, "loss_real": 0.016904946807771923, "loss_synth": 0.021464238269254567, "lr": 0.00013023074232613552, "elapsed": 812.0129481140757, "steps_per_second": 44.0340557921215, "loss_extra": 0.02292793892323971} +{"step": 35400, "loss": 0.02174324496649206, "loss_real": 0.016514598322100938, "loss_synth": 0.021429010536521673, "lr": 0.0001272831598696703, "elapsed": 815.9844775660895, "steps_per_second": 44.0653215718513, "loss_extra": 0.02296451390720904} +{"step": 35600, "loss": 0.021795933265239, "loss_real": 0.016963916844688356, "loss_synth": 0.02146750221028924, "lr": 0.00012436379887401295, "elapsed": 820.0828687290195, "steps_per_second": 44.08935160762406, "loss_extra": 0.022962432410567998} +{"step": 35800, "loss": 0.02182737234979868, "loss_real": 0.016903274743817746, "loss_synth": 0.021464192289859057, "lr": 0.00012147312034010696, "elapsed": 824.0463130740682, "steps_per_second": 44.12047542087902, "loss_extra": 0.023044470455497502} +{"step": 36000, "loss": 0.021705303499475123, "loss_real": 0.01668049260508269, "loss_synth": 0.021330511355772616, "lr": 0.00011861158073960271, "elapsed": 828.067371735, "steps_per_second": 44.14817714771556, "loss_extra": 0.022951460974290967} +{"step": 36200, "loss": 0.02170183038339019, "loss_real": 0.0167720512021333, "loss_synth": 0.0213648269046098, "lr": 0.00011577963194277514, "elapsed": 832.114494643989, "steps_per_second": 44.17420197583642, "loss_extra": 0.022893849704414607} +{"step": 36400, "loss": 0.021671765502542257, "loss_real": 0.016781330653466285, "loss_synth": 0.021314822863787414, "lr": 0.0001129777211471684, "elapsed": 836.1424814520869, "steps_per_second": 44.20099810489266, "loss_extra": 0.022876804089173676} +{"step": 36600, "loss": 0.021659478805959226, "loss_real": 0.01629781685769558, "loss_synth": 0.021406204970553518, "lr": 0.00011020629080697766, "elapsed": 840.130437038024, "steps_per_second": 44.22967287332456, "loss_extra": 0.022843153877183796} +{"step": 36800, "loss": 0.021590234553441404, "loss_real": 0.016467215293087065, "loss_synth": 0.02125316586345434, "lr": 0.00010746577856318116, "elapsed": 844.1296123850625, "steps_per_second": 44.25747549037739, "loss_extra": 0.02281589010730386} +{"step": 37000, "loss": 0.021705449083819984, "loss_real": 0.0167795028956607, "loss_synth": 0.021326786614954473, "lr": 0.00010475661717443124, "elapsed": 848.202557991026, "steps_per_second": 44.281102119541416, "loss_extra": 0.022938285218551756} +{"step": 37200, "loss": 0.021686975844204426, "loss_real": 0.01667085207533091, "loss_synth": 0.02136694804765284, "lr": 0.00010207923444871681, "elapsed": 852.1844934290275, "steps_per_second": 44.30930226903685, "loss_extra": 0.022877092324197292} +{"step": 37400, "loss": 0.02164063947275281, "loss_real": 0.01666391355916858, "loss_synth": 0.021322214752435686, "lr": 9.94340531758075e-05, "elapsed": 856.1899651120184, "steps_per_second": 44.335999100919636, "loss_extra": 0.022822314882650973} +{"step": 37600, "loss": 0.02163141928613186, "loss_real": 0.01649489510804415, "loss_synth": 0.021328628649935125, "lr": 9.682149106049004e-05, "elapsed": 860.2528220030945, "steps_per_second": 44.359440193167934, "loss_extra": 0.02282528828829527} +{"step": 37800, "loss": 0.021633586129173637, "loss_real": 0.016572198080830276, "loss_synth": 0.021273352969437838, "lr": 9.424196065660837e-05, "elapsed": 864.2639296830166, "steps_per_second": 44.38535458381092, "loss_extra": 0.022871600966900586} +{"step": 38000, "loss": 0.02159783026203513, "loss_real": 0.016624459978193045, "loss_synth": 0.02124778619967401, "lr": 9.169586930191606e-05, "elapsed": 868.2513706909958, "steps_per_second": 44.41225438885832, "loss_extra": 0.02281040816567838} +{"step": 38200, "loss": 0.021558758756145834, "loss_real": 0.01627217741217464, "loss_synth": 0.02116505946032703, "lr": 8.91836190537533e-05, "elapsed": 872.3544398790691, "steps_per_second": 44.432927854439534, "loss_extra": 0.022869220580905677} +{"step": 38400, "loss": 0.021554855238646267, "loss_real": 0.01655722862109542, "loss_synth": 0.021242029219865798, "lr": 8.670560662555727e-05, "elapsed": 876.4632790720789, "steps_per_second": 44.45310799987972, "loss_extra": 0.02273458695039153} +{"step": 38600, "loss": 0.02150950566865504, "loss_real": 0.016315345494076608, "loss_synth": 0.02112832063809037, "lr": 8.426222332421624e-05, "elapsed": 880.6648041870212, "steps_per_second": 44.46834836937215, "loss_extra": 0.022791450042277575} +{"step": 38800, "loss": 0.02147290764376521, "loss_real": 0.01616084040608257, "loss_synth": 0.021221800139173866, "lr": 8.185385498827815e-05, "elapsed": 884.641279521049, "steps_per_second": 44.4949222986455, "loss_extra": 0.022645809492096304} +{"step": 39000, "loss": 0.02155369413085282, "loss_real": 0.016432494297623633, "loss_synth": 0.021213962715119123, "lr": 7.948088192702195e-05, "elapsed": 888.8668494010344, "steps_per_second": 44.5085985080111, "loss_extra": 0.022781685339286924} +{"step": 39200, "loss": 0.021444475892931223, "loss_real": 0.016574152084067463, "loss_synth": 0.02110721648670733, "lr": 7.714367886040248e-05, "elapsed": 892.9844958510948, "steps_per_second": 44.52760150282958, "loss_extra": 0.02262642134912312} +{"step": 39400, "loss": 0.021395058613270523, "loss_real": 0.016446625012904406, "loss_synth": 0.02105485008098185, "lr": 7.48426148598775e-05, "elapsed": 897.7216136180796, "steps_per_second": 44.51524965209603, "loss_extra": 0.022593510504812002} +{"step": 39600, "loss": 0.02143037465400994, "loss_real": 0.016323665687814355, "loss_synth": 0.02115226773545146, "lr": 7.25780532901276e-05, "elapsed": 901.9280151610728, "steps_per_second": 44.52958794305204, "loss_extra": 0.022594485012814403} +{"step": 39800, "loss": 0.021423552790656684, "loss_real": 0.01615478990599513, "loss_synth": 0.021083033960312605, "lr": 7.035035175167622e-05, "elapsed": 906.1254188830499, "steps_per_second": 44.5442398014672, "loss_extra": 0.022677964260801674} +{"step": 40000, "loss": 0.021464501284062864, "loss_real": 0.016400432172231375, "loss_synth": 0.021185515401884913, "lr": 6.81598620244206e-05, "elapsed": 910.1393102850998, "steps_per_second": 44.56786551558908, "loss_extra": 0.02262207882478833} +{"step": 40200, "loss": 0.021455170400440694, "loss_real": 0.016432962734252213, "loss_synth": 0.021143559338524937, "lr": 6.600693001208181e-05, "elapsed": 927.174612187082, "steps_per_second": 43.956382955958546, "loss_extra": 0.022637962587177752} +{"step": 40400, "loss": 0.021381755527108907, "loss_real": 0.01661737571004778, "loss_synth": 0.021004811869934203, "lr": 6.38918956875819e-05, "elapsed": 931.2903952630004, "steps_per_second": 43.97715790808572, "loss_extra": 0.022584810936823487} +{"step": 40600, "loss": 0.021402127761393785, "loss_real": 0.01638017292600125, "loss_synth": 0.021079116770997643, "lr": 6.181509303935915e-05, "elapsed": 935.2754017860861, "steps_per_second": 44.00398374428038, "loss_extra": 0.022596227321773767} +{"step": 40800, "loss": 0.0213818515278399, "loss_real": 0.01627233817707747, "loss_synth": 0.021024027336388827, "lr": 5.977685001862671e-05, "elapsed": 939.400355347083, "steps_per_second": 44.02393009349486, "loss_extra": 0.02262582858093083} +{"step": 41000, "loss": 0.02138861213810742, "loss_real": 0.01644934293348342, "loss_synth": 0.020957361180335282, "lr": 5.7777488487585654e-05, "elapsed": 943.4752705571009, "steps_per_second": 44.0460672175421, "loss_extra": 0.022676128642633558} +{"step": 41200, "loss": 0.02136884099803865, "loss_real": 0.01600621027406305, "loss_synth": 0.020960484221577643, "lr": 5.581732416859908e-05, "elapsed": 947.5012237790506, "steps_per_second": 44.070319373488815, "loss_extra": 0.02270711016841233} +{"step": 41400, "loss": 0.02138132623396814, "loss_real": 0.016170077263377606, "loss_synth": 0.021054538860917092, "lr": 5.3896666594335835e-05, "elapsed": 951.4942275350913, "steps_per_second": 44.09591098914512, "loss_extra": 0.02261207246221602} +{"step": 41600, "loss": 0.021253041420131923, "loss_real": 0.016211129371076823, "loss_synth": 0.021011728178709745, "lr": 5.20158190588919e-05, "elapsed": 955.5530690650921, "steps_per_second": 44.118205237483004, "loss_extra": 0.02236925669014454} +{"step": 41800, "loss": 0.02126578743569553, "loss_real": 0.016113433735445142, "loss_synth": 0.020946235861629248, "lr": 5.017507856989665e-05, "elapsed": 959.5449712430127, "steps_per_second": 44.14342871732841, "loss_extra": 0.02247909635305405} +{"step": 42000, "loss": 0.021319359792396426, "loss_real": 0.01624024081043899, "loss_synth": 0.02102743119932711, "lr": 4.837473580161169e-05, "elapsed": 963.5251647550613, "steps_per_second": 44.16898425588391, "loss_extra": 0.02249243976548314} +{"step": 42200, "loss": 0.02138320367783308, "loss_real": 0.016241813902743162, "loss_synth": 0.021075368663296103, "lr": 4.6615075049030575e-05, "elapsed": 967.5257148779929, "steps_per_second": 44.19338463775568, "loss_extra": 0.022582941222935915} +{"step": 42400, "loss": 0.021311034066602588, "loss_real": 0.016050390335731208, "loss_synth": 0.02093125266954303, "lr": 4.489637418298455e-05, "elapsed": 971.5560799690429, "steps_per_second": 44.21620654565889, "loss_extra": 0.022603130945935846} +{"step": 42600, "loss": 0.02131409858353436, "loss_real": 0.01608560881111771, "loss_synth": 0.02096460129134357, "lr": 4.321890460626433e-05, "elapsed": 975.5552635100903, "steps_per_second": 44.24027004942151, "loss_extra": 0.02257045336998999} +{"step": 42800, "loss": 0.021317739374935626, "loss_real": 0.016297831595875324, "loss_synth": 0.02101743713952601, "lr": 4.158293121076186e-05, "elapsed": 979.5211486039916, "steps_per_second": 44.26565884497039, "loss_extra": 0.0224888710770756} +{"step": 43000, "loss": 0.02126355548389256, "loss_real": 0.016282154773361982, "loss_synth": 0.020893186032772064, "lr": 3.99887123356411e-05, "elapsed": 983.6383290290833, "steps_per_second": 44.28393915528026, "loss_extra": 0.02249776780605316} +{"step": 43200, "loss": 0.02126610854640603, "loss_real": 0.016070090462453664, "loss_synth": 0.02092141260392964, "lr": 3.843649972654328e-05, "elapsed": 987.6072371370392, "steps_per_second": 44.30880245864897, "loss_extra": 0.022512041283771395} +{"step": 43400, "loss": 0.021189596569165588, "loss_real": 0.01608641629572958, "loss_synth": 0.02094692490063608, "lr": 3.69265384958331e-05, "elapsed": 991.6179028990446, "steps_per_second": 44.33157313591865, "loss_extra": 0.022317808475345372} +{"step": 43600, "loss": 0.02120012613013387, "loss_real": 0.015954124666750433, "loss_synth": 0.020854978570714593, "lr": 3.545906708389291e-05, "elapsed": 995.6644729010295, "steps_per_second": 44.35253802332106, "loss_extra": 0.02245519232004881} +{"step": 43800, "loss": 0.021273740092292426, "loss_real": 0.016109503731131555, "loss_synth": 0.02089887872338295, "lr": 3.403431722147019e-05, "elapsed": 999.6745901240502, "steps_per_second": 44.37496983396535, "loss_extra": 0.022544188862666487} +{"step": 44000, "loss": 0.021303055407479406, "loss_real": 0.016439034836366773, "loss_synth": 0.020903929658234118, "lr": 3.265251389308442e-05, "elapsed": 1003.6834316609893, "steps_per_second": 44.397277219710716, "loss_extra": 0.02254550947807729} +{"step": 44200, "loss": 0.021272766618058086, "loss_real": 0.016024540956132115, "loss_synth": 0.020942095564678312, "lr": 3.1313875301499545e-05, "elapsed": 1007.7391095480416, "steps_per_second": 44.417314193510535, "loss_extra": 0.022513803550973533} +{"step": 44400, "loss": 0.02121940874494612, "loss_real": 0.016137348818592728, "loss_synth": 0.020927486373111606, "lr": 3.0018612833267117e-05, "elapsed": 1011.9551592990756, "steps_per_second": 44.43005722077734, "loss_extra": 0.022392993588000537} +{"step": 44600, "loss": 0.02116248184815049, "loss_real": 0.01603004870004952, "loss_synth": 0.020768864192068578, "lr": 2.8766931025346027e-05, "elapsed": 1015.9907640290912, "steps_per_second": 44.45068578127453, "loss_extra": 0.022446082439273596} +{"step": 44800, "loss": 0.021135591957718133, "loss_real": 0.01607515847310424, "loss_synth": 0.02079720115289092, "lr": 2.755902753280375e-05, "elapsed": 1020.0177667400567, "steps_per_second": 44.47152880520361, "loss_extra": 0.022351691108196972} +{"step": 45000, "loss": 0.021182763976976274, "loss_real": 0.01598645070567727, "loss_synth": 0.020813897708430885, "lr": 2.639509309760422e-05, "elapsed": 1024.2144382681, "steps_per_second": 44.48474333353424, "loss_extra": 0.022452815668657422} +{"step": 45200, "loss": 0.021151678180322053, "loss_real": 0.0160074109910056, "loss_synth": 0.02083513680845499, "lr": 2.5275311518487436e-05, "elapsed": 1029.1936493340181, "steps_per_second": 44.46359465789818, "loss_extra": 0.02236058491282165} +{"step": 45400, "loss": 0.021196225807070732, "loss_real": 0.015882912259548902, "loss_synth": 0.02091853023506701, "lr": 2.4199859621945708e-05, "elapsed": 1033.1914429920726, "steps_per_second": 44.48539026725853, "loss_extra": 0.022395819732919334} +{"step": 45600, "loss": 0.021142759155482055, "loss_real": 0.016095797871239482, "loss_synth": 0.020770567245781423, "lr": 2.316890723430054e-05, "elapsed": 1037.302835687995, "steps_per_second": 44.50208158024977, "loss_extra": 0.02239017579704523} +{"step": 45800, "loss": 0.021147869070991875, "loss_real": 0.016204960378818214, "loss_synth": 0.020766578176990153, "lr": 2.218261715488513e-05, "elapsed": 1041.3200572940987, "steps_per_second": 44.52271492220058, "loss_extra": 0.022386269439011813} +{"step": 46000, "loss": 0.021210846742615103, "loss_real": 0.015949348732829095, "loss_synth": 0.020917213018983603, "lr": 2.1241145130336496e-05, "elapsed": 1045.3312811390497, "steps_per_second": 44.54344643844452, "loss_extra": 0.0224173092097044} +{"step": 46200, "loss": 0.02109315319918096, "loss_real": 0.0159534362424165, "loss_synth": 0.020796410106122494, "lr": 2.0344639830001105e-05, "elapsed": 1049.3399154510116, "steps_per_second": 44.5641288436709, "loss_extra": 0.022281555123627186} +{"step": 46400, "loss": 0.021148008136078714, "loss_real": 0.015721857720054685, "loss_synth": 0.020792860006913542, "lr": 1.949324282245851e-05, "elapsed": 1053.4139424200403, "steps_per_second": 44.58185063915275, "loss_extra": 0.022444329550489785} +{"step": 46600, "loss": 0.021071748165413736, "loss_real": 0.015845127371139824, "loss_synth": 0.020741537138819696, "lr": 1.8687088553165976e-05, "elapsed": 1057.4183141899994, "steps_per_second": 44.60240763607094, "loss_extra": 0.022308573750779034} +{"step": 46800, "loss": 0.021095624091103674, "loss_real": 0.01584561476483941, "loss_synth": 0.020820152973756195, "lr": 1.7926304323227836e-05, "elapsed": 1061.5872743100626, "steps_per_second": 44.615806065058344, "loss_extra": 0.02228200496174395} +{"step": 47000, "loss": 0.021148318778723477, "loss_real": 0.01574288198724389, "loss_synth": 0.020821678759530185, "lr": 1.721101026929328e-05, "elapsed": 1065.9048959080828, "steps_per_second": 44.62279930384068, "loss_extra": 0.022412654366344213} +{"step": 47200, "loss": 0.021090726647526026, "loss_real": 0.01585842654109001, "loss_synth": 0.020656096786260604, "lr": 1.6541319344585365e-05, "elapsed": 1070.043942043092, "steps_per_second": 44.637272567894925, "loss_extra": 0.022432515546679497} +{"step": 47400, "loss": 0.021123112300410866, "loss_real": 0.016160546340979635, "loss_synth": 0.020835563838481903, "lr": 1.5917337301064426e-05, "elapsed": 1074.152393143042, "steps_per_second": 44.65291986533102, "loss_extra": 0.02227158228866756} +{"step": 47600, "loss": 0.021101416312158106, "loss_real": 0.015797947905957697, "loss_synth": 0.02085775660350919, "lr": 1.533916267272854e-05, "elapsed": 1078.2358507890021, "steps_per_second": 44.669494236313675, "loss_extra": 0.022265407778322695} +{"step": 47800, "loss": 0.021145471036434174, "loss_real": 0.015997728388756512, "loss_synth": 0.02083219294436276, "lr": 1.480688676005397e-05, "elapsed": 1083.1309386570938, "steps_per_second": 44.65206208901796, "loss_extra": 0.022351732132956385} +{"step": 48000, "loss": 0.021156980777159332, "loss_real": 0.016283459565602242, "loss_synth": 0.020816194899380205, "lr": 1.432059361557764e-05, "elapsed": 1087.3348854790675, "steps_per_second": 44.66349325222039, "loss_extra": 0.022342992918565868} +{"step": 48200, "loss": 0.021128455763682722, "loss_real": 0.01568420112133026, "loss_synth": 0.02085081606172025, "lr": 1.3880360030624374e-05, "elapsed": 1091.3169254200766, "steps_per_second": 44.68402583365489, "loss_extra": 0.022350742295384408} +{"step": 48400, "loss": 0.02108671870082617, "loss_real": 0.01604701648000628, "loss_synth": 0.020760714532807468, "lr": 1.3486255523180529e-05, "elapsed": 1095.6235753400251, "steps_per_second": 44.69100789934844, "loss_extra": 0.02228688254021108} +{"step": 48600, "loss": 0.0211252501886338, "loss_real": 0.015954033429734407, "loss_synth": 0.02078115870244801, "lr": 1.313834232691649e-05, "elapsed": 1099.6390823620604, "steps_per_second": 44.709906534491274, "loss_extra": 0.022366272369399667} +{"step": 48800, "loss": 0.02111193579621613, "loss_real": 0.01606689440086484, "loss_synth": 0.02070930757559836, "lr": 1.2836675381359077e-05, "elapsed": 1103.640116565046, "steps_per_second": 44.72925939223197, "loss_extra": 0.0223893263656646} +{"step": 49000, "loss": 0.02111497949808836, "loss_real": 0.015917720287106932, "loss_synth": 0.02082596377469599, "lr": 1.2581302323216026e-05, "elapsed": 1107.7418653680943, "steps_per_second": 44.74435541221737, "loss_extra": 0.02230568341910839} +{"step": 49200, "loss": 0.02106992041692138, "loss_real": 0.015821711122989655, "loss_synth": 0.02067561201751232, "lr": 1.2372263478853567e-05, "elapsed": 1111.7419635840924, "steps_per_second": 44.76347832572903, "loss_extra": 0.022374322805553674} +{"step": 49400, "loss": 0.021072330148890615, "loss_real": 0.015812649782747032, "loss_synth": 0.02077411807142198, "lr": 1.2209591857928498e-05, "elapsed": 1115.772139074048, "steps_per_second": 44.78124154578621, "loss_extra": 0.022283035786822437} +{"step": 49600, "loss": 0.021115862280130387, "loss_real": 0.016004058113321663, "loss_synth": 0.020790249668061735, "lr": 1.2093313148175555e-05, "elapsed": 1119.8451776800212, "steps_per_second": 44.79714116739187, "loss_extra": 0.02232816240750253} +{"step": 49800, "loss": 0.021112711299210787, "loss_real": 0.015816793539561332, "loss_synth": 0.020682561788707973, "lr": 1.2023445711350887e-05, "elapsed": 1123.8871363620274, "steps_per_second": 44.814177589820034, "loss_extra": 0.022461090860888364} +{"step": 50000, "loss": 0.021062469510361552, "loss_real": 0.01589060146827251, "loss_synth": 0.020741171967238188, "lr": 1.2000000580332747e-05, "elapsed": 1127.8891848380445, "steps_per_second": 44.83269481074349, "loss_extra": 0.02228090735152364} diff --git a/shared/package-files/e5/e545f9ca26e3d59e33be8226c70df11a31dcf8e3d43ecbee3d2eb69cf29b8c03/eval-score-I24.log b/shared/package-files/e5/e545f9ca26e3d59e33be8226c70df11a31dcf8e3d43ecbee3d2eb69cf29b8c03/eval-score-I24.log new file mode 100644 index 0000000000000000000000000000000000000000..a7d548fd2fd462e0a13587e08c5e19f61b003b0a --- /dev/null +++ b/shared/package-files/e5/e545f9ca26e3d59e33be8226c70df11a31dcf8e3d43ecbee3d2eb69cf29b8c03/eval-score-I24.log @@ -0,0 +1,41 @@ +19429 queries, 1 members, 44.7 s +cos pool rule all=0.5779 dom=0.8211 non=0.3337 h5=0.6989 macro=0.7026 +cen pool rule all=0.5612 dom=0.7986 non=0.3228 h5=0.6892 macro=0.6781 +cos_pm pool rule all=0.5779 dom=0.8211 non=0.3337 h5=0.6989 macro=0.7026 +dot pool rule all=0.5598 dom=0.7826 non=0.3362 h5=0.7029 macro=0.6828 +geo pool rule all=0.5561 dom=0.8029 non=0.3083 h5=0.6860 macro=0.6911 +idf05 pool rule all=0.5880 dom=0.8224 non=0.3527 h5=0.7109 macro=0.7058 +idf1 pool rule all=0.5885 dom=0.8175 non=0.3584 h5=0.7123 macro=0.7053 +lin pool rule all=0.5350 dom=0.7728 non=0.2963 h5=0.6667 macro=0.6598 +log01 pool rule all=0.5853 dom=0.8126 non=0.3570 h5=0.7220 macro=0.6920 +log05 pool rule all=0.5879 dom=0.8264 non=0.3485 h5=0.7225 macro=0.7047 +log20 pool rule all=0.5891 dom=0.8284 non=0.3487 h5=0.7136 macro=0.7085 +nll02 pool rule all=0.4399 dom=0.6963 non=0.1825 h5=0.5771 macro=0.5706 +nll10 pool rule all=0.4001 dom=0.6392 non=0.1601 h5=0.5436 macro=0.5189 +poolcen pool rule all=0.5558 dom=0.7934 non=0.3172 h5=0.7007 macro=0.6728 +pow020 pool rule all=0.5356 dom=0.7323 non=0.3382 h5=0.7012 macro=0.6388 +pow030 pool rule all=0.5546 dom=0.7675 non=0.3409 h5=0.7093 macro=0.6604 +pow040 pool rule all=0.5819 dom=0.8081 non=0.3548 h5=0.7186 macro=0.6887 +pow05 pool rule all=0.5845 dom=0.8172 non=0.3509 h5=0.7166 macro=0.6985 +pow05idf025 pool rule all=0.5879 dom=0.8200 non=0.3548 h5=0.7268 macro=0.7032 +pow05idf05 pool rule all=0.5926 dom=0.8194 non=0.3648 h5=0.7290 macro=0.7017 +pow05m pool rule all=0.5845 dom=0.8172 non=0.3509 h5=0.7166 macro=0.6985 +pow05s pool rule all=0.5795 dom=0.8238 non=0.3342 h5=0.7099 macro=0.6982 +pow060 pool rule all=0.5867 dom=0.8271 non=0.3453 h5=0.7181 macro=0.7026 +pow060idf025 pool rule all=0.5842 dom=0.8205 non=0.3469 h5=0.7239 macro=0.7029 +pow060idf050 pool rule all=0.5852 dom=0.8209 non=0.3484 h5=0.7243 macro=0.7035 +pow060m pool rule all=0.5867 dom=0.8271 non=0.3453 h5=0.7181 macro=0.7026 +pow065 pool rule all=0.5857 dom=0.8286 non=0.3417 h5=0.7173 macro=0.7070 +pow070 pool rule all=0.5881 dom=0.8296 non=0.3457 h5=0.7117 macro=0.7097 +pow070idf025 pool rule all=0.5856 dom=0.8232 non=0.3471 h5=0.7185 macro=0.7091 +pow070idf050 pool rule all=0.5920 dom=0.8257 non=0.3574 h5=0.7218 macro=0.7094 +pow070m pool rule all=0.5881 dom=0.8296 non=0.3457 h5=0.7117 macro=0.7097 +pow075 pool rule all=0.5893 dom=0.8293 non=0.3483 h5=0.7059 macro=0.7100 +pow080 pool rule all=0.5869 dom=0.8292 non=0.3437 h5=0.7054 macro=0.7073 +pow080m pool rule all=0.5869 dom=0.8292 non=0.3437 h5=0.7054 macro=0.7073 +pow085 pool rule all=0.5867 dom=0.8287 non=0.3437 h5=0.7039 macro=0.7058 +pow085idf025 pool rule all=0.5871 dom=0.8269 non=0.3464 h5=0.7066 macro=0.7073 +pow085idf050 pool rule all=0.5916 dom=0.8255 non=0.3569 h5=0.7123 macro=0.7088 +pow090 pool rule all=0.5844 dom=0.8298 non=0.3381 h5=0.7020 macro=0.7056 +pow2 pool rule all=0.5482 dom=0.7888 non=0.3067 h5=0.6841 macro=0.6781 +tani pool rule all=0.5623 dom=0.7965 non=0.3271 h5=0.6989 macro=0.6772 diff --git a/shared/package-files/e5/e567816eefbac934d08eb847797a4d2c77b679ecd52233d070ae24ce592e483b/netprop-released-sub-0_03-1.log b/shared/package-files/e5/e567816eefbac934d08eb847797a4d2c77b679ecd52233d070ae24ce592e483b/netprop-released-sub-0_03-1.log new file mode 100644 index 0000000000000000000000000000000000000000..65d46decb55fc8c492d0a3d25841b6a3e45113ee --- /dev/null +++ b/shared/package-files/e5/e567816eefbac934d08eb847797a4d2c77b679ecd52233d070ae24ce592e483b/netprop-released-sub-0_03-1.log @@ -0,0 +1,4 @@ +released rule from saved branches: Hit@1 0.7995 pool-macro 0.8725 Hit@5 0.8716 Hit@20 0.8761 | twin pools 13 (macro 0.8462), others macro 0.8764 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.0788 (domain 0.0100 / other 0.2238) macro 0.0686 + lam 1.00/1.00: Hit@1 0.8356 (+0.0360 [+0.0000, +0.1160]) macro +0.0098 [+0.0000, +0.0294] pools +1 -0 | no top 20 +0.0398 cap30 +0.0379 [+0.0000, +0.1191] | Hit@5 +0.0000 macro@5 +0.0000 cap30@5 +0.0000 diff --git a/shared/package-files/e5/e5b9fe49ba3205e53779cdfbece4c848da8cafd27be0619efa96d5b9f8f2e44f/grab_forks.log b/shared/package-files/e5/e5b9fe49ba3205e53779cdfbece4c848da8cafd27be0619efa96d5b9f8f2e44f/grab_forks.log new file mode 100644 index 0000000000000000000000000000000000000000..b2bc480aa9435687b9f5a6b9c8876ed0c6e5f560 --- /dev/null +++ b/shared/package-files/e5/e5b9fe49ba3205e53779cdfbece4c848da8cafd27be0619efa96d5b9f8f2e44f/grab_forks.log @@ -0,0 +1,3 @@ +grabbed 35000 +grabbed 40000 +grabbed 45000 diff --git a/shared/package-files/e7/e71c0039b1b00d1d4d95400bc5e4c09d1f0ad4f1e351c8f1d1c9bf8989542c2d/report-ind.json b/shared/package-files/e7/e71c0039b1b00d1d4d95400bc5e4c09d1f0ad4f1e351c8f1d1c9bf8989542c2d/report-ind.json new file mode 100644 index 0000000000000000000000000000000000000000..dc1ac8f4edf29ab14b7901411dcef470cded8f3a --- /dev/null +++ b/shared/package-files/e7/e71c0039b1b00d1d4d95400bc5e4c09d1f0ad4f1e351c8f1d1c9bf8989542c2d/report-ind.json @@ -0,0 +1,107 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": false, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.4452724732184443, + "saturation": null, + "score": 0.8928468297970643, + "unclipped_score": 0.8928468297970643, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.4452724732184443, + "hit_rate_at_20": 0.655798789007918, + "hit_rate_at_5": 0.5812761993479273 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.5476477683956574, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.09815950920245399, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.4452724732184443, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.685546875, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.7005649717514124, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.543046357615894, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.6925287356321839, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.16475495307612095, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.4857142857142857, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.4556149732620321, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.359504132231405, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.16347124117053483, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.6868512110726643, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.4452724732184443, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.3740760916291416, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.5280464477453736 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/e7/e7214e82a44ffdcf266d8c9d0c11870e5071a911cfea4ef8fb1ef11824d3644c/stack-5M-S2-30k.log b/shared/package-files/e7/e7214e82a44ffdcf266d8c9d0c11870e5071a911cfea4ef8fb1ef11824d3644c/stack-5M-S2-30k.log new file mode 100644 index 0000000000000000000000000000000000000000..08131e5f57c78360f924df7256c94e0f9483fb2a --- /dev/null +++ b/shared/package-files/e7/e7214e82a44ffdcf266d8c9d0c11870e5071a911cfea4ef8fb1ef11824d3644c/stack-5M-S2-30k.log @@ -0,0 +1 @@ +evals/stack/5M-S2-30k: members 5, tasks 2540748, done 2540748 diff --git a/shared/package-files/e7/e72b7eb0d7a1650724eafdfed4dfb3954a35814f4975fc5b5e529b61665b6be8/netprop-neigh-inv-s0.9.log b/shared/package-files/e7/e72b7eb0d7a1650724eafdfed4dfb3954a35814f4975fc5b5e529b61665b6be8/netprop-neigh-inv-s0.9.log new file mode 100644 index 0000000000000000000000000000000000000000..3b6e5d7aa5606727fd47b86f244e41bad711c2ac --- /dev/null +++ b/shared/package-files/e7/e72b7eb0d7a1650724eafdfed4dfb3954a35814f4975fc5b5e529b61665b6be8/netprop-neigh-inv-s0.9.log @@ -0,0 +1,10 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.3276 (domain 0.2664 / other 0.3891) macro 0.2383 + lam 1.00/1.00: Hit@1 0.7631 (-0.0082 [-0.0402, +0.0224]) macro +0.0015 [-0.0047, +0.0074] pools +55 -50 | no top 20 -0.0085 cap30 -0.0075 [-0.0258, +0.0089] | Hit@5 -0.0314 macro@5 -0.0021 cap30@5 -0.0064 + +k=10 p=2.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.3280 (domain 0.2690 / other 0.3873) macro 0.2395 + lam 1.00/1.00: Hit@1 0.7610 (-0.0103 [-0.0427, +0.0209]) macro +0.0012 [-0.0050, +0.0071] pools +55 -51 | no top 20 -0.0108 cap30 -0.0099 [-0.0276, +0.0068] | Hit@5 -0.0314 macro@5 -0.0027 cap30@5 -0.0063 + +k=10 p=1.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.3276 (domain 0.2692 / other 0.3862) macro 0.2398 + lam 1.00/1.00: Hit@1 0.7644 (-0.0069 [-0.0390, +0.0261]) macro +0.0018 [-0.0044, +0.0077] pools +57 -51 | no top 20 -0.0070 cap30 -0.0064 [-0.0243, +0.0110] | Hit@5 -0.0319 macro@5 -0.0027 cap30@5 -0.0069 diff --git a/shared/package-files/e7/e746b8bb5e88e4faa1b8a6a43adea3c007f9cef0752185c3ad9ce1134cd12072/gen_membership.py b/shared/package-files/e7/e746b8bb5e88e4faa1b8a6a43adea3c007f9cef0752185c3ad9ce1134cd12072/gen_membership.py new file mode 100644 index 0000000000000000000000000000000000000000..aa8de6980c426d261f09aa1a9a61b6dac07e0327 --- /dev/null +++ b/shared/package-files/e7/e746b8bb5e88e4faa1b8a6a43adea3c007f9cef0752185c3ad9ce1134cd12072/gen_membership.py @@ -0,0 +1,82 @@ +"""How much of a candidate pool's answer does "is in the generated structure set" give away? (lab, E71; ANALYSIS ONLY) + +gen_membership.py gen-NAME... [--score NAME ...] + +Validation labels are read. For every validation pool the candidates are matched (2D canonical SMILES) against +(i) the supplied structures (corpus + train fold) and (ii) a generated structure set ``inv/gen-NAME.json``. +Reported per set: share of labels that are members, mean number of non-label candidates per pool that are +members, and the Hit@1 of the SPECTRUM-FREE rule "answer a member chosen uniformly at random, any candidate if +the pool has no member" (expected value, pool-macro and per query). With ``--score`` the pool-rule Hit@1 of an +inverse network alone (``evals/score/NAME.pkl['pow070']``) is split by whether the label is a member. +This measures a membership artifact. Nothing here may select, filter or weight training structures, and no +membership term may enter a package (E21). +""" +import argparse +import json +import multiprocessing +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'inv')) +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import genlm +import netprop +import scorelab + +ROOT = netprop.ROOT + + +def main(): + p = argparse.ArgumentParser() + p.add_argument('names', nargs='+') + p.add_argument('--score', nargs='*', default=[]) + p.add_argument('--workers', type=int, default=8) + args = p.parse_args() + queries, pools = netprop.load(None) + ev = scorelab.Evaluator(queries, pools) + pids = list(ev.by_pool) + flat, bounds = [], [0] + for pid in pids: + flat += [c['smiles'] for c in pools[pid]] + bounds.append(len(flat)) + chunks = [flat[i:i + 2000] for i in range(0, len(flat), 2000)] + with multiprocessing.Pool(args.workers) as pool: + canon = [t for part in pool.imap(genlm.canonical_chunk, chunks, chunksize=2) for t in part] + target = np.array([int(ev.target[ev.by_pool[pid][0]]) for pid in pids]) + weight = np.array([len(ev.by_pool[pid]) for pid in pids], float) + domain = np.array([bool(ev.domain[ev.by_pool[pid][0]]) for pid in pids]) + size = np.diff(bounds) + print(f'{len(pids)} pools, {len(flat)} candidates; chance Hit@1 macro {np.mean(1 / size):.4f} per query {np.sum(weight / size) / weight.sum():.4f}') + sets = {'supplied': set(genlm.supplied(args.workers))} + for name in args.names: + sets[name] = set(json.load(open(ROOT / 'inv' / f'{name}.json'))) + sets['supplied or ' + args.names[0]] = sets['supplied'] | sets[args.names[0]] + label_in = {} + for name, members in sets.items(): + inside = np.array([t in members for t in canon]) + lab = np.array([inside[bounds[n] + target[n]] for n in range(len(pids))]) + count = np.array([inside[bounds[n]:bounds[n + 1]].sum() for n in range(len(pids))]) + decoys = count - lab + expect = np.where(count > 0, lab / np.maximum(count, 1), 1 / size) + only = lab & (count == 1) + label_in[name] = lab + print(f'{name}: {len(members)} structures | label is a member {lab.mean():.4f} (domain pools {lab[domain].mean():.4f}, other {lab[~domain].mean():.4f}) | ' + f'non-label candidates that are members: {decoys.sum() / (size - 1).sum():.5f} of all, {decoys.mean():.2f} per pool | label is the ONLY member ' + f'{only.mean():.4f} | spectrum-free member rule Hit@1 macro {expect.mean():.4f} per query {np.sum(expect * weight) / weight.sum():.4f}') + first = np.array([ev.by_pool[pid][0] for pid in pids]) + for name in args.score: + score = pickle.load(open(ROOT / 'evals/score' / f'{name}.pkl', 'rb'))['pow070'] + hit = (ev.ranks(score, 1.0) == 0)[first] # list aligned with the queries + parts = [f'{name}: macro {hit.mean():.4f}'] + for key in args.names: + lab = label_in[key] + parts.append(f'label in {key} {hit[lab].mean():.4f} (n {int(lab.sum())}) / not {hit[~lab].mean():.4f} (n {int((~lab).sum())})') + print(' | '.join(parts)) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/e7/e75fd107398899c93bd2da38d477271fcd5c6eba41016065a411c9811387d230/swap-I16+I18+I20-w0.75_0.05_0.5.log b/shared/package-files/e7/e75fd107398899c93bd2da38d477271fcd5c6eba41016065a411c9811387d230/swap-I16+I18+I20-w0.75_0.05_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..ad9443946b1e0a34ab03617c2b2a5ecd379713b6 --- /dev/null +++ b/shared/package-files/e7/e75fd107398899c93bd2da38d477271fcd5c6eba41016065a411c9811387d230/swap-I16+I18+I20-w0.75_0.05_0.5.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7682 pool-macro 0.8644 Hit@5 0.8786 Hit@20 0.9340 | twin pools 354 (macro 0.7514), others macro 0.8776 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4484 (domain 0.4186 / other 0.4783) macro 0.3819 + lam 1.00/1.00: Hit@1 0.8050 (+0.0367 [+0.0168, +0.0623]) macro +0.0154 [+0.0089, +0.0219] pools +88 -36 | no top 20 +0.0312 cap30 +0.0306 [+0.0177, +0.0460] | Hit@5 -0.0027 macro@5 +0.0080 cap30@5 +0.0153 +without consensus term: Hit@1 0.7682 (ref 0.7713; -0.0031 [-0.0099, +0.0033]) macro 0.8644 (+0.0053 [+0.0009, +0.0097]) pools +39 -21 cap30 -0.0029 | Hit@5 0.8786 (-0.0010) Hit@20 0.9340 (-0.0037) + domain 0.9311 (-0.0003) other 0.6047 (-0.0059) | Orbitrap no energy 0.5687 (-0.0077) | above 850 0.4226 (+0.0080) below 850 0.8470 (-0.0056) +full rule : Hit@1 0.8050 (ref 0.8022; +0.0028 [-0.0031, +0.0086]) macro 0.8798 (+0.0059 [+0.0021, +0.0103]) pools +35 -15 cap30 +0.0033 | Hit@5 0.8759 (+0.0040) Hit@20 0.9175 (+0.0011) + domain 0.9407 (+0.0043) other 0.6687 (+0.0013) | Orbitrap no energy 0.6384 (-0.0019) | above 850 0.5361 (-0.0086) below 850 0.8662 (+0.0054) diff --git a/shared/package-files/e7/e77d066e479b0eae408bc77601aeb5e3759bdd6e5972ccb96e08e1d8588a1513/branch-strata-hyb-p48.log b/shared/package-files/e7/e77d066e479b0eae408bc77601aeb5e3759bdd6e5972ccb96e08e1d8588a1513/branch-strata-hyb-p48.log new file mode 100644 index 0000000000000000000000000000000000000000..d57ac551f2901039312e40707edef1e8d9b6c293 --- /dev/null +++ b/shared/package-files/e7/e77d066e479b0eae408bc77601aeb5e3759bdd6e5972ccb96e08e1d8588a1513/branch-strata-hyb-p48.log @@ -0,0 +1,14 @@ +stratum pools queries | forward library ion inverse hyb-s10-f5-p48 released | any branch (macro) +domain 1-2 361 565 | 0.756/0.742 0.147/0.152 0.008/0.009 0.745/0.731 0.756/0.743 0.878/0.864 | 0.889 +domain 3-5 1613 4943 | 0.898/0.894 0.201/0.202 0.016/0.016 0.854/0.853 0.877/0.876 0.958/0.956 | 0.973 +domain 6-20 166 1675 | 0.783/0.765 0.259/0.261 0.018/0.026 0.855/0.864 0.837/0.841 0.910/0.910 | 0.946 +domain >20 13 386 | 0.692/0.702 0.231/0.223 0.000/0.000 0.923/0.943 0.923/0.943 1.000/1.000 | 0.923 +other 1-2 566 858 | 0.661/0.652 0.242/0.233 0.004/0.003 0.602/0.585 0.624/0.612 0.769/0.752 | 0.832 +other 3-5 185 712 | 0.632/0.631 0.319/0.324 0.011/0.011 0.535/0.531 0.519/0.514 0.697/0.697 | 0.768 +other 6-20 97 1247 | 0.351/0.358 0.165/0.167 0.010/0.005 0.258/0.272 0.258/0.282 0.423/0.427 | 0.526 +other >20 131 5606 | 0.511/0.456 0.344/0.319 0.000/0.000 0.351/0.318 0.489/0.544 0.656/0.600 | 0.725 +mixed 1-2 6 12 | 0.500/0.500 0.000/0.000 0.167/0.167 0.500/0.500 0.500/0.500 0.667/0.667 | 0.667 +mixed 3-5 84 368 | 0.714/0.736 0.274/0.277 0.024/0.027 0.643/0.639 0.631/0.628 0.821/0.829 | 0.845 +mixed 6-20 123 1192 | 0.748/0.760 0.317/0.287 0.008/0.007 0.724/0.740 0.724/0.729 0.854/0.859 | 0.894 +mixed >20 41 1865 | 0.585/0.546 0.220/0.245 0.024/0.015 0.829/0.766 0.854/0.788 0.805/0.768 | 0.878 +all 3386 19429 | 0.777/0.649 0.222/0.254 0.012/0.010 0.736/0.617 0.755/0.689 0.865/0.768 | 0.898 diff --git a/shared/package-files/e7/e7833b3061156e907256e62881194198abb44490d40e1724dc729c6fcca2e95e/publish.py b/shared/package-files/e7/e7833b3061156e907256e62881194198abb44490d40e1724dc729c6fcca2e95e/publish.py new file mode 100644 index 0000000000000000000000000000000000000000..51fad927ad68da4908da502f8894070b3e72a1c8 --- /dev/null +++ b/shared/package-files/e7/e7833b3061156e907256e62881194198abb44490d40e1724dc729c6fcca2e95e/publish.py @@ -0,0 +1,281 @@ +#!/usr/bin/env python3 +"""Build, release and document the GLACIER all-condition retrieval package. + +``build`` assembles one complete, standalone package directory (used for the + relocated validation replay). +``release`` copies a validated build byte-for-byte into a new immutable + generation of the submission and switches the manifest atomically. +``records`` copies EXPERIMENTS.md and research records (file-by-file, each + file replaced atomically) into the submission root. +""" + +import argparse +import hashlib +import json +import os +from pathlib import Path +import shutil +import sys + +HERE = Path(__file__).resolve().parent +RESEARCH = HERE.parent + + +def sha256(path): + h = hashlib.sha256() + with Path(path).open('rb') as f: + for block in iter(lambda: f.read(1024 * 1024), b''): + h.update(block) + return h.hexdigest() + + +INFER_SH = '''#!/usr/bin/env bash +set -euo pipefail +package_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +scratch="$(mktemp -d)" +trap 'rm -rf "$scratch"' EXIT +export PYTHONDONTWRITEBYTECODE=1 DGLBACKEND=pytorch MPLCONFIGDIR="$scratch/mpl" NUMBA_CACHE_DIR="$scratch/numba" +if [ ! -w "${HOME:-/nonexistent}" ]; then export HOME="$scratch"; fi +"${MASSSPECGYM_GLACIER_PYTHON:-/opt/glacier/bin/python}" "$package_root/infer.py" "$@" +''' + + +ROOT_INFER_SH = '''#!/usr/bin/env bash +set -euo pipefail +root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +for candidate in python3 "${MASSSPECGYM_GLACIER_PYTHON:-/opt/glacier/bin/python}" /opt/conda/bin/python3; do + if command -v "$candidate" >/dev/null 2>&1; then exec "$candidate" "$root/dispatch.py" "$@"; fi +done +echo "infer.sh: no Python interpreter found" >&2 +exit 1 +''' + + +def build(args): + import torch + out = args.output.resolve() + if out.exists(): + raise FileExistsError(out) + out.mkdir(parents=True) + members, provenance = [], [] + for path in args.checkpoint: + saved = torch.load(path, map_location='cpu', weights_only=False) + training = saved['task_training'] + if training.get('pretrained_assets') != [] or not str(training.get('initialization', '')).startswith(('random', 'own-checkpoint:')): + raise ValueError(f'{path}: not a train-fold, scratch-initialized checkpoint') + digest = sha256(path) + members.append({'state_dict': saved['state_dict'], 'hyper_parameters': saved['hyper_parameters'], + 'global_step': saved['global_step'], 'weights': saved['weights'], + 'task_training': training, 'source_checkpoint_sha256': digest}) + provenance.append({'source': str(path), 'sha256': digest, 'global_step': saved['global_step'], + 'weights': saved['weights'], 'subset': training.get('subset'), 'seed': training.get('seed'), + 'elapsed_seconds': training.get('elapsed_seconds'), + 'data_manifest_sha256': training.get('data_manifest_sha256'), + 'initialization': training.get('initialization'), + 'training_data': 'MassSpecGym v1.5 train fold' + ( + ' + supplied synthetic_augmentation corpus (auxiliary intensity term)' + if training.get('synthetic') else ''), + 'synthetic': training.get('synthetic')}) + bundle = {'format': 'glacier-members/v1', 'members': members} + inverse_provenance = [] + for path in args.inverse or []: + saved = torch.load(path, map_location='cpu', weights_only=True) + digest = sha256(path) + recipe = json.loads((path.parent / 'recipe.json').read_text()) + bundle.setdefault('inverse', []).append({'ema': saved['ema'], 'config': saved['config'], + 'class': saved.get('class', 'FormulaFormer'), 'step': saved['step'], + 'source_checkpoint_sha256': digest}) + data = 'MassSpecGym v1.5 train fold + supplied synthetic_augmentation corpus' + if recipe.get('extra_store'): + # Rows simulated by train-fold-trained forward members of this project for the + # structures of the supplied corpus (E60); the store manifest names the members. + data += (' + spectra of the corpus structures simulated by our own train-fold-trained' + ' GLACIER forward members (self-simulation, E60)') + inverse_provenance.append({'source': str(path), 'sha256': digest, 'step': saved['step'], + 'class': saved.get('class', 'FormulaFormer'), 'weights': 'ema', + 'initialization': 'random', 'seed': recipe['args']['seed'], + 'training_data': data, 'self_simulated_store': recipe.get('extra_store'), + 'stores': recipe.get('stores'), 'recipe': recipe['args']}) + library_provenance = None + if args.library: + library_provenance = json.loads((args.library.parent / 'manifest.json').read_text()) + if library_provenance['sha256'] != sha256(args.library) or library_provenance.get('fold') != 'train': + raise ValueError(f'{args.library}: not the recorded train-fold library') + bundle['library'] = torch.load(args.library, map_location='cpu', weights_only=True) + library_provenance['training_data'] = 'MassSpecGym v1.5 train fold' + ion_provenance = None + if args.ion_table: + # error model of the measured intact-ion term: fitted on the train fold by analysis/ion_fit.py (E64) + sys.path.insert(0, str(HERE / 'pkg')) + import ionterm + fit = json.loads(args.ion_table.read_text()) + if not str(fit.get('source', '')).startswith('MassSpecGym v1.5 train fold'): + raise ValueError(f'{args.ion_table}: not a train-fold error table') + bundle['ion'] = ionterm.asset_from_table(fit) + ion_provenance = {'source': str(args.ion_table), 'sha256': sha256(args.ion_table), 'fit': fit['source'], + 'training_data': 'MassSpecGym v1.5 train fold', 'window_da': bundle['ion']['window_da'], + 'classes': bundle['ion']['classes'], 'fallback': bundle['ion']['fallback'], + 'train_fold_statistics': fit['classes']} + torch.save(bundle, out / 'model.pt') + config = json.loads((HERE / 'pkg' / 'model_config.json').read_text()) + for item in args.set: + key, value = item.split('=', 1) + config[key] = json.loads(value) + if inverse_provenance: + if not isinstance(config.get('inverse'), dict): + raise ValueError('--inverse needs --set inverse={...} (fusion options)') + config['inverse_members'] = inverse_provenance + elif config.get('inverse'): + raise ValueError('fusion options without --inverse checkpoints') + if library_provenance: + if not isinstance(config.get('library'), dict): + raise ValueError('--library needs --set library={...} (neighbour and fusion options)') + config['library_asset'] = library_provenance + elif config.get('library'): + raise ValueError('library options without --library asset') + if ion_provenance: + if not isinstance(config.get('ion'), dict): + raise ValueError('--ion-table needs --set ion={...} (fusion weights)') + config['ion_asset'] = ion_provenance + elif config.get('ion'): + raise ValueError('intact-ion options without --ion-table') + config['checkpoint'] = 'model.pt' + config['method'] = ('native-glacier-all-conditions-forward-simulation' + + ('+formula-transformer-inverse-fusion' if inverse_provenance else '') + + ('+train-library-neighbour-fusion' if library_provenance else '') + + ('+measured-intact-ion-term' if ion_provenance else '') + + ('+cross-pool-consensus' if config.get('consensus') else '')) + config['inference_runtime'] = '/opt/glacier/bin/python' + config['members'] = provenance + (out / 'model_config.json').write_text(json.dumps(config, indent=2) + '\n') + manifest = {'schema': 'massspecgym-retrieval-model/v1', + 'checkpoint': {'path': 'model.pt', 'sha256': sha256(out / 'model.pt'), 'format': 'pytorch'}, + 'model_config': 'model_config.json', + 'training_provenance': {'data': 'MassSpecGym v1.5 train fold', 'pretrained_assets': []}} + (out / 'model_manifest.json').write_text(json.dumps(manifest, indent=2) + '\n') + for name in ['infer.py', 'fastfeat.py', 'inverse.py', 'invrun.py', 'library.py', 'ionterm.py', 'consensus.py']: + shutil.copyfile(HERE / 'pkg' / name, out / name) + (out / 'infer.sh').write_text(INFER_SH) + (out / 'infer.sh').chmod(0o755) + source_root = args.source_root.resolve() + shutil.copytree(source_root / 'src' / 'ms_pred', out / 'vendor' / 'ms_pred', + ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + shutil.copyfile(source_root / 'LICENSE', out / 'LICENSE.ms-pred') + shutil.copytree(HERE, out / 'training', ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + readme = args.readme.read_text() if args.readme else '# GLACIER all-condition retrieval package\n' + (out / 'README.md').write_text(readme) + for path in [out, *out.rglob('*')]: + path.chmod(0o755 if path.is_dir() or path.stat().st_mode & 0o111 else 0o644) + print(json.dumps({'built': str(out), 'checkpoint_sha256': manifest['checkpoint']['sha256'], + 'members': provenance, 'config': {k: v for k, v in config.items() if k != 'members'}}, indent=2)) + + +def release(args): + sys.path.insert(0, str(RESEARCH / 'starter')) + from publication import publish_directory + source = args.source.resolve() + manifest = json.loads((source / 'model_manifest.json').read_text()) + if sha256(source / manifest['checkpoint']['path']) != manifest['checkpoint']['sha256']: + raise ValueError('staged checkpoint hash mismatch') + if args.readme: + readme = args.readme.read_text() + + def copy(stage): + shutil.copytree(source, stage, dirs_exist_ok=True) + if args.readme: + (stage / 'README.md').write_text(readme) + + destination = args.output_dir.resolve() + publish_directory(destination, copy) + # The stock root launcher needs `python3` on PATH; fall back to the documented runtimes. + temporary = destination / '.infer.sh.tmp' + temporary.write_text(ROOT_INFER_SH) + temporary.chmod(0o755) + os.replace(temporary, destination / 'infer.sh') + current = json.loads((destination / 'model_manifest.json').read_text()) + selected = Path(current['model_config']).parts[1] + # Keep the selected generation and its predecessor; older ones are unreferenced. + generations = sorted((p for p in (destination / '.versions').iterdir() if p.is_dir()), + key=lambda p: p.stat().st_mtime, reverse=True) + keep = {selected} + for path in generations: + if path.name != selected and len(keep) < 2: + keep.add(path.name) + for path in generations: + if path.name not in keep: + shutil.rmtree(path, ignore_errors=True) + print(json.dumps({'released': selected, 'checkpoint_sha256': current['checkpoint']['sha256'], 'kept': sorted(keep)})) + + +def records(args): + destination = args.output_dir.resolve() + + def put(source, relative): + target = destination / relative + target.parent.mkdir(parents=True, exist_ok=True) + target.parent.chmod(0o755) + if target.exists() and target.stat().st_size == source.stat().st_size and target.stat().st_mtime >= source.stat().st_mtime: + return + temporary = target.with_name(target.name + '.tmp') + shutil.copyfile(source, temporary) + temporary.chmod(0o644) + os.replace(temporary, target) + + put(RESEARCH / 'EXPERIMENTS.md', 'EXPERIMENTS.md') + skip = {'__pycache__'} + for path in sorted(HERE.rglob('*')): + if path.is_file() and not (set(path.parts) & skip) and path.suffix != '.pyc': + put(path, Path('research') / 'source' / path.relative_to(HERE)) + for run in sorted((RESEARCH / 'runs').iterdir()): + for name in ['recipe.json', 'metrics.jsonl', 'validation.jsonl', 'result.json']: + if (run / name).is_file(): + put(run / name, Path('research') / 'runs' / run.name / name) + if (run / 'training-source').is_dir(): + for path in sorted((run / 'training-source').rglob('*')): + if path.is_file() and not (set(path.parts) & skip): + put(path, Path('research') / 'runs' / run.name / 'training-source' / path.relative_to(run / 'training-source')) + for path in sorted((RESEARCH / 'logs').glob('*')): + if path.is_file() and path.stat().st_size < 50 * 1024 * 1024: + put(path, Path('research') / 'logs' / path.name) + for path in sorted((RESEARCH / 'evals').glob('*/report*.json')) + sorted((RESEARCH / 'evals').glob('*/*.log')) \ + + sorted((RESEARCH / 'evals').glob('*/summary*.json')) + sorted((RESEARCH / 'evals').glob('*/summary*.txt')): + put(path, Path('research') / 'evals' / path.parent.name / path.name) + for name in ['manifest.json', 'preparation.json']: + if (RESEARCH / 'prep_all' / name).is_file(): + put(RESEARCH / 'prep_all' / name, Path('research') / 'prep_all' / name) + if (RESEARCH / 'library' / 'manifest.json').is_file(): + put(RESEARCH / 'library' / 'manifest.json', Path('research') / 'library' / 'manifest.json') + for path in sorted((RESEARCH / 'inv').glob('*.manifest.json')) + sorted((RESEARCH / 'inv' / 'selfsim').glob('*.manifest.json')) \ + + sorted((RESEARCH / 'inv').glob('ion_error_table.json')) + sorted((RESEARCH / 'inv').glob('noise_deltas.json')) \ + + sorted((RESEARCH / 'inv').glob('rank_keep.json')): + put(path, Path('research') / path.relative_to(RESEARCH)) + for path in [destination / 'research', *(destination / 'research').rglob('*')]: + if path.is_dir(): + path.chmod(0o755) + print(json.dumps({'records': str(destination / 'research')})) + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + sub = parser.add_subparsers(dest='command', required=True) + b = sub.add_parser('build') + b.add_argument('--checkpoint', type=Path, action='append', required=True) + b.add_argument('--set', action='append', default=[]) + b.add_argument('--inverse', type=Path, action='append', help='inverse-branch EMA checkpoint (train_inv.py / train_set.py)') + b.add_argument('--library', type=Path, help='train-fold spectral library (build_library.py)') + b.add_argument('--ion-table', type=Path, help='train-fold error table of the measured intact-ion term (analysis/ion_fit.py)') + b.add_argument('--output', type=Path, required=True) + b.add_argument('--source-root', type=Path, default=RESEARCH / 'ms-pred') + b.add_argument('--readme', type=Path) + r = sub.add_parser('release') + r.add_argument('--source', type=Path, required=True) + r.add_argument('--output-dir', type=Path, default=Path('/workspace/submission')) + r.add_argument('--readme', type=Path) + c = sub.add_parser('records') + c.add_argument('--output-dir', type=Path, default=Path('/workspace/submission')) + args = parser.parse_args() + {'build': build, 'release': release, 'records': records}[args.command](args) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/e7/e7a3eb0186d4420d7d02d9bb62d323065f17788d98dec9c2577a01ce1269b8e6/validation.jsonl b/shared/package-files/e7/e7a3eb0186d4420d7d02d9bb62d323065f17788d98dec9c2577a01ce1269b8e6/validation.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..edb3ac63c4be9856d4671d36b6035b08c87832aa --- /dev/null +++ b/shared/package-files/e7/e7a3eb0186d4420d7d02d9bb62d323065f17788d98dec9c2577a01ce1269b8e6/validation.jsonl @@ -0,0 +1,9 @@ +{"step": 5000, "elapsed_seconds": 1444.6998637880897, "validation_loss": 0.6812945827841759, "validation_loss_ema": 0.6684011314064264} +{"step": 10000, "elapsed_seconds": 2708.506315391045, "validation_loss": 0.6276558749377728, "validation_loss_ema": 0.6128806732594967} +{"step": 15000, "elapsed_seconds": 3946.741432613111, "validation_loss": 0.606155501678586, "validation_loss_ema": 0.5934323165565729} +{"step": 20000, "elapsed_seconds": 5136.2172065590275, "validation_loss": 0.5982195511460304, "validation_loss_ema": 0.581990709528327} +{"step": 25000, "elapsed_seconds": 6782.710570300114, "validation_loss": 0.58891954831779, "validation_loss_ema": 0.5758980056270957} +{"step": 30000, "elapsed_seconds": 8314.79353913304, "validation_loss": 0.5778497317805886, "validation_loss_ema": 0.5703027518466115} +{"step": 35000, "elapsed_seconds": 9512.104094705079, "validation_loss": 0.5730009973049164, "validation_loss_ema": 0.5643666060641408} +{"step": 40000, "elapsed_seconds": 11202.788852585014, "validation_loss": 0.5764987953007221, "validation_loss_ema": 0.5657949019223452} +{"step": 45000, "elapsed_seconds": 12964.771320266067, "validation_loss": 0.5714764203876257, "validation_loss_ema": 0.5618033213540912} diff --git a/shared/package-files/e7/e7b50438efb606cf3ca119107ede734e7d23ed3d3211619c49ab21006b59910f/recur-score.sh b/shared/package-files/e7/e7b50438efb606cf3ca119107ede734e7d23ed3d3211619c49ab21006b59910f/recur-score.sh new file mode 100644 index 0000000000000000000000000000000000000000..d32926a1a2643bab2979fdb8a5e68cd3173caab8 --- /dev/null +++ b/shared/package-files/e7/e7b50438efb606cf3ca119107ede734e7d23ed3d3211619c49ab21006b59910f/recur-score.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# E72: score the released inverse ensemble N5 alone on recurrence-transformed validation stores (labels: evaluation only) +# usage: recur-score.sh CORES NAME ... +cd /workspace/research +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps GLACIER_SOURCE=/workspace/research/ms-pred/src OMP_NUM_THREADS=4 +cores=$1; shift +C="" +for r in I16-ff512x6-real08-corpus2+train3-noise05 I18-ff512x6-real08-corpus2+train3-noise05-real025 I19-ff512x6-real08-corpus2+train3-noise05-jit08 I20-ff512x6-real08-corpus2+train3-noise05-near067 I21-ff512x6-real08-corpus2+train3-noise05-real05; do C="$C runs/$r/step-0050000-ema.pt"; done +for name in "$@"; do + taskset -c $cores /opt/glacier/bin/python allcond/inv/eval_score.py evals/score/N5-recur-$name.pkl $C --pools inv/recur/$name.npz > logs/eval-score-N5-recur-$name.log 2>&1 +done diff --git a/shared/package-files/e7/e7d0621960beb5e5114ffd9901c13eaedfa37b9d2a09fbfa889d05647bdd05b9/scorelab-B20k+A10k-full-v4.log b/shared/package-files/e7/e7d0621960beb5e5114ffd9901c13eaedfa37b9d2a09fbfa889d05647bdd05b9/scorelab-B20k+A10k-full-v4.log new file mode 100644 index 0000000000000000000000000000000000000000..5b438411077aea79a89c5d00fd9181f66541d2c8 --- /dev/null +++ b/shared/package-files/e7/e7d0621960beb5e5114ffd9901c13eaedfa37b9d2a09fbfa889d05647bdd05b9/scorelab-B20k+A10k-full-v4.log @@ -0,0 +1,6 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 49.67408437898848} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 53.41411191993393} +ind base all=0.4349 dom=0.6785 non=0.1903 h5=0.5817 h20=0.6702 | diff=+0.0000 [+0.0000,+0.0000] +agg base all=0.5529 dom=0.7953 non=0.3096 h5=0.6967 h20=0.8146 | diff=+0.0000 [+0.0000,+0.0000] +ind noprec_pp0.75 all=0.4699 dom=0.7004 non=0.2384 h5=0.6310 h20=0.7170 | diff=+0.0349 [+0.0284,+0.0407] +agg noprec_pp0.75 all=0.6239 dom=0.7936 non=0.4534 h5=0.8067 h20=0.8992 | diff=+0.0709 [+0.0282,+0.1286] diff --git a/shared/package-files/ed/ed0fffc9aaba4d7b57586aad8fe6d7f15a77e8371641263ba2f3b318aa500454/check_synth.py b/shared/package-files/ed/ed0fffc9aaba4d7b57586aad8fe6d7f15a77e8371641263ba2f3b318aa500454/check_synth.py new file mode 100644 index 0000000000000000000000000000000000000000..4bacfd57ea607c8222e15867b1ef6a3f81e078de --- /dev/null +++ b/shared/package-files/ed/ed0fffc9aaba4d7b57586aad8fe6d7f15a77e8371641263ba2f3b318aa500454/check_synth.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +"""Checks of the synthetic-mixing step (`synth.py`). + +check_synth.py CKPT [--steps 3] +1. no synthetic structure shares a 2D InChIKey block with a validation label (audit re-check); +2. the joint part of the step equals the stock training_step; +3. synthetic loss is finite, gradients are finite; timing and memory. +""" +import argparse +import json +import sys +import time +from pathlib import Path + +ROOT = Path('/workspace/research') +sys.path.insert(0, str(ROOT / 'ms-pred/src')) +sys.path.insert(0, str(ROOT / 'allcond')) +sys.path.insert(0, str(ROOT / 'allcond/pkg')) + + +def main(): + p = argparse.ArgumentParser() + p.add_argument('checkpoint', type=Path) + p.add_argument('--steps', type=int, default=3) + p.add_argument('--per-item', type=int, default=1) + p.add_argument('--instrument', default='flag') + args = p.parse_args() + import numpy as np + import torch + from ms_pred.glacier.joint_model import JointModel + from dataset_all import AllConditionDataset + from synth import SynthMixDataset, SynthStep, collate_synth + from fastfeat import expand_graphormer + + blocks = {s['block'] for s in json.loads((ROOT / 'synth/structures.json').read_text())} + held = {json.loads(line)['target_inchikey'][:14] for line in open('/workspace/data/validation.jsonl')} + train = {json.loads(line)['target_inchikey'][:14] for line in open('/workspace/data/train.jsonl')} + print('synthetic structures', len(blocks), 'shared with validation labels', len(blocks & held), + 'shared with train labels', len(blocks & train)) + assert not blocks & held + + config = json.loads((ROOT / 'allcond/config.json').read_text()) + base = AllConditionDataset(ROOT / 'prep_all', 'train', config, subset='all', limit=4096) + data = SynthMixDataset(base, ROOT / 'synth', per_item=args.per_item, seed=1, instrument=args.instrument) + saved = torch.load(args.checkpoint, map_location='cpu', weights_only=False) + model = JointModel(**dict(config, node_feats=base.processor.get_node_feats(), + edge_feats=base.processor.get_edge_feats())) + model.load_state_dict(saved['state_dict']) + logged = {} + model.log = lambda name, value, **kwargs: logged.__setitem__(name, float(value)) + model.cuda().train() + model.step = saved.get('global_step', 40000) + step = SynthStep(model, weight=1.0) + + def to_device(batch): + return {k: (v.cuda() if torch.is_tensor(v) else to_device(v) if isinstance(v, dict) else v) + for k, v in batch.items()} + + for i in range(args.steps): + started = time.time() + batch = collate_synth([data[j] for j in range(i * 32, (i + 1) * 32)]) + made = time.time() - started + batch = to_device(batch) + batch['synth']['graphormer_input'] = expand_graphormer(batch['synth'].pop('graphormer_compact')) + model.eval() # deterministic comparison of the joint part + before = model.step + with torch.no_grad(): + torch.manual_seed(0) + stock = float(model._common_step(batch['targ'], name='train')['loss']) + model.step = before + torch.manual_seed(0) + step(batch, 0) + mine = logged['train_joint_loss'] + model.step = before + model.train() + model.zero_grad(set_to_none=True) + torch.cuda.synchronize() + started = time.time() + loss = step(batch, 0) + loss.backward() + torch.cuda.synchronize() + norm = float(torch.sqrt(sum((p.grad.double() ** 2).sum() for p in model.parameters() if p.grad is not None))) + finite = all(bool(torch.isfinite(p.grad).all()) for p in model.parameters() if p.grad is not None) + synth = batch['synth'] + print(json.dumps({'batch': i, 'stock_joint_eval': round(stock, 6), 'joint_eval': round(mine, 6), + 'train_joint': round(logged['train_joint_loss'], 4), + 'synth_loss': round(logged.get('train_synth_loss', float('nan')), 4), + 'factor': round(logged.get('train_synth_factor', float('nan')), 4), + 'synth_items': int(synth['inten_targs'].shape[0]), + 'synth_peaks': int((synth['inten_targs'][:, :, 1] > 0).sum(1).float().mean()), + 'energies': [round(float(v), 1) for v in synth['collision_engs'][:5]], + 'instruments': sorted(set(int(v) for v in synth['instruments'])), + 'grad_norm': round(norm, 4), 'grad_finite': finite, 'featurize_seconds': round(made, 2), + 'step_seconds': round(time.time() - started, 3), + 'peak_gb': round(torch.cuda.max_memory_allocated() / 2 ** 30, 2)})) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/ed/ed8ad04c67552ee5c5b98e794d622b4979d3ea3042f4ec14fc68dca281a8e31b/metrics.jsonl b/shared/package-files/ed/ed8ad04c67552ee5c5b98e794d622b4979d3ea3042f4ec14fc68dca281a8e31b/metrics.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..9b770dc56f585a6a2625612e8f0cd4da528b17ae --- /dev/null +++ b/shared/package-files/ed/ed8ad04c67552ee5c5b98e794d622b4979d3ea3042f4ec14fc68dca281a8e31b/metrics.jsonl @@ -0,0 +1,250 @@ +{"step": 200, "loss": 0.3298254015855491, "loss_real": 0.3283329976722598, "loss_synth": 0.32983451763167976, "lr": 5.999770185426209e-05, "elapsed": 17.791109507903457, "steps_per_second": 40.1501210772321, "loss_extra": 0.330075582973659} +{"step": 400, "loss": 0.04835904760286212, "loss_real": 0.04380386682227254, "loss_synth": 0.04886415271088481, "lr": 0.0001199815230572914, "elapsed": 24.625603662920184, "steps_per_second": 33.852979118596274, "loss_extra": 0.04864744624122977} +{"step": 600, "loss": 0.045403600204735994, "loss_real": 0.03962710389867425, "loss_synth": 0.045929682720452544, "lr": 0.00017993754018322624, "elapsed": 30.39537742291577, "steps_per_second": 34.11887714289243, "loss_extra": 0.045883288234472276} +{"step": 800, "loss": 0.043118653148412706, "loss_real": 0.03577796097844839, "loss_synth": 0.04379852609708905, "lr": 0.0002398518371215969, "elapsed": 35.11152117897291, "steps_per_second": 35.87167814852185, "loss_extra": 0.043716948721557854} +{"step": 1000, "loss": 0.042105521615594624, "loss_real": 0.03417893346399069, "loss_synth": 0.04276986312121153, "lr": 0.0002997105087403322, "elapsed": 39.61318789597135, "steps_per_second": 37.30872307583715, "loss_extra": 0.042821069806814195} +{"step": 1200, "loss": 0.041147863790392876, "loss_real": 0.03321744427084923, "loss_synth": 0.04175304410979152, "lr": 0.00035949966454633923, "elapsed": 43.94657739496324, "steps_per_second": 38.53963978889785, "loss_extra": 0.04192298848181963} +{"step": 1400, "loss": 0.0403411947004497, "loss_real": 0.03245796060189605, "loss_synth": 0.04083936547860503, "lr": 0.0004192054323428467, "elapsed": 48.33486110798549, "steps_per_second": 39.40880452002076, "loss_extra": 0.04121467836201191} +{"step": 1600, "loss": 0.039613875783979895, "loss_real": 0.031857251664623616, "loss_synth": 0.0400608685053885, "lr": 0.0004788139618827038, "elapsed": 52.75759779592045, "steps_per_second": 40.05227481218649, "loss_extra": 0.04051632471382618} +{"step": 1800, "loss": 0.03898504721000791, "loss_real": 0.03127260136418045, "loss_synth": 0.03944719111546874, "lr": 0.000538311428516825, "elapsed": 57.062256956938654, "steps_per_second": 40.67571202187685, "loss_extra": 0.03986473392695188} +{"step": 2000, "loss": 0.03839635929092765, "loss_real": 0.030746952621266244, "loss_synth": 0.03882582856342196, "lr": 0.0005976840368369773, "elapsed": 61.44184234691784, "steps_per_second": 41.12515340083675, "loss_extra": 0.03929763074964285} +{"step": 2200, "loss": 0.03779259597882628, "loss_real": 0.03017015672288835, "loss_synth": 0.03815385216847062, "lr": 0.0005971982039200904, "elapsed": 65.82987738098018, "steps_per_second": 41.49371913052301, "loss_extra": 0.03875710656866431} +{"step": 2400, "loss": 0.03712788879871368, "loss_real": 0.029534382363781333, "loss_synth": 0.03746280416846275, "lr": 0.000596666387431128, "elapsed": 70.07897473289631, "steps_per_second": 41.90736474237385, "loss_extra": 0.03811360159888864} +{"step": 2600, "loss": 0.036517864800989626, "loss_real": 0.02911791643127799, "loss_synth": 0.03683254463598132, "lr": 0.0005960886713500785, "elapsed": 74.35888236598112, "steps_per_second": 42.24271202771965, "loss_extra": 0.037490101624280216} +{"step": 2800, "loss": 0.03595229335129261, "loss_real": 0.02869600956328213, "loss_synth": 0.03622699838131666, "lr": 0.0005954651469050082, "elapsed": 78.60587165190373, "steps_per_second": 42.555735151653806, "loss_extra": 0.03693937636911869} +{"step": 3000, "loss": 0.03552436474710703, "loss_real": 0.028300219820812343, "loss_synth": 0.03575948167592287, "lr": 0.0005947959125576553, "elapsed": 82.66295656492002, "steps_per_second": 42.9472389179333, "loss_extra": 0.03654528500512242} +{"step": 3200, "loss": 0.03502156401053071, "loss_real": 0.028030138527974487, "loss_synth": 0.035187581274658444, "lr": 0.000594081073987881, "elapsed": 86.61914042092394, "steps_per_second": 43.35494867631331, "loss_extra": 0.0360708618350327} +{"step": 3400, "loss": 0.03467933841049671, "loss_real": 0.027545399218797683, "loss_synth": 0.0349005189165473, "lr": 0.0005933207440769824, "elapsed": 90.57322156999726, "steps_per_second": 43.72235855199688, "loss_extra": 0.03569846529513598} +{"step": 3600, "loss": 0.03424552323296666, "loss_real": 0.027449008747935294, "loss_synth": 0.0343695530295372, "lr": 0.0005925150428898661, "elapsed": 94.74156357895117, "steps_per_second": 43.93900542260714, "loss_extra": 0.035302768405526874} +{"step": 3800, "loss": 0.033868501633405684, "loss_real": 0.027416951293125748, "loss_synth": 0.034035708885639906, "lr": 0.0005916640976560898, "elapsed": 98.70668254897464, "steps_per_second": 44.2390932410013, "loss_extra": 0.03482282128185034} +{"step": 4000, "loss": 0.03353775324299932, "loss_real": 0.02653888477012515, "loss_synth": 0.033738590888679025, "lr": 0.0005907680427497705, "elapsed": 102.70860680891201, "steps_per_second": 44.49447510257872, "loss_extra": 0.03455367038026452} +{"step": 4200, "loss": 0.033256101235747335, "loss_real": 0.02687936319038272, "loss_synth": 0.03329772662371397, "lr": 0.000589827019668365, "elapsed": 106.74130960390903, "steps_per_second": 44.713432486729495, "loss_extra": 0.03432247426360845} +{"step": 4400, "loss": 0.032891065962612626, "loss_real": 0.026250209538266064, "loss_synth": 0.0329507605265826, "lr": 0.0005888411770103267, "elapsed": 110.75871131790336, "steps_per_second": 44.92137957239633, "loss_extra": 0.033985330890864134} +{"step": 4600, "loss": 0.0326461570803076, "loss_real": 0.025960434628650546, "loss_synth": 0.032793399188667534, "lr": 0.0005878106704516395, "elapsed": 114.68024934199639, "steps_per_second": 45.15539330081129, "loss_extra": 0.03366104047745466} +{"step": 4800, "loss": 0.03240168260410428, "loss_real": 0.026240757843479515, "loss_synth": 0.032427049865946175, "lr": 0.0005867356627212351, "elapsed": 118.7491067389492, "steps_per_second": 45.308963704650765, "loss_extra": 0.03344675214961171} +{"step": 5000, "loss": 0.03205684706568718, "loss_real": 0.02561608889140189, "loss_synth": 0.032044315012171865, "lr": 0.000585616323575296, "elapsed": 122.89239024999551, "steps_per_second": 45.4204444306355, "loss_extra": 0.033188270535320044} +{"step": 5200, "loss": 0.03187946754507721, "loss_real": 0.02541849044151604, "loss_synth": 0.03193818616680801, "lr": 0.000584452829770449, "elapsed": 127.81668081099633, "steps_per_second": 45.2146877274752, "loss_extra": 0.03294345458969474} +{"step": 5400, "loss": 0.03163432158529758, "loss_real": 0.025554459998384117, "loss_synth": 0.031675774855539206, "lr": 0.0005832453650358537, "elapsed": 136.26624197501224, "steps_per_second": 43.740124815814745, "loss_extra": 0.032649289658293126} +{"step": 5600, "loss": 0.031390665927901865, "loss_real": 0.02514458607882261, "loss_synth": 0.03135189505293965, "lr": 0.0005819941200441891, "elapsed": 143.59445342293475, "steps_per_second": 42.81848074695955, "loss_extra": 0.032514394856989384} +{"step": 5800, "loss": 0.031226466596126556, "loss_real": 0.025070921536535024, "loss_synth": 0.03123306897468865, "lr": 0.0005806992923815441, "elapsed": 150.08102717099246, "steps_per_second": 42.25211884245058, "loss_extra": 0.03228928628377616} +{"step": 6000, "loss": 0.030993415312841534, "loss_real": 0.02469338265247643, "loss_synth": 0.030998344542458655, "lr": 0.0005793610865162167, "elapsed": 155.67698837793432, "steps_per_second": 41.99704825491162, "loss_extra": 0.03208300313912332} +{"step": 6200, "loss": 0.030744643602520227, "loss_real": 0.024668188150972128, "loss_synth": 0.030773116713389753, "lr": 0.0005779797137664262, "elapsed": 160.41018248093314, "steps_per_second": 42.00531259970019, "loss_extra": 0.0317719454318285} +{"step": 6400, "loss": 0.0306300909537822, "loss_real": 0.024952756073325873, "loss_synth": 0.030561882350593806, "lr": 0.0005765553922669433, "elapsed": 164.7822818569839, "steps_per_second": 42.1128886652611, "loss_extra": 0.031684325877577066} +{"step": 6600, "loss": 0.030451531615108253, "loss_real": 0.02463427689857781, "loss_synth": 0.03049923981539905, "lr": 0.0005750883469346437, "elapsed": 169.0833845589077, "steps_per_second": 42.233626248141206, "loss_extra": 0.0314146491792053} +{"step": 6800, "loss": 0.030197329837828874, "loss_real": 0.024447311460971833, "loss_synth": 0.030083229253068566, "lr": 0.000573578809432992, "elapsed": 173.54765634494834, "steps_per_second": 42.30490778822373, "loss_extra": 0.03130988970398903} +{"step": 7000, "loss": 0.030067330738529564, "loss_real": 0.024078537113964557, "loss_synth": 0.030009782453998924, "lr": 0.000572027018135459, "elapsed": 177.94521190598607, "steps_per_second": 42.38945558635667, "loss_extra": 0.031165060279890897} +{"step": 7200, "loss": 0.029979545334354044, "loss_real": 0.024150882847607136, "loss_synth": 0.029943417962640523, "lr": 0.0005704332180878793, "elapsed": 182.55254837300163, "steps_per_second": 42.41712987459461, "loss_extra": 0.031028125323355197} +{"step": 7400, "loss": 0.02974157561548054, "loss_real": 0.02397400193847716, "loss_synth": 0.029720014072954656, "lr": 0.0005687976609697565, "elapsed": 187.1604642929742, "steps_per_second": 42.44320045597658, "loss_extra": 0.030765038672834633} +{"step": 7600, "loss": 0.02965331628918648, "loss_real": 0.023897661315277218, "loss_synth": 0.029563855892047287, "lr": 0.0005671206050545193, "elapsed": 191.80335399496835, "steps_per_second": 42.45963072854484, "loss_extra": 0.030742319943383337} +{"step": 7800, "loss": 0.02946150195784867, "loss_real": 0.023827052069827916, "loss_synth": 0.029439303567633034, "lr": 0.000565402315168738, "elapsed": 196.3482777379686, "steps_per_second": 42.49790172732621, "loss_extra": 0.03046247148886323} +{"step": 8000, "loss": 0.029333482692018152, "loss_real": 0.023612667983397843, "loss_synth": 0.029256575386971236, "lr": 0.0005636430626503045, "elapsed": 200.85968961799517, "steps_per_second": 42.54190321528508, "loss_extra": 0.030403933534398676} +{"step": 8200, "loss": 0.02917216175235808, "loss_real": 0.023513819305226207, "loss_synth": 0.028965645022690296, "lr": 0.0005618431253055855, "elapsed": 205.07605328096543, "steps_per_second": 42.64919127394909, "loss_extra": 0.030360819203779102} +{"step": 8400, "loss": 0.029113734932616354, "loss_real": 0.02359313836321235, "loss_synth": 0.028983110459521413, "lr": 0.000560002787365553, "elapsed": 209.32132741098758, "steps_per_second": 42.7455850282523, "loss_extra": 0.0302028913423419} +{"step": 8600, "loss": 0.02888443266041577, "loss_real": 0.02331412491388619, "loss_synth": 0.02873563239350915, "lr": 0.0005581223394409018, "elapsed": 213.39831080893055, "steps_per_second": 42.87384247430479, "loss_extra": 0.03000032465904951} +{"step": 8800, "loss": 0.02878928856924176, "loss_real": 0.02298711839132011, "loss_synth": 0.02867382819764316, "lr": 0.0005562020784761579, "elapsed": 217.37416426395066, "steps_per_second": 43.01824629677335, "loss_extra": 0.029912262763828038} +{"step": 9000, "loss": 0.028684448078274728, "loss_real": 0.022890767995268107, "loss_synth": 0.028521711993962525, "lr": 0.0005542423077027882, "elapsed": 221.35687189199962, "steps_per_second": 43.155725629614345, "loss_extra": 0.029853022759780287} +{"step": 9200, "loss": 0.02850510150194168, "loss_real": 0.022999525601044297, "loss_synth": 0.028335258010774852, "lr": 0.0005522433365913161, "elapsed": 225.3179596689297, "steps_per_second": 43.29245624638023, "loss_extra": 0.02963070140220225} +{"step": 9400, "loss": 0.028486735401675106, "loss_real": 0.022908578980714082, "loss_synth": 0.028443823447450996, "lr": 0.0005502054808024529, "elapsed": 229.30488521198276, "steps_per_second": 43.41900051558901, "loss_extra": 0.02949855085462332} +{"step": 9600, "loss": 0.0283959265332669, "loss_real": 0.022884096316993237, "loss_synth": 0.028263866789638995, "lr": 0.0005481290621372514, "elapsed": 233.25199651299044, "steps_per_second": 43.54883215342518, "loss_extra": 0.029484989382326604} +{"step": 9800, "loss": 0.02823892659507692, "loss_real": 0.02282112427055836, "loss_synth": 0.02809704586863518, "lr": 0.000546014408486289, "elapsed": 237.20332813099958, "steps_per_second": 43.67327461684624, "loss_extra": 0.029321433259174228} +{"step": 10000, "loss": 0.02812378096394241, "loss_real": 0.02253558567725122, "loss_synth": 0.028014398785308002, "lr": 0.0005438618537778916, "elapsed": 241.18901729397476, "steps_per_second": 43.78682234903985, "loss_extra": 0.029203529320657253} +{"step": 10200, "loss": 0.02805476657114923, "loss_real": 0.022548277210444213, "loss_synth": 0.027831052858382464, "lr": 0.0005416717379254006, "elapsed": 257.5929137469502, "steps_per_second": 41.669541806820234, "loss_extra": 0.02923416714183986} +{"step": 10400, "loss": 0.02791021519340575, "loss_real": 0.022143112383782863, "loss_synth": 0.027841592701151968, "lr": 0.0005394444067734975, "elapsed": 261.52696086093783, "steps_per_second": 41.814566248305695, "loss_extra": 0.028980457931756975} +{"step": 10600, "loss": 0.027867110818624495, "loss_real": 0.022497557075694202, "loss_synth": 0.027690531248226763, "lr": 0.0005371802120435915, "elapsed": 265.476524974918, "steps_per_second": 41.95249770054109, "loss_extra": 0.028975787442177534} +{"step": 10800, "loss": 0.027687979694455862, "loss_real": 0.02231818745844066, "loss_synth": 0.027484551621600985, "lr": 0.0005348795112782779, "elapsed": 269.70843618991785, "steps_per_second": 42.03992809269484, "loss_extra": 0.028823432587087153} +{"step": 11000, "loss": 0.02760167345404625, "loss_real": 0.022175445016473533, "loss_synth": 0.027421713201329113, "lr": 0.0005325426677848778, "elapsed": 273.7713991459459, "steps_per_second": 42.15179642645592, "loss_extra": 0.028723562387749552} +{"step": 11200, "loss": 0.02748813441954553, "loss_real": 0.022157019693404435, "loss_synth": 0.02724956415593624, "lr": 0.0005301700505780687, "elapsed": 277.78233689791523, "steps_per_second": 42.268532083284285, "loss_extra": 0.02865186088718474} +{"step": 11400, "loss": 0.027409856487065554, "loss_real": 0.02217673836275935, "loss_synth": 0.027190122036263347, "lr": 0.0005277620343216117, "elapsed": 282.11395385093056, "steps_per_second": 42.331319618399995, "loss_extra": 0.02853780216537416} +{"step": 11600, "loss": 0.027310517029836775, "loss_real": 0.021836677407845853, "loss_synth": 0.027168940287083387, "lr": 0.0005253189992691882, "elapsed": 286.46924425591715, "steps_per_second": 42.38845193727631, "loss_extra": 0.028402456464245916} +{"step": 11800, "loss": 0.027334291515871884, "loss_real": 0.02167211533524096, "loss_synth": 0.027241385774686933, "lr": 0.0005228413312043536, "elapsed": 290.60771637491416, "steps_per_second": 42.47692122765148, "loss_extra": 0.02841048588976264} +{"step": 12000, "loss": 0.027156693516299128, "loss_real": 0.02175391179509461, "loss_synth": 0.026935852589085697, "lr": 0.0005203294213796174, "elapsed": 294.63532247091644, "steps_per_second": 42.57953679229042, "loss_extra": 0.02831521648913622} +{"step": 12200, "loss": 0.02700324642471969, "loss_real": 0.021291875950992106, "loss_synth": 0.026898909397423267, "lr": 0.0005177836664546598, "elapsed": 298.6020927729551, "steps_per_second": 42.68834572052689, "loss_extra": 0.028099369928240775} +{"step": 12400, "loss": 0.027038824604824187, "loss_real": 0.0214939353056252, "loss_synth": 0.02682844835333526, "lr": 0.000515204468433695, "elapsed": 302.71393342490774, "steps_per_second": 42.772760981535356, "loss_extra": 0.02821161536499858} +{"step": 12600, "loss": 0.02688027578406036, "loss_real": 0.02149728834629059, "loss_synth": 0.026636516526341438, "lr": 0.0005125922346019892, "elapsed": 306.68806483293884, "steps_per_second": 42.87489641927982, "loss_extra": 0.0280581814609468} +{"step": 12800, "loss": 0.026859163641929626, "loss_real": 0.021509357136674224, "loss_synth": 0.026624895269051194, "lr": 0.0005099473774615467, "elapsed": 310.804903501994, "steps_per_second": 42.95372662068313, "loss_extra": 0.02802185406908393} +{"step": 13000, "loss": 0.02678928249515593, "loss_real": 0.021425398862920702, "loss_synth": 0.026558246482163667, "lr": 0.00050727031466597, "elapsed": 314.7748086960055, "steps_per_second": 43.051346476331766, "loss_extra": 0.027951199812814593} +{"step": 13200, "loss": 0.026703785732388498, "loss_real": 0.021118833422660827, "loss_synth": 0.026511239744722845, "lr": 0.000504561468954508, "elapsed": 319.0561791539658, "steps_per_second": 43.1025511157663, "loss_extra": 0.02786578206345439} +{"step": 13400, "loss": 0.026578113427385686, "loss_real": 0.021232918789610266, "loss_synth": 0.026345820184797048, "lr": 0.0005018212680853004, "elapsed": 323.33368810091633, "steps_per_second": 43.15288041340655, "loss_extra": 0.0277380361687392} +{"step": 13600, "loss": 0.026539104050025342, "loss_real": 0.021012925850227474, "loss_synth": 0.026351477559655903, "lr": 0.0004990501447678302, "elapsed": 327.2712021059124, "steps_per_second": 43.2485516410094, "loss_extra": 0.02768599077127874} +{"step": 13800, "loss": 0.02654332478530705, "loss_real": 0.02100208554416895, "loss_synth": 0.026395965833216906, "lr": 0.0004962485365945929, "elapsed": 331.2012796800118, "steps_per_second": 43.34286905305627, "loss_extra": 0.027652731286361813} +{"step": 14000, "loss": 0.026361113926395775, "loss_real": 0.020951708653010426, "loss_synth": 0.026123166736215352, "lr": 0.0004934168859719962, "elapsed": 335.1251381979091, "steps_per_second": 43.4357244508968, "loss_extra": 0.027537821428850293} +{"step": 14200, "loss": 0.026434382013976573, "loss_real": 0.021175393033772708, "loss_synth": 0.026218924662098287, "lr": 0.0004905556400504991, "elapsed": 339.15009580296464, "steps_per_second": 43.51286187045334, "loss_extra": 0.02756256315857172} +{"step": 14400, "loss": 0.026265678079798817, "loss_real": 0.021089132498018442, "loss_synth": 0.026038375152274966, "lr": 0.0004876652506540011, "elapsed": 343.0858068160014, "steps_per_second": 43.59989802188197, "loss_extra": 0.027391331838443875} +{"step": 14600, "loss": 0.026237024664878844, "loss_real": 0.020921705877408384, "loss_synth": 0.025933206072077154, "lr": 0.00048474617420849446, "elapsed": 347.02288202696946, "steps_per_second": 43.6847059391791, "loss_extra": 0.027462979191914202} +{"step": 14800, "loss": 0.02617025850340724, "loss_real": 0.02111620580777526, "loss_synth": 0.025927457129582762, "lr": 0.000481798871669989, "elapsed": 351.0282667930005, "steps_per_second": 43.75869935783967, "loss_extra": 0.027290064599364994} +{"step": 15000, "loss": 0.026085510551929474, "loss_real": 0.020776371750980616, "loss_synth": 0.02588121237233281, "lr": 0.00047882380845172155, "elapsed": 354.9632617259631, "steps_per_second": 43.839977853501665, "loss_extra": 0.027211292423307897} +{"step": 15200, "loss": 0.025989041719585656, "loss_real": 0.020563097065314652, "loss_synth": 0.02569654455408454, "lr": 0.0004758214543506626, "elapsed": 359.70201225893106, "steps_per_second": 43.817646150157486, "loss_extra": 0.027222941368818282} +{"step": 15400, "loss": 0.02592268248088658, "loss_real": 0.020696759670972825, "loss_synth": 0.025677032358944415, "lr": 0.0004727922834733288, "elapsed": 363.71692843397614, "steps_per_second": 43.88625639851391, "loss_extra": 0.027075184052810074} +{"step": 15600, "loss": 0.02586194286122918, "loss_real": 0.02059178980998695, "loss_synth": 0.02561384147964418, "lr": 0.0004697367741609171, "elapsed": 367.6462989599677, "steps_per_second": 43.96391084759447, "loss_extra": 0.027024569557979702} +{"step": 15800, "loss": 0.025895768580958246, "loss_real": 0.020567744127474724, "loss_synth": 0.025657643051818012, "lr": 0.0004666554089137685, "elapsed": 371.5567131199641, "steps_per_second": 44.04219140039168, "loss_extra": 0.02705851534381509} +{"step": 16000, "loss": 0.025754402335733177, "loss_real": 0.020491246962919832, "loss_synth": 0.025483526950702072, "lr": 0.00046354867431517584, "elapsed": 375.46969657193404, "steps_per_second": 44.11847120783915, "loss_extra": 0.0269384909234941} +{"step": 16200, "loss": 0.02576125749386847, "loss_real": 0.02039994535036385, "loss_synth": 0.025570741798728706, "lr": 0.0004604170609545466, "elapsed": 379.4427594220033, "steps_per_second": 44.18588072198134, "loss_extra": 0.026882379362359644} +{"step": 16400, "loss": 0.025636598570272326, "loss_real": 0.020238878442905842, "loss_synth": 0.0253690298832953, "lr": 0.00045726106334993325, "elapsed": 383.352231771918, "steps_per_second": 44.259439138079685, "loss_extra": 0.026840772461146117} +{"step": 16600, "loss": 0.025616096993908287, "loss_real": 0.02028370976448059, "loss_synth": 0.025368266748264433, "lr": 0.0004540811798699431, "elapsed": 387.2640411639586, "steps_per_second": 44.33118492209792, "loss_extra": 0.026789265740662812} +{"step": 16800, "loss": 0.02548810760490596, "loss_real": 0.01998795405961573, "loss_synth": 0.025259040854871274, "lr": 0.00045087791265504006, "elapsed": 391.25914088101126, "steps_per_second": 44.39167518088487, "loss_extra": 0.026671737721189855} +{"step": 17000, "loss": 0.02552404715679586, "loss_real": 0.020324889994226394, "loss_synth": 0.025317000905051828, "lr": 0.0004476517675382507, "elapsed": 395.168047373998, "steps_per_second": 44.46092202049404, "loss_extra": 0.02663345880806446} +{"step": 17200, "loss": 0.02540346815250814, "loss_real": 0.020105477715842427, "loss_synth": 0.025127195548266174, "lr": 0.00044440325396528766, "elapsed": 399.08599202299956, "steps_per_second": 44.52772543989336, "loss_extra": 0.026598982913419604} +{"step": 17400, "loss": 0.025425384370610118, "loss_real": 0.020007299655117095, "loss_synth": 0.025122900903224946, "lr": 0.00044113288491410207, "elapsed": 403.06668613490183, "steps_per_second": 44.586017144495614, "loss_extra": 0.02666786275804043} +{"step": 17600, "loss": 0.025276615032926202, "loss_real": 0.019996086321771144, "loss_synth": 0.02503018387593329, "lr": 0.00043784117681387844, "elapsed": 406.99167613789905, "steps_per_second": 44.649440475202404, "loss_extra": 0.026439380943775178} +{"step": 17800, "loss": 0.025313337156549095, "loss_real": 0.019845307427458464, "loss_synth": 0.025071222428232433, "lr": 0.00043452864946348456, "elapsed": 411.05442059400957, "steps_per_second": 44.696147233607654, "loss_extra": 0.026504379361867905} +{"step": 18000, "loss": 0.025224839774891733, "loss_real": 0.01963329214602709, "loss_synth": 0.02502271075733006, "lr": 0.00043119582594938896, "elapsed": 415.10786085692234, "steps_per_second": 44.742945519004195, "loss_extra": 0.02639752405695617} +{"step": 18200, "loss": 0.02514422845095396, "loss_real": 0.019609319758601487, "loss_synth": 0.024861192051321267, "lr": 0.0004278432325630599, "elapsed": 419.1049654620001, "steps_per_second": 44.795020357172696, "loss_extra": 0.026387638067826628} +{"step": 18400, "loss": 0.025181902004405857, "loss_real": 0.019782242509536446, "loss_synth": 0.02492101250216365, "lr": 0.00042447139871785766, "elapsed": 423.09165304596536, "steps_per_second": 44.84721922532788, "loss_extra": 0.026379761695861818} +{"step": 18600, "loss": 0.025059419749304652, "loss_real": 0.019734591175802053, "loss_synth": 0.024736091550439595, "lr": 0.0004210808568654337, "elapsed": 427.0979315879522, "steps_per_second": 44.896290256665175, "loss_extra": 0.026306453067809342} +{"step": 18800, "loss": 0.02505106055177748, "loss_real": 0.019700843528844415, "loss_synth": 0.024767807284370065, "lr": 0.00041767214241165117, "elapsed": 431.86112995492294, "steps_per_second": 44.86323960317628, "loss_extra": 0.026262599509209394} +{"step": 19000, "loss": 0.02500890293158591, "loss_real": 0.019599812612868847, "loss_synth": 0.02476951153948903, "lr": 0.00041424579363203725, "elapsed": 435.7917391730007, "steps_per_second": 44.919176011524186, "loss_extra": 0.026186993699520825} +{"step": 19200, "loss": 0.024976426316425205, "loss_real": 0.019604669348336757, "loss_synth": 0.024733782978728414, "lr": 0.00041080235158678376, "elapsed": 439.70610192697495, "steps_per_second": 44.97579419459977, "loss_extra": 0.026151269534602763} +{"step": 19400, "loss": 0.02488787116482854, "loss_real": 0.019540823036804794, "loss_synth": 0.02453836954198778, "lr": 0.00040734236003530744, "elapsed": 443.6268471169751, "steps_per_second": 45.030716267461685, "loss_extra": 0.026164827654138207} +{"step": 19600, "loss": 0.024730208925902844, "loss_real": 0.019354006582871078, "loss_synth": 0.024517876785248516, "lr": 0.0004038663653503835, "elapsed": 447.6283373759361, "steps_per_second": 45.07627557228566, "loss_extra": 0.025875642169266938} +{"step": 19800, "loss": 0.024761629495769738, "loss_real": 0.01926061799749732, "loss_synth": 0.02444552581757307, "lr": 0.000400374916431868, "elapsed": 451.5459787310101, "steps_per_second": 45.12962724724995, "loss_extra": 0.026032077353447675} +{"step": 20000, "loss": 0.024707589149475098, "loss_real": 0.019212190443649888, "loss_synth": 0.024493473991751672, "lr": 0.00039686856462001896, "elapsed": 455.4616236319998, "steps_per_second": 45.18223840465012, "loss_extra": 0.025875505181029438} +{"step": 20200, "loss": 0.024710468696430326, "loss_real": 0.019460579152218997, "loss_synth": 0.024459991874173283, "lr": 0.00039334786360843476, "elapsed": 471.84243751794565, "steps_per_second": 44.00558599133659, "loss_extra": 0.025871940227225422} +{"step": 20400, "loss": 0.0246274440549314, "loss_real": 0.019259986570104956, "loss_synth": 0.024326510448008775, "lr": 0.00038981336935661813, "elapsed": 475.77114586299285, "steps_per_second": 44.06415437012223, "loss_extra": 0.02585958369076252} +{"step": 20600, "loss": 0.02460897035896778, "loss_real": 0.019232428162358702, "loss_synth": 0.024369604159146546, "lr": 0.00038626564000218466, "elapsed": 479.70368546200916, "steps_per_second": 44.12137502744288, "loss_extra": 0.025781381661072373} +{"step": 20800, "loss": 0.024535884261131288, "loss_real": 0.018953565750271083, "loss_synth": 0.02423280056566, "lr": 0.00038270523577272616, "elapsed": 483.63748536095954, "steps_per_second": 44.177521515767324, "loss_extra": 0.02580749266780913} +{"step": 21000, "loss": 0.024501273361966013, "loss_real": 0.019047580640763045, "loss_synth": 0.024253975572064518, "lr": 0.0003791327188973438, "elapsed": 487.64167231100146, "steps_per_second": 44.2261807674265, "loss_extra": 0.02569498590193689} +{"step": 21200, "loss": 0.024512177277356387, "loss_real": 0.018881655768491327, "loss_synth": 0.02427027978003025, "lr": 0.00037554865351786614, "elapsed": 491.56377833290026, "steps_per_second": 44.28161681425846, "loss_extra": 0.025731232780963183} +{"step": 21400, "loss": 0.024421545509248972, "loss_real": 0.018952133962884546, "loss_synth": 0.02409735670313239, "lr": 0.00037195360559976446, "elapsed": 495.47668844799045, "steps_per_second": 44.336996642647044, "loss_extra": 0.025694553926587104} +{"step": 21600, "loss": 0.024399630324915052, "loss_real": 0.018908984735608102, "loss_synth": 0.02411013060249388, "lr": 0.0003683481428427801, "elapsed": 499.4738420419162, "steps_per_second": 44.383801430148445, "loss_extra": 0.025641785906627773} +{"step": 21800, "loss": 0.024338128818199037, "loss_real": 0.019176147989928723, "loss_synth": 0.024077894138172268, "lr": 0.0003647328345912784, "elapsed": 503.38284243491944, "steps_per_second": 44.437827421454095, "loss_extra": 0.025494045056402685} +{"step": 22000, "loss": 0.024327906602993606, "loss_real": 0.018791720969602466, "loss_synth": 0.024022673489525914, "lr": 0.0003611082517443419, "elapsed": 507.3084007019643, "steps_per_second": 44.48950953921018, "loss_extra": 0.025593640273436902} +{"step": 22200, "loss": 0.02425369480624795, "loss_real": 0.018667504522018135, "loss_synth": 0.02407318348996341, "lr": 0.00035747496666562, "elapsed": 511.27994076698087, "steps_per_second": 44.53626883813116, "loss_extra": 0.02540392250753939} +{"step": 22400, "loss": 0.024300413224846124, "loss_real": 0.018675978709943593, "loss_synth": 0.02406678889878094, "lr": 0.00035383355309294483, "elapsed": 515.1866279349197, "steps_per_second": 44.588044120925076, "loss_extra": 0.02551017304882407} +{"step": 22600, "loss": 0.024296463383361697, "loss_real": 0.01869020619895309, "loss_synth": 0.024002123000100253, "lr": 0.00035018458604773206, "elapsed": 519.102582580992, "steps_per_second": 44.6382033964139, "loss_extra": 0.025563524290919303} +{"step": 22800, "loss": 0.024088851884007455, "loss_real": 0.018560576122254133, "loss_synth": 0.02387248302809894, "lr": 0.0003465286417441785, "elapsed": 523.0140256040031, "steps_per_second": 44.68798778120435, "loss_extra": 0.02526472384110093} +{"step": 23000, "loss": 0.0240252257976681, "loss_real": 0.018538254341110588, "loss_synth": 0.023837508670985698, "lr": 0.0003428662974982705, "elapsed": 527.0428566349437, "steps_per_second": 44.72680220889267, "loss_extra": 0.025165391881018878} +{"step": 23200, "loss": 0.024098887648433445, "loss_real": 0.018735652044415473, "loss_synth": 0.023779977774247528, "lr": 0.00033919813163662, "elapsed": 530.9614982609637, "steps_per_second": 44.77453280565451, "loss_extra": 0.025348193692043424} +{"step": 23400, "loss": 0.023988578729331494, "loss_real": 0.018390477690845727, "loss_synth": 0.023639651890844108, "lr": 0.000335524723405139, "elapsed": 534.8850271549309, "steps_per_second": 44.82112729620931, "loss_extra": 0.02530857781879604} +{"step": 23600, "loss": 0.024011553917080163, "loss_real": 0.01880042233504355, "loss_synth": 0.023710249550640584, "lr": 0.00033184665287757097, "elapsed": 538.8668798339786, "steps_per_second": 44.862052245171554, "loss_extra": 0.02521690451540053} +{"step": 23800, "loss": 0.024009366733953357, "loss_real": 0.018832859629765154, "loss_synth": 0.023693077117204666, "lr": 0.0003281645008638895, "elapsed": 542.7789183428977, "steps_per_second": 44.90827746620252, "loss_extra": 0.025223623607307673} +{"step": 24000, "loss": 0.023867504727095364, "loss_real": 0.018281205748207865, "loss_synth": 0.023642344092950227, "lr": 0.0003244788488185826, "elapsed": 546.6928211739287, "steps_per_second": 44.95366821732273, "loss_extra": 0.025062211593613028} +{"step": 24200, "loss": 0.0239914243016392, "loss_real": 0.01828865797724575, "loss_synth": 0.023704626634716987, "lr": 0.00032079027874883385, "elapsed": 550.6307557189139, "steps_per_second": 44.9963876306553, "loss_extra": 0.025267740646377206} +{"step": 24400, "loss": 0.023849417390301823, "loss_real": 0.01833305202424526, "loss_synth": 0.02355852865613997, "lr": 0.00031709937312261613, "elapsed": 554.5974872969091, "steps_per_second": 45.0360921441274, "loss_extra": 0.025097424313426018} +{"step": 24600, "loss": 0.02393718020990491, "loss_real": 0.01856269735842943, "loss_synth": 0.023679943457245826, "lr": 0.0003134067147767145, "elapsed": 558.5201800819486, "steps_per_second": 45.078857067471446, "loss_extra": 0.02512702885083854} +{"step": 24800, "loss": 0.02386207743547857, "loss_real": 0.01806511570699513, "loss_synth": 0.023608503323048355, "lr": 0.0003097128868246881, "elapsed": 562.4373797639273, "steps_per_second": 45.12146241736783, "loss_extra": 0.025121675468981267} +{"step": 25000, "loss": 0.023779135821387173, "loss_real": 0.01830939644947648, "loss_synth": 0.023520181886851788, "lr": 0.0003060184725647909, "elapsed": 566.4224960859865, "steps_per_second": 45.15792426376773, "loss_extra": 0.024987243227660657} +{"step": 25200, "loss": 0.023731993390247227, "loss_real": 0.018238383368588983, "loss_synth": 0.023455617548897863, "lr": 0.0003023240553878617, "elapsed": 571.1442005209392, "steps_per_second": 45.13424247911134, "loss_extra": 0.02496159590780735} +{"step": 25400, "loss": 0.02367189067415893, "loss_real": 0.018088802378624678, "loss_synth": 0.023388206642121077, "lr": 0.0002986302186851996, "elapsed": 575.0643772699405, "steps_per_second": 45.17526622774041, "loss_extra": 0.024924315176904202} +{"step": 25600, "loss": 0.023638093080371618, "loss_real": 0.01846119839232415, "loss_synth": 0.023373059779405594, "lr": 0.00029493754575644036, "elapsed": 578.9887023099, "steps_per_second": 45.21539060369181, "loss_extra": 0.02480137855745852} +{"step": 25800, "loss": 0.023622275730594992, "loss_real": 0.017912205453030766, "loss_synth": 0.023340346962213515, "lr": 0.0002912466197174462, "elapsed": 582.9106033829739, "steps_per_second": 45.25515500575225, "loss_extra": 0.024895012862980365} +{"step": 26000, "loss": 0.023628478003665805, "loss_real": 0.017985308086499573, "loss_synth": 0.023314480343833564, "lr": 0.00028755802340822527, "elapsed": 586.8280575060053, "steps_per_second": 45.294726836638276, "loss_extra": 0.024921525698155166} +{"step": 26200, "loss": 0.023528204234316945, "loss_real": 0.017803381248377263, "loss_synth": 0.023358637848868966, "lr": 0.0002838723393008943, "elapsed": 590.7612709389068, "steps_per_second": 45.33252624364383, "loss_extra": 0.024691617861390115} +{"step": 26400, "loss": 0.023480710042640567, "loss_real": 0.017680389299057422, "loss_synth": 0.023172324830666183, "lr": 0.00028019014940769974, "elapsed": 594.6795526359929, "steps_per_second": 45.37097881081968, "loss_extra": 0.02479547061957419} +{"step": 26600, "loss": 0.023527916371822357, "loss_real": 0.017981768078170715, "loss_synth": 0.023217104990035296, "lr": 0.000276512035189111, "elapsed": 598.5924975349335, "steps_per_second": 45.40933060685259, "loss_extra": 0.02480093590915203} +{"step": 26800, "loss": 0.023416235037148, "loss_real": 0.01779656416270882, "loss_synth": 0.0231405845656991, "lr": 0.00027283857746200125, "elapsed": 602.5023045788985, "steps_per_second": 45.44741538536133, "loss_extra": 0.024667015355080365} +{"step": 27000, "loss": 0.023473152061924338, "loss_real": 0.017946113473735748, "loss_synth": 0.023268996477127074, "lr": 0.0002691703563079296, "elapsed": 606.4190025469288, "steps_per_second": 45.484470435535904, "loss_extra": 0.024636647729203105} +{"step": 27200, "loss": 0.02340511590242386, "loss_real": 0.017633523303084077, "loss_synth": 0.02317411872558296, "lr": 0.0002655079509815397, "elapsed": 610.3392632909818, "steps_per_second": 45.5207682400665, "loss_extra": 0.02463782552629709} +{"step": 27400, "loss": 0.02327798946760595, "loss_real": 0.01792026638519019, "loss_synth": 0.023021312607452275, "lr": 0.00026185193981908867, "elapsed": 614.254112239927, "steps_per_second": 45.55700273075957, "loss_extra": 0.024464368717744947} +{"step": 27600, "loss": 0.023361605443060398, "loss_real": 0.017562846201471985, "loss_synth": 0.02311234672553837, "lr": 0.0002582029001471206, "elapsed": 618.1751677339198, "steps_per_second": 45.59230123170275, "loss_extra": 0.024617218635976313} +{"step": 27800, "loss": 0.023386899009346963, "loss_real": 0.017664491860195995, "loss_synth": 0.023203723402693867, "lr": 0.00025456140819130085, "elapsed": 622.0863515059464, "steps_per_second": 45.627884658929716, "loss_extra": 0.02456344462931156} +{"step": 28000, "loss": 0.023234074171632528, "loss_real": 0.017655724142678082, "loss_synth": 0.022914351848885416, "lr": 0.0002509280389854229, "elapsed": 626.0080190469744, "steps_per_second": 45.66223344318312, "loss_extra": 0.024521561078727244} +{"step": 28200, "loss": 0.023310567373409866, "loss_real": 0.017408999693579973, "loss_synth": 0.023046670472249387, "lr": 0.00024730336628060344, "elapsed": 629.92439125292, "steps_per_second": 45.696537755934116, "loss_extra": 0.024598617553710938} +{"step": 28400, "loss": 0.023202435001730918, "loss_real": 0.017477710703387855, "loss_synth": 0.023069409672170877, "lr": 0.00024368796245468133, "elapsed": 633.8405180890113, "steps_per_second": 45.730427496673684, "loss_extra": 0.024329445445910095} +{"step": 28600, "loss": 0.02320970014669001, "loss_real": 0.017532996688969432, "loss_synth": 0.022965669482946396, "lr": 0.00024008239842183163, "elapsed": 637.7529758929741, "steps_per_second": 45.764161140467955, "loss_extra": 0.02443890267983079} +{"step": 28800, "loss": 0.02314249417744577, "loss_real": 0.017570680691860616, "loss_synth": 0.022827493734657766, "lr": 0.00023648724354241227, "elapsed": 641.6785957149696, "steps_per_second": 45.79651656546005, "loss_extra": 0.0244241439178586} +{"step": 29000, "loss": 0.02315028550103307, "loss_real": 0.017514706337824464, "loss_synth": 0.022870788043364884, "lr": 0.00023290306553305494, "elapsed": 645.595480952994, "steps_per_second": 45.82910309630882, "loss_extra": 0.024407660299912096} +{"step": 29200, "loss": 0.023051614016294478, "loss_real": 0.017240407592616976, "loss_synth": 0.02277738750912249, "lr": 0.00022933043037701642, "elapsed": 649.5137628379744, "steps_per_second": 45.86118813879532, "loss_extra": 0.024334251899272203} +{"step": 29400, "loss": 0.023025331413373352, "loss_real": 0.01740250848699361, "loss_synth": 0.02269051654264331, "lr": 0.00022576990223480343, "elapsed": 653.4290657429956, "steps_per_second": 45.8930940747224, "loss_extra": 0.024335572896525264} +{"step": 29600, "loss": 0.023047784008085728, "loss_real": 0.017331516458652912, "loss_synth": 0.022750172624364497, "lr": 0.00022222204335508425, "elapsed": 657.3423040380003, "steps_per_second": 45.92475947215263, "loss_extra": 0.02433721413835883} +{"step": 29800, "loss": 0.023038090225309133, "loss_real": 0.01741476665250957, "loss_synth": 0.022776929922401906, "lr": 0.00021868741398590414, "elapsed": 661.2612290749094, "steps_per_second": 45.95563967324641, "loss_extra": 0.024275076445192098} +{"step": 30000, "loss": 0.022973365215584636, "loss_real": 0.017339996914379298, "loss_synth": 0.022684725616127253, "lr": 0.00021516657228621528, "elapsed": 665.1742585959146, "steps_per_second": 45.9865644588422, "loss_extra": 0.024239459801465274} +{"step": 30200, "loss": 0.022975075375288725, "loss_real": 0.017443078239448368, "loss_synth": 0.02272080732509494, "lr": 0.00021166007423773693, "elapsed": 681.3497414930025, "steps_per_second": 45.1730679458273, "loss_extra": 0.024189332611858846} +{"step": 30400, "loss": 0.022886017756536602, "loss_real": 0.0172402262641117, "loss_synth": 0.022565602725371718, "lr": 0.0002081684735571596, "elapsed": 685.2766287740087, "steps_per_second": 45.20669112111157, "loss_extra": 0.024185911044478415} +{"step": 30600, "loss": 0.022954864185303448, "loss_real": 0.017281206105835736, "loss_synth": 0.022711526425555347, "lr": 0.00020469232160870657, "elapsed": 689.2034386330051, "steps_per_second": 45.23992904558261, "loss_extra": 0.024182847989723085} +{"step": 30800, "loss": 0.022974920189008118, "loss_real": 0.017477483567781747, "loss_synth": 0.022627110593020916, "lr": 0.00020123216731706737, "elapsed": 693.1159450599225, "steps_per_second": 45.27373513572859, "loss_extra": 0.024276318363845348} +{"step": 31000, "loss": 0.022833728054538368, "loss_real": 0.01725732467137277, "loss_synth": 0.0225482623744756, "lr": 0.00019778855708071612, "elapsed": 697.0300457739504, "steps_per_second": 45.30704902455774, "loss_extra": 0.02408676511608064} +{"step": 31200, "loss": 0.02283939060755074, "loss_real": 0.016929379967041313, "loss_synth": 0.022522930065169932, "lr": 0.00019436203468562864, "elapsed": 700.9634757559979, "steps_per_second": 45.33871039079802, "loss_extra": 0.02418124849908054} +{"step": 31400, "loss": 0.022703926432877778, "loss_real": 0.017004706314764917, "loss_synth": 0.02242407717742026, "lr": 0.00019095314121941266, "elapsed": 704.8724828559207, "steps_per_second": 45.37161299842511, "loss_extra": 0.023972708079963923} +{"step": 31600, "loss": 0.022767700152471662, "loss_real": 0.0171559631312266, "loss_synth": 0.022515210136771203, "lr": 0.0001875624149858636, "elapsed": 708.7749174719211, "steps_per_second": 45.40457477680235, "loss_extra": 0.023994039706885815} +{"step": 31800, "loss": 0.02271920862607658, "loss_real": 0.01685634502209723, "loss_synth": 0.022455435041338206, "lr": 0.00018419039141996036, "elapsed": 712.6693167829653, "steps_per_second": 45.437690611835066, "loss_extra": 0.024000412011519076} +{"step": 32000, "loss": 0.02266814378090203, "loss_real": 0.01685953339096159, "loss_synth": 0.022370099499821664, "lr": 0.0001808376030033136, "elapsed": 716.5567855439149, "steps_per_second": 45.47088780174273, "loss_extra": 0.0239740473870188} +{"step": 32200, "loss": 0.02268345477990806, "loss_real": 0.016993161560967564, "loss_synth": 0.02241886575706303, "lr": 0.0001775045791800812, "elapsed": 720.4013289689319, "steps_per_second": 45.506480654608346, "loss_extra": 0.02393548986874521} +{"step": 32400, "loss": 0.02263633321970701, "loss_real": 0.01694635419175029, "loss_synth": 0.022389955129474403, "lr": 0.00017419184627336242, "elapsed": 724.2373006149428, "steps_per_second": 45.542237539656284, "loss_extra": 0.023870179979130626} +{"step": 32600, "loss": 0.022593841468915344, "loss_real": 0.016925024008378385, "loss_synth": 0.02236756735481322, "lr": 0.00017089992740208575, "elapsed": 728.0663831299171, "steps_per_second": 45.578049884557814, "loss_extra": 0.02380399308167398} +{"step": 32800, "loss": 0.02262646535411477, "loss_real": 0.017003449257463218, "loss_synth": 0.022314249901100994, "lr": 0.00016762934239840198, "elapsed": 731.8845132669667, "steps_per_second": 45.61417558184864, "loss_extra": 0.023914237013086675} +{"step": 33000, "loss": 0.022634143298491834, "loss_real": 0.01681045260746032, "loss_synth": 0.022391413934528828, "lr": 0.000164380607725597, "elapsed": 735.6891758749261, "steps_per_second": 45.650770137663805, "loss_extra": 0.023887586127966643} +{"step": 33200, "loss": 0.022636667024344206, "loss_real": 0.016940390444360673, "loss_synth": 0.022282893927767874, "lr": 0.00016115423639653619, "elapsed": 739.4780725539895, "steps_per_second": 45.68797272730929, "loss_extra": 0.02397854751907289} +{"step": 33400, "loss": 0.022523549208417534, "loss_real": 0.016805634121410548, "loss_synth": 0.02222236666828394, "lr": 0.0001579507378926539, "elapsed": 743.2656542019686, "steps_per_second": 45.72487170352228, "loss_extra": 0.02381682125851512} +{"step": 33600, "loss": 0.02255604856647551, "loss_real": 0.017079255357384682, "loss_synth": 0.022287559350952505, "lr": 0.00015477061808349973, "elapsed": 747.0520016419468, "steps_per_second": 45.76146690392705, "loss_extra": 0.023774876315146683} +{"step": 33800, "loss": 0.022543795704841614, "loss_real": 0.016741932560689746, "loss_synth": 0.022272100485861302, "lr": 0.0001516143791468568, "elapsed": 750.8482809739653, "steps_per_second": 45.797070318828524, "loss_extra": 0.02382228970527649} +{"step": 34000, "loss": 0.022558654211461544, "loss_real": 0.016746697230264545, "loss_synth": 0.022300994591787457, "lr": 0.00014848251948944142, "elapsed": 754.6919491139706, "steps_per_second": 45.82938175067079, "loss_extra": 0.023824925553053617} +{"step": 34200, "loss": 0.022510670144110918, "loss_real": 0.016525992606766522, "loss_synth": 0.0221817721799016, "lr": 0.00014537553366819925, "elapsed": 758.6674376509618, "steps_per_second": 45.853254694006345, "loss_extra": 0.023877884550020097} +{"step": 34400, "loss": 0.022449787659570574, "loss_real": 0.01673162864521146, "loss_synth": 0.02212234981358051, "lr": 0.0001422939123122089, "elapsed": 762.4738653849345, "steps_per_second": 45.887220436606164, "loss_extra": 0.023769246339797975} +{"step": 34600, "loss": 0.0224257580563426, "loss_real": 0.016490829726681113, "loss_synth": 0.02213007784448564, "lr": 0.00013923814204520548, "elapsed": 766.3034583319677, "steps_per_second": 45.919431226216126, "loss_extra": 0.023751252833753823} +{"step": 34800, "loss": 0.022316270489245654, "loss_real": 0.01653461086098105, "loss_synth": 0.022101210840046407, "lr": 0.00013620870540873793, "elapsed": 770.0849310839549, "steps_per_second": 45.95423616419789, "loss_extra": 0.023534858878701926} +{"step": 35000, "loss": 0.022354449294507504, "loss_real": 0.016402491419576108, "loss_synth": 0.022127961553633214, "lr": 0.00013320608078596944, "elapsed": 774.3127908149036, "steps_per_second": 45.96173698421907, "loss_extra": 0.02361400314606726} +{"step": 35200, "loss": 0.022295271437615158, "loss_real": 0.016473527569323777, "loss_synth": 0.022069136295467615, "lr": 0.00013023074232613552, "elapsed": 778.9780880489852, "steps_per_second": 45.94290938182943, "loss_extra": 0.023531852178275584} +{"step": 35400, "loss": 0.022371776765212417, "loss_real": 0.016893137786537407, "loss_synth": 0.022081415373831986, "lr": 0.0001272831598696703, "elapsed": 782.7148966699606, "steps_per_second": 45.979693315890714, "loss_extra": 0.023612704584375022} +{"step": 35600, "loss": 0.02229509621858597, "loss_real": 0.016445466075092553, "loss_synth": 0.022037061005830763, "lr": 0.00012436379887401295, "elapsed": 786.4479226579424, "steps_per_second": 46.01634689800834, "loss_extra": 0.023568286653608085} +{"step": 35800, "loss": 0.02233000561594963, "loss_real": 0.016357408384792507, "loss_synth": 0.022069476349279284, "lr": 0.00012147312034010696, "elapsed": 790.1870124049019, "steps_per_second": 46.052289227508616, "loss_extra": 0.02362704252824187} +{"step": 36000, "loss": 0.022237029373645783, "loss_real": 0.01630387964658439, "loss_synth": 0.02193687786348164, "lr": 0.00011861158073960271, "elapsed": 793.929220105987, "steps_per_second": 46.08770349884259, "loss_extra": 0.023566667176783084} +{"step": 36200, "loss": 0.022235578214749693, "loss_real": 0.016165244285948576, "loss_synth": 0.021902219699695705, "lr": 0.00011577963194277514, "elapsed": 797.6665430569556, "steps_per_second": 46.123067106668536, "loss_extra": 0.023622115198522805} +{"step": 36400, "loss": 0.022256229277700185, "loss_real": 0.016257080198265612, "loss_synth": 0.021916439523920417, "lr": 0.0001129777211471684, "elapsed": 801.4123352989554, "steps_per_second": 46.15759980336078, "loss_extra": 0.023636803422123195} +{"step": 36600, "loss": 0.02226482207886875, "loss_real": 0.016403990001417696, "loss_synth": 0.022014998998492956, "lr": 0.00011020629080697766, "elapsed": 805.1665131519549, "steps_per_second": 46.19131713990087, "loss_extra": 0.023531781015917658} +{"step": 36800, "loss": 0.02226864269003272, "loss_real": 0.016487971008755268, "loss_synth": 0.021946410266682505, "lr": 0.00010746577856318116, "elapsed": 808.9109064959921, "steps_per_second": 46.22528461466636, "loss_extra": 0.023593778144568204} +{"step": 37000, "loss": 0.022195498337969185, "loss_real": 0.016455564978532494, "loss_synth": 0.02186754213646054, "lr": 0.00010475661717443124, "elapsed": 812.6492511179531, "steps_per_second": 46.25928388120946, "loss_extra": 0.02351925591006875} +{"step": 37200, "loss": 0.02222674964927137, "loss_real": 0.01614506696816534, "loss_synth": 0.021894862791523338, "lr": 0.00010207923444871681, "elapsed": 816.3826090929797, "steps_per_second": 46.293254085655654, "loss_extra": 0.02361379289999604} +{"step": 37400, "loss": 0.022160096066072582, "loss_real": 0.01638528499752283, "loss_synth": 0.021873952262103556, "lr": 9.94340531758075e-05, "elapsed": 820.1806472869357, "steps_per_second": 46.323198755562416, "loss_extra": 0.0234482775721699} +{"step": 37600, "loss": 0.022122993916273117, "loss_real": 0.01638953878544271, "loss_synth": 0.02187267723493278, "lr": 9.682149106049004e-05, "elapsed": 823.9177915219916, "steps_per_second": 46.35634294916773, "loss_extra": 0.023368315557017922} +{"step": 37800, "loss": 0.022113103326410054, "loss_real": 0.016254323427565397, "loss_synth": 0.021865348452702164, "lr": 9.424196065660837e-05, "elapsed": 827.6867597309174, "steps_per_second": 46.38737146787976, "loss_extra": 0.02337764624506235} +{"step": 38000, "loss": 0.022116000801324844, "loss_real": 0.016207168265245854, "loss_synth": 0.021846362864598633, "lr": 9.169586930191606e-05, "elapsed": 831.4415581419598, "steps_per_second": 46.41891772701093, "loss_extra": 0.023411029735580086} +{"step": 38200, "loss": 0.022094957064837217, "loss_real": 0.016185448318719865, "loss_synth": 0.021770505495369435, "lr": 8.91836190537533e-05, "elapsed": 835.1822040179977, "steps_per_second": 46.450975300346784, "loss_extra": 0.023444685088470578} +{"step": 38400, "loss": 0.022099806685000657, "loss_real": 0.016285618687979876, "loss_synth": 0.021881030593067407, "lr": 8.670560662555727e-05, "elapsed": 838.9210574189201, "steps_per_second": 46.48284342504396, "loss_extra": 0.02332774695008993} +{"step": 38600, "loss": 0.021994193810969592, "loss_real": 0.016169095276854933, "loss_synth": 0.021697859819978474, "lr": 8.426222332421624e-05, "elapsed": 842.6622115779901, "steps_per_second": 46.51429541269913, "loss_extra": 0.02330125871114433} +{"step": 38800, "loss": 0.02203255074098706, "loss_real": 0.016241939431056382, "loss_synth": 0.021778206722810865, "lr": 8.185385498827815e-05, "elapsed": 846.4182021289598, "steps_per_second": 46.54463670359737, "loss_extra": 0.023291812324896456} +{"step": 39000, "loss": 0.021956560499966145, "loss_real": 0.01595057999715209, "loss_synth": 0.021691742138937115, "lr": 7.948088192702195e-05, "elapsed": 850.1649608409498, "steps_per_second": 46.57521927869, "loss_extra": 0.023263667682185768} +{"step": 39200, "loss": 0.02200959953479469, "loss_real": 0.016110960091464222, "loss_synth": 0.021777223302051424, "lr": 7.714367886040248e-05, "elapsed": 853.9214505399577, "steps_per_second": 46.604990199260264, "loss_extra": 0.02326575360260904} +{"step": 39400, "loss": 0.021995517052710058, "loss_real": 0.01603827235288918, "loss_synth": 0.02170710260979831, "lr": 7.48426148598775e-05, "elapsed": 857.6520099729532, "steps_per_second": 46.635927713313926, "loss_extra": 0.023317653955891728} +{"step": 39600, "loss": 0.022028930457308887, "loss_real": 0.01619029095862061, "loss_synth": 0.021713193161413073, "lr": 7.25780532901276e-05, "elapsed": 861.4009034509072, "steps_per_second": 46.66558495714801, "loss_extra": 0.023357669152319432} +{"step": 39800, "loss": 0.02195792510174215, "loss_real": 0.015963898608461022, "loss_synth": 0.0217033710796386, "lr": 7.035035175167622e-05, "elapsed": 865.1336594909662, "steps_per_second": 46.69586541685421, "loss_extra": 0.023252734923735262} +{"step": 40000, "loss": 0.021957559045404196, "loss_real": 0.016017076703719796, "loss_synth": 0.021724356105551124, "lr": 6.81598620244206e-05, "elapsed": 868.8697698479518, "steps_per_second": 46.725698705419134, "loss_extra": 0.023221805803477765} +{"step": 40200, "loss": 0.021890485966578124, "loss_real": 0.015852048378437757, "loss_synth": 0.02161996160633862, "lr": 6.600693001208181e-05, "elapsed": 884.9018351559062, "steps_per_second": 46.09605247437283, "loss_extra": 0.023208913961425423} +{"step": 40400, "loss": 0.022012913236394524, "loss_real": 0.01593628281727433, "loss_synth": 0.021732276668772102, "lr": 6.38918956875819e-05, "elapsed": 889.8935495849, "steps_per_second": 46.0617360851657, "loss_extra": 0.02334804548881948} +{"step": 40600, "loss": 0.02188713745214045, "loss_real": 0.01609258422628045, "loss_synth": 0.021626183930784464, "lr": 6.181509303935915e-05, "elapsed": 895.0152086089365, "steps_per_second": 46.021028457457746, "loss_extra": 0.02315366515889764} +{"step": 40800, "loss": 0.021875206204131244, "loss_real": 0.016062130839563905, "loss_synth": 0.021520836278796196, "lr": 5.977685001862671e-05, "elapsed": 899.8223205849063, "steps_per_second": 45.997096183677264, "loss_extra": 0.023237972417846323} +{"step": 41000, "loss": 0.02195548452436924, "loss_real": 0.016222068625502288, "loss_synth": 0.02168301686644554, "lr": 5.7777488487585654e-05, "elapsed": 904.822574352962, "steps_per_second": 45.96346752450335, "loss_extra": 0.023222856735810638} +{"step": 41200, "loss": 0.021903266664594412, "loss_real": 0.01570705834776163, "loss_synth": 0.021663869516924023, "lr": 5.581732416859908e-05, "elapsed": 909.677521420992, "steps_per_second": 45.93765526656681, "loss_extra": 0.023218108620494605} +{"step": 41400, "loss": 0.021830003997310995, "loss_real": 0.015584975858218967, "loss_synth": 0.02159471994265914, "lr": 5.3896666594335835e-05, "elapsed": 914.2773525828961, "steps_per_second": 45.9251140739267, "loss_extra": 0.023149231616407633} +{"step": 41600, "loss": 0.021869574887678028, "loss_real": 0.015755638009868563, "loss_synth": 0.021627065381035208, "lr": 5.20158190588919e-05, "elapsed": 919.2626362139126, "steps_per_second": 45.89317674710654, "loss_extra": 0.02317322315648198} +{"step": 41800, "loss": 0.02189157295040786, "loss_real": 0.016072191200219094, "loss_synth": 0.021713034696877003, "lr": 5.017507856989665e-05, "elapsed": 924.3660473669879, "steps_per_second": 45.85564560060144, "loss_extra": 0.02308034824207425} +{"step": 42000, "loss": 0.021809911448508502, "loss_real": 0.01595456794369966, "loss_synth": 0.021549262395128607, "lr": 4.837473580161169e-05, "elapsed": 929.258654847974, "steps_per_second": 45.8290716206061, "loss_extra": 0.023086697086691855} +{"step": 42200, "loss": 0.02183040399104357, "loss_real": 0.01590016230009496, "loss_synth": 0.021564301447942854, "lr": 4.6615075049030575e-05, "elapsed": 934.2129117609002, "steps_per_second": 45.79971532307073, "loss_extra": 0.02312563233077526} +{"step": 42400, "loss": 0.021795316757634284, "loss_real": 0.015807883413508535, "loss_synth": 0.021527809016406538, "lr": 4.489637418298455e-05, "elapsed": 938.7779553699074, "steps_per_second": 45.78991185095095, "loss_extra": 0.02310188002884388} +{"step": 42600, "loss": 0.021819208543747665, "loss_real": 0.0159314674930647, "loss_synth": 0.021537925703451036, "lr": 4.321890460626433e-05, "elapsed": 942.55803731794, "steps_per_second": 45.818855595985184, "loss_extra": 0.023122169058769942} +{"step": 42800, "loss": 0.021775778057053684, "loss_real": 0.015981077956967057, "loss_synth": 0.021511437613517048, "lr": 4.158293121076186e-05, "elapsed": 946.3099501800025, "steps_per_second": 45.848948408403466, "loss_extra": 0.023045704355463385} +{"step": 43000, "loss": 0.021830501686781644, "loss_real": 0.01573991508688778, "loss_synth": 0.021632043421268465, "lr": 3.99887123356411e-05, "elapsed": 950.0735819539987, "steps_per_second": 45.87822665971042, "loss_extra": 0.023086228929460047} +{"step": 43200, "loss": 0.02168919876217842, "loss_real": 0.015623862729407847, "loss_synth": 0.02139431156218052, "lr": 3.843649972654328e-05, "elapsed": 953.8257654620102, "steps_per_second": 45.90782921244972, "loss_extra": 0.02303655933588743} +{"step": 43400, "loss": 0.021805299241095782, "loss_real": 0.01582774474285543, "loss_synth": 0.021519423006102444, "lr": 3.69265384958331e-05, "elapsed": 957.5898412889801, "steps_per_second": 45.936618393966135, "loss_extra": 0.023128436766564845} +{"step": 43600, "loss": 0.021817961987107993, "loss_real": 0.01585295139811933, "loss_synth": 0.02154303609393537, "lr": 3.545906708389291e-05, "elapsed": 961.3645038040122, "steps_per_second": 45.96466609081416, "loss_extra": 0.023128016237169504} +{"step": 43800, "loss": 0.021728473734110593, "loss_real": 0.015727354642003775, "loss_synth": 0.02154119897633791, "lr": 3.403431722147019e-05, "elapsed": 965.1556110229576, "steps_per_second": 45.9916972520118, "loss_extra": 0.02295752167701721} +{"step": 44000, "loss": 0.021758421352133156, "loss_real": 0.015895889457315206, "loss_synth": 0.02153406516648829, "lr": 3.265251389308442e-05, "elapsed": 968.9444867859129, "steps_per_second": 46.01862146931645, "loss_extra": 0.023000316666439174} +{"step": 44200, "loss": 0.0217598788253963, "loss_real": 0.015609179669991136, "loss_synth": 0.021503073712810874, "lr": 3.1313875301499545e-05, "elapsed": 972.7149033019086, "steps_per_second": 46.04621860546587, "loss_extra": 0.02308414869941771} +{"step": 44400, "loss": 0.021737547516822817, "loss_real": 0.01591011617798358, "loss_synth": 0.021469532633200287, "lr": 3.0018612833267117e-05, "elapsed": 976.483693622984, "steps_per_second": 46.07367753954228, "loss_extra": 0.02301681854762137} +{"step": 44600, "loss": 0.021765759270638226, "loss_real": 0.015914039826020597, "loss_synth": 0.021529993666335942, "lr": 2.8766931025346027e-05, "elapsed": 980.2138883139705, "steps_per_second": 46.10276178108759, "loss_extra": 0.02301713733933866} +{"step": 44800, "loss": 0.021739190723747016, "loss_real": 0.015508547481149436, "loss_synth": 0.02152338307350874, "lr": 2.755902753280375e-05, "elapsed": 983.9585602809675, "steps_per_second": 46.13093489115069, "loss_extra": 0.023036525472998618} +{"step": 45000, "loss": 0.0216931130643934, "loss_real": 0.015597695815376938, "loss_synth": 0.02146269547753036, "lr": 2.639509309760422e-05, "elapsed": 987.770541306003, "steps_per_second": 46.155704851556926, "loss_extra": 0.022981503205373885} +{"step": 45200, "loss": 0.02175857868976891, "loss_real": 0.015684169083833695, "loss_synth": 0.021493769874796273, "lr": 2.5275311518487436e-05, "elapsed": 992.3195317769423, "steps_per_second": 46.14553459455631, "loss_extra": 0.02307756455615163} +{"step": 45400, "loss": 0.02170192068442702, "loss_real": 0.015893535995855926, "loss_synth": 0.02142712878994644, "lr": 2.4199859621945708e-05, "elapsed": 996.1208609649912, "steps_per_second": 46.17053751160807, "loss_extra": 0.02298463079147041} +{"step": 45600, "loss": 0.021656246175989508, "loss_real": 0.01546463165897876, "loss_synth": 0.02143303882330656, "lr": 2.316890723430054e-05, "elapsed": 999.9487253288971, "steps_per_second": 46.19410606311747, "loss_extra": 0.02295416908338666} +{"step": 45800, "loss": 0.02168145096860826, "loss_real": 0.015521252700127662, "loss_synth": 0.021506498204544186, "lr": 2.218261715488513e-05, "elapsed": 1003.8121286180103, "steps_per_second": 46.21583511608237, "loss_extra": 0.022925865845754744} +{"step": 46000, "loss": 0.021728670150041582, "loss_real": 0.015539174787700177, "loss_synth": 0.021481993962079286, "lr": 2.1241145130336496e-05, "elapsed": 1007.6727908200119, "steps_per_second": 46.23752280255854, "loss_extra": 0.023049594080075623} +{"step": 46200, "loss": 0.021702483454719187, "loss_real": 0.015620411913841963, "loss_synth": 0.021461676014587282, "lr": 2.0344639830001105e-05, "elapsed": 1011.5357883259421, "steps_per_second": 46.25893464869602, "loss_extra": 0.02299890110269189} +{"step": 46400, "loss": 0.02165355152450502, "loss_real": 0.015675171930342912, "loss_synth": 0.021344503397122027, "lr": 1.949324282245851e-05, "elapsed": 1015.3241978759179, "steps_per_second": 46.283624772160756, "loss_extra": 0.02299990616738796} +{"step": 46600, "loss": 0.02167328869923949, "loss_real": 0.015668159029446543, "loss_synth": 0.021434621550142766, "lr": 1.8687088553165976e-05, "elapsed": 1019.1314571819967, "steps_per_second": 46.30726157962147, "loss_extra": 0.022954207714647054} +{"step": 46800, "loss": 0.02178274719044566, "loss_real": 0.015549683775752783, "loss_synth": 0.02148381382226944, "lr": 1.7926304323227836e-05, "elapsed": 1022.9055550509365, "steps_per_second": 46.33224126239047, "loss_extra": 0.02316327582113445} +{"step": 47000, "loss": 0.0216583286318928, "loss_real": 0.015551587450318038, "loss_synth": 0.021424482734873893, "lr": 1.721101026929328e-05, "elapsed": 1026.7769446069142, "steps_per_second": 46.35258692588885, "loss_extra": 0.022952099954709412} +{"step": 47200, "loss": 0.021589598255231976, "loss_real": 0.015452708844095468, "loss_synth": 0.02136387299746275, "lr": 1.6541319344585365e-05, "elapsed": 1030.7171312049031, "steps_per_second": 46.369643664743094, "loss_extra": 0.02288052109070122} +{"step": 47400, "loss": 0.021705853873863815, "loss_real": 0.015848846985027195, "loss_synth": 0.021502718664705753, "lr": 1.5917337301064426e-05, "elapsed": 1034.8528140529525, "steps_per_second": 46.377696022043146, "loss_extra": 0.02292565836571157} +{"step": 47600, "loss": 0.021675285678356887, "loss_real": 0.015584184029139579, "loss_synth": 0.021421529110521077, "lr": 1.533916267272854e-05, "elapsed": 1038.9344222389627, "steps_per_second": 46.388127912007576, "loss_extra": 0.022986165964975953} +{"step": 47800, "loss": 0.02158165706321597, "loss_real": 0.015743252877146004, "loss_synth": 0.02129308320581913, "lr": 1.480688676005397e-05, "elapsed": 1043.201734044007, "steps_per_second": 46.39011491790898, "loss_extra": 0.022883306527510285} +{"step": 48000, "loss": 0.021708743087947367, "loss_real": 0.01579467844683677, "loss_synth": 0.021441332520917056, "lr": 1.432059361557764e-05, "elapsed": 1047.6095019539353, "steps_per_second": 46.38578858768528, "loss_extra": 0.023002463299781083} +{"step": 48200, "loss": 0.02166185334324837, "loss_real": 0.015729368766769766, "loss_synth": 0.021473419424146413, "lr": 1.3880360030624374e-05, "elapsed": 1052.5453866639873, "steps_per_second": 46.35794026830947, "loss_extra": 0.022880131416022777} +{"step": 48400, "loss": 0.021636093324050306, "loss_real": 0.015836712284944952, "loss_synth": 0.021331218220293522, "lr": 1.3486255523180529e-05, "elapsed": 1057.9326236629859, "steps_per_second": 46.31034661939495, "loss_extra": 0.022947195563465358} +{"step": 48600, "loss": 0.02162220820784569, "loss_real": 0.01570946436841041, "loss_synth": 0.02141423082910478, "lr": 1.313834232691649e-05, "elapsed": 1062.4787003649399, "steps_per_second": 46.30031449274589, "loss_extra": 0.022856517815962433} +{"step": 48800, "loss": 0.021658959574997427, "loss_real": 0.015796695817261935, "loss_synth": 0.02140669063664973, "lr": 1.2836675381359077e-05, "elapsed": 1066.447550997953, "steps_per_second": 46.315728706270036, "loss_extra": 0.022928602993488312} +{"step": 49000, "loss": 0.02163564040325582, "loss_real": 0.015734275579452516, "loss_synth": 0.02130137505941093, "lr": 1.2581302323216026e-05, "elapsed": 1070.4068046509055, "steps_per_second": 46.33144762381318, "loss_extra": 0.022993725556880236} +{"step": 49200, "loss": 0.021651582904160024, "loss_real": 0.01568963335826993, "loss_synth": 0.02139441443607211, "lr": 1.2372263478853567e-05, "elapsed": 1074.388131154934, "steps_per_second": 46.346085618623235, "loss_extra": 0.022943423595279455} +{"step": 49400, "loss": 0.02162853507325053, "loss_real": 0.01571076379623264, "loss_synth": 0.021305955974385143, "lr": 1.2209591857928498e-05, "elapsed": 1078.3330122539774, "steps_per_second": 46.362199943571454, "loss_extra": 0.022977834017947316} +{"step": 49600, "loss": 0.02167187166400254, "loss_real": 0.015477031166665257, "loss_synth": 0.02142747468315065, "lr": 1.2093313148175555e-05, "elapsed": 1082.303385474952, "steps_per_second": 46.377089956780566, "loss_extra": 0.022991454750299452} +{"step": 49800, "loss": 0.021694902768358587, "loss_real": 0.015873419740237295, "loss_synth": 0.021435308307409286, "lr": 1.2023445711350887e-05, "elapsed": 1086.2282245469978, "steps_per_second": 46.393837745519384, "loss_extra": 0.0229647558927536} +{"step": 50000, "loss": 0.021616445211693643, "loss_real": 0.015702546215616165, "loss_synth": 0.021318270340561867, "lr": 1.2000000580332747e-05, "elapsed": 1090.2475918259006, "steps_per_second": 46.40639172628212, "loss_extra": 0.02294077037833631} diff --git a/shared/package-files/ee/ee338f1a4128a38c862b39fb2308c492225636a31ead0f70d439e7976992bcbe/ensemble-mean-2M-same-B.log b/shared/package-files/ee/ee338f1a4128a38c862b39fb2308c492225636a31ead0f70d439e7976992bcbe/ensemble-mean-2M-same-B.log new file mode 100644 index 0000000000000000000000000000000000000000..ac8f1f1acf51537f519f2fd0f49f7086b1522855 --- /dev/null +++ b/shared/package-files/ee/ee338f1a4128a38c862b39fb2308c492225636a31ead0f70d439e7976992bcbe/ensemble-mean-2M-same-B.log @@ -0,0 +1,8 @@ +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 96.02348616000381} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 101.27614499200718} +ind meanD all=0.4896 dom=0.7226 non=0.2556 h5=0.6418 h20=0.7159 | diff=+0.0000 [+0.0000,+0.0000] +agg meanD all=0.6701 dom=0.8100 non=0.5297 h5=0.8400 h20=0.9058 | diff=+0.0000 [+0.0000,+0.0000] +ind Dmean all=0.4929 dom=0.7281 non=0.2567 h5=0.6437 h20=0.7165 | diff=+0.0033 [+0.0014,+0.0053] +agg Dmean all=0.6711 dom=0.8113 non=0.5304 h5=0.8408 h20=0.9052 | diff=+0.0010 [-0.0059,+0.0082] +ind gmean all=0.4886 dom=0.7217 non=0.2546 h5=0.6404 h20=0.7156 | diff=-0.0010 [-0.0023,+0.0003] +agg gmean all=0.6676 dom=0.8077 non=0.5269 h5=0.8409 h20=0.9062 | diff=-0.0026 [-0.0078,+0.0016] diff --git a/shared/package-files/ee/eea1298bb79d57fe452028e29b3d3a420e2ece4e049629b7922cd434be98dbd0/netprop-final-m3.log b/shared/package-files/ee/eea1298bb79d57fe452028e29b3d3a420e2ece4e049629b7922cd434be98dbd0/netprop-final-m3.log new file mode 100644 index 0000000000000000000000000000000000000000..2cc6c2b1a7af919e6cb9c81a64de158228d62085 --- /dev/null +++ b/shared/package-files/ee/eea1298bb79d57fe452028e29b3d3a420e2ece4e049629b7922cd434be98dbd0/netprop-final-m3.log @@ -0,0 +1,4 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=3 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.4356 (domain 0.4127 / other 0.4587) macro 0.3777 + lam 1.00/1.00: Hit@1 0.7854 (+0.0141 [-0.0141, +0.0415]) macro +0.0127 [+0.0071, +0.0186] pools +75 -32 | no top 20 +0.0207 cap30 +0.0169 [+0.0032, +0.0311] | Hit@5 -0.0135 macro@5 +0.0097 cap30@5 +0.0138 diff --git a/shared/package-files/ee/eee5a277c1ab7ecf8964ee93845f12db6aa28d627e1867330e64290f3bd9f414/recipe.json b/shared/package-files/ee/eee5a277c1ab7ecf8964ee93845f12db6aa28d627e1867330e64290f3bd9f414/recipe.json new file mode 100644 index 0000000000000000000000000000000000000000..4e4f56610fdb2a704ba63a28204649468d018363 --- /dev/null +++ b/shared/package-files/ee/eee5a277c1ab7ecf8964ee93845f12db6aa28d627e1867330e64290f3bd9f414/recipe.json @@ -0,0 +1,64 @@ +{ + "args": { + "store": "/workspace/research/inv", + "out": "runs/I4a-I3ft-nce005", + "pools": "pools-validation-input.npz", + "input": "/workspace/research/validation-input", + "steps": 12000, + "batch": 512, + "real_frac": 0.08, + "real_balance": 0.5, + "no_synth": false, + "lr": 0.00015, + "weight_decay": 0.0001, + "warmup": 300, + "ema": 0.999, + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "peak_drop": 0.3, + "truncate": 0.3, + "min_keep": 4, + "jitter": 0.15, + "synth_energy_drop": 0.3, + "synth_instrument_drop": 0.3, + "validate_every": 2000, + "retrieve_every": 4000, + "retrieve_pools": 0, + "seed": 1, + "contrast_weight": 0.005, + "contrast_k": 31, + "contrast_tau": 0.05, + "init": "runs/I3-ff512x6-real08/step-0100000-ema.pt", + "max_steps_this_run": 0 + }, + "parameters": 24997832, + "model": { + "dim": 512, + "layers": 6, + "heads": 8, + "dropout": 0.1, + "pair_dim": 64, + "fp_bits": 4096, + "max_energy": 200.0 + }, + "real_rows": 194119, + "synth_rows": 2333477, + "stores": { + "pools-validation-input.manifest.json": "13490ff1249eca04dc3a23c94838008071da73002c497d5a614d236258301758", + "real-train.manifest.json": "59912f8d472101e1f789f5f673f8ef2bdcb521e7973fcd9f4db96bc46d8e46c6", + "real-validation.manifest.json": "ff9c1d5b46543ad3da990c1a3aeaa2e4f68939761224689af930a39671fdb597", + "synth.manifest.json": "28d43b29c6334a14a568b8f8f412b260ad87934f687903ad927ac57a0f8e20cc" + }, + "gpu": "NVIDIA H100 80GB HBM3", + "load_seconds": 10.65797292406205, + "init": { + "path": "runs/I3-ff512x6-real08/step-0100000-ema.pt", + "sha256": "d3a914a9bf011751408a2739cb18b0312df430fd31447b9115b0010861ab08e3" + }, + "isomer_library": { + "molecules": 460122, + "with_same_formula_molecule": 0.8531128764152527 + } +} diff --git a/shared/package-files/ee/eeec07a560ee10f25e701d1e22d647f4884bd3d90a14f1d3a2364a32a0687d17/netprop-released-sub-0_25-1.log b/shared/package-files/ee/eeec07a560ee10f25e701d1e22d647f4884bd3d90a14f1d3a2364a32a0687d17/netprop-released-sub-0_25-1.log new file mode 100644 index 0000000000000000000000000000000000000000..2830009f04f606dbb29fcc368f430c775ab1148f --- /dev/null +++ b/shared/package-files/ee/eeec07a560ee10f25e701d1e22d647f4884bd3d90a14f1d3a2364a32a0687d17/netprop-released-sub-0_25-1.log @@ -0,0 +1,4 @@ +released rule from saved branches: Hit@1 0.7410 pool-macro 0.8416 Hit@5 0.8519 Hit@20 0.9296 | twin pools 87 (macro 0.7586), others macro 0.8511 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.3186 (domain 0.2495 / other 0.4010) macro 0.2057 + lam 1.00/1.00: Hit@1 0.7772 (+0.0362 [+0.0004, +0.0816]) macro +0.0071 [-0.0035, +0.0178] pools +13 -7 | no top 20 +0.0208 cap30 +0.0227 [-0.0005, +0.0508] | Hit@5 +0.0209 macro@5 +0.0071 cap30@5 +0.0116 diff --git a/shared/package-files/ee/eef2d0713bf2315ba52ace94240b2cf14fc8f869a9b563eae4d7f89e17c53bc8/prepare_decoys.py b/shared/package-files/ee/eef2d0713bf2315ba52ace94240b2cf14fc8f869a9b563eae4d7f89e17c53bc8/prepare_decoys.py new file mode 100644 index 0000000000000000000000000000000000000000..c5fd3575993566506385fac66f06fa0a1d4cc87e --- /dev/null +++ b/shared/package-files/ee/eef2d0713bf2315ba52ace94240b2cf14fc8f869a9b563eae4d7f89e17c53bc8/prepare_decoys.py @@ -0,0 +1,177 @@ +#!/usr/bin/env python3 +"""Decoy molecules for contrastive fine-tuning (train fold only). + +For every unique training structure this writes two lists of decoy SMILES with the +same molecular formula as the training target: + +* ``isomers`` - structures from the supplied synthetic-augmentation molecule list and + from the other training molecules (the PubChem isomer table used by the + stock ms-pred contrastive stage is not available offline); +* ``mutations`` - bond/ring rearrangements of the target made by the stock + ``ms_pred.iceberg.graph_mutate.mutate`` (the other half of the stock recipe). + +Only train.jsonl and synthetic_augmentation/labels.tsv are read. No validation or test +structure, pool or label is read. + +Usage: prepare_decoys.py OUT.json [--isomers 32] [--mutations 8] [--workers 20] +""" +import argparse +import collections +import csv +import hashlib +import json +import multiprocessing +import random +import sys +from pathlib import Path + +SOURCE = Path('/workspace/research/ms-pred/src') +TRAIN = Path('/workspace/data/train.jsonl') +AUGMENT = Path('/workspace/data/synthetic_augmentation/labels.tsv') + + +def describe(smiles): + """(formula, 2D InChIKey block, canonical non-stereo SMILES) or None outside model support.""" + from rdkit import Chem + from rdkit.Chem.rdMolDescriptors import CalcMolFormula + from ms_pred.common import chem_utils + try: + mol = Chem.MolFromSmiles(smiles) + if mol is None: + return None + if any(a.GetAtomicNum() not in chem_utils.VALID_ATOM_NUM for a in mol.GetAtoms()): + return None + if Chem.GetFormalCharge(mol) != 0 or len(Chem.GetMolFrags(mol)) != 1: + return None + Chem.RemoveStereochemistry(mol) + mol = Chem.RemoveHs(mol) + if not 1 <= mol.GetNumAtoms() <= 100: + return None + return CalcMolFormula(mol), Chem.MolToInchiKey(mol)[:14], Chem.MolToSmiles(mol) + except Exception: + return None + + +def describe_chunk(chunk): + from rdkit import RDLogger + RDLogger.DisableLog('rdApp.*') + sys.path.insert(0, str(SOURCE)) + return [describe(s) for s in chunk] + + +INDEX = {} +LIMITS = {} + + +def decoys_for(job): + """Decoys of one training structure: nearest and random same-formula isomers plus mutations.""" + import numpy as np + from rdkit import Chem, DataStructs, RDLogger + from rdkit.Chem import AllChem + RDLogger.DisableLog('rdApp.*') + sys.path.insert(0, str(SOURCE)) + from ms_pred.iceberg.graph_mutate import mutate + block, formula, smiles = job + seed = int(hashlib.sha256(block.encode()).hexdigest()[:8], 16) + rng = random.Random(seed) + random.seed(seed) + np.random.seed(seed) + + def fingerprint(s): + return AllChem.GetMorganFingerprintAsBitVect(Chem.MolFromSmiles(s), 2, 2048) + + pool = sorted(s for b, s in INDEX.get(formula, ()) if b != block) + half = LIMITS['isomers'] // 2 + nearest = [] + if len(pool) > LIMITS['isomers']: + if len(pool) > 4000: # bound the similarity search for very common formulae + pool = rng.sample(pool, 4000) + sims = DataStructs.BulkTanimotoSimilarity(fingerprint(smiles), [fingerprint(s) for s in pool]) + order = sorted(range(len(pool)), key=lambda i: (-sims[i], pool[i])) + nearest = [pool[i] for i in order[:half]] + rest = [pool[i] for i in order[half:]] + isomers = nearest + rng.sample(rest, LIMITS['isomers'] - half) + else: + isomers = pool + known = {block} | {b for b, _ in INDEX.get(formula, ())} + mutations = [] + for _ in range(LIMITS['mutations'] * 4): + if len(mutations) >= LIMITS['mutations']: + break + try: + mol = Chem.MolFromSmiles(smiles) + new = mutate(mol, mutation_rate=1.0) + if new is None: + continue + info = describe(Chem.MolToSmiles(new)) + except Exception: + continue + if info is None or info[0] != formula or info[1] in known: + continue + known.add(info[1]) + mutations.append(info[2]) + return block, {'formula': formula, 'isomers': isomers, 'mutations': mutations, + 'isomers_available': len(INDEX.get(formula, ())) - (1 if any(b == block for b, _ in INDEX.get(formula, ())) else 0)} + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('output', type=Path) + p.add_argument('--isomers', type=int, default=32) + p.add_argument('--mutations', type=int, default=8) + p.add_argument('--workers', type=int, default=20) + args = p.parse_args() + LIMITS.update(isomers=args.isomers, mutations=args.mutations) + + train = {} + spectra = collections.Counter() + with TRAIN.open() as stream: + for line in stream: + row = json.loads(line) + spectra[row['target_smiles']] += 1 + train.setdefault(row['target_smiles'], row['target_inchikey']) + augment = set() + with AUGMENT.open() as stream: + for row in csv.DictReader(stream, delimiter='\t'): + augment.add(row['smiles']) + train_smiles, augment_smiles = sorted(train), sorted(augment) + everything = train_smiles + augment_smiles + chunks = [everything[i:i + 2000] for i in range(0, len(everything), 2000)] + with multiprocessing.Pool(args.workers) as pool: + described = [d for part in pool.imap(describe_chunk, chunks, chunksize=1) for d in part] + by_formula = collections.defaultdict(dict) + for info in described: + if info is not None: + by_formula[info[0]].setdefault(info[1], info[2]) + INDEX.update({formula: sorted(members.items()) for formula, members in by_formula.items()}) + jobs, per_smiles = {}, {} + for smiles, info in zip(train_smiles, described[:len(train_smiles)]): + if info is None: + continue + per_smiles[smiles] = info[1] + jobs.setdefault(info[1], (info[1], info[0], info[2])) + with multiprocessing.Pool(args.workers) as pool: # fork: workers inherit INDEX + table = dict(pool.imap(decoys_for, sorted(jobs.values()), chunksize=50)) + weights = collections.Counter() + for smiles, count in spectra.items(): + entry = table.get(per_smiles.get(smiles)) + weights['spectra'] += count + if entry is None: + weights['unsupported_target'] += count + continue + weights['with_isomer'] += count * bool(entry['isomers']) + weights['with_mutation'] += count * bool(entry['mutations']) + weights['with_any'] += count * bool(entry['isomers'] or entry['mutations']) + weights['with_3_any'] += count * (len(entry['isomers']) + len(entry['mutations']) >= 3) + stats = {'train_structures': len(table), 'described_molecules': sum(len(v) for v in INDEX.values()), + 'spectrum_weighted': dict(weights), + 'mean_isomers': sum(len(e['isomers']) for e in table.values()) / max(len(table), 1), + 'mean_mutations': sum(len(e['mutations']) for e in table.values()) / max(len(table), 1)} + payload = {'schema': 'allcond-decoys/v1', 'sources': [str(TRAIN), str(AUGMENT)], + 'limits': dict(LIMITS), 'stats': stats, 'by_smiles': per_smiles, 'decoys': table} + args.output.write_text(json.dumps(payload, sort_keys=True)) + print(json.dumps(stats, indent=1)) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/ee/eef3cabdfb51cfd09d6098cde94bfdddfcc7c66c548953d022644c63f104996e/after_s2.sh b/shared/package-files/ee/eef3cabdfb51cfd09d6098cde94bfdddfcc7c66c548953d022644c63f104996e/after_s2.sh new file mode 100644 index 0000000000000000000000000000000000000000..7e61dbd0c726f7c2a1fea0444df714bda6309fac --- /dev/null +++ b/shared/package-files/ee/eef3cabdfb51cfd09d6098cde94bfdddfcc7c66c548953d022644c63f104996e/after_s2.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# after_s2.sh +# Wait for fork S2 (synthetic auxiliary term, run B step 20,000 -> 30,000) to finish, then simulate +# the full validation fold with its 25k and 30k EMA checkpoints in one pass, split the members, +# cache the binned view and score each member alone under the released matched rule. The paired +# comparison is S2 30k against run B 30k (same seed, same real-data order). +# Third member of the pass: the weight average of run B's 20k/25k/30k EMA snapshots (E46 side study). +set -uo pipefail +cd /workspace/research +run=runs/S2-B20k-synth +until [ -f $run/checkpoints/step-0030000-ema.ckpt ] && grep -q '"step": 30000' $run/validation.jsonl 2>/dev/null; do sleep 30; done +n=0 +while ps -eo cmd | grep -q '[S]2-B20k-synth --subset'; do sleep 10; n=$((n + 1)); [ $n -ge 30 ] && break; done +echo "S2 finished at $(date -u)" +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps GLACIER_SOURCE=/workspace/research/ms-pred/src +py=/opt/glacier/bin/python +pair=evals/S2-25k30k-full +if [ ! -f $pair/DONE ]; then + mkdir -p $pair + taskset -c 0-15 $py allcond/pkg/infer.py validation-input $pair \ + --checkpoint $run/checkpoints/step-0025000-ema.ckpt --checkpoint $run/checkpoints/step-0030000-ema.ckpt \ + --checkpoint soups/B-avg-20k+25k+30k.ckpt \ + --workers 14 --save-predictions $pair/pred > logs/eval-S2-25k30k-full.log 2>&1 || { echo "simulation failed"; exit 1; } + echo done > $pair/DONE +fi +echo "simulated S2 25k+30k and the run-B weight average at $(date -u)" +export OMP_NUM_THREADS=6 +index=0 +for name in S2-25k-full S2-30k-full soupB3-full; do + if [ ! -f evals/$name/pred/done.npy ]; then + taskset -c 16-21 $py allcond/analysis/stack_members.py evals/$name/pred $pair/pred:$index + fi + index=$((index + 1)) + taskset -c 16-21 $py allcond/analysis/scorelab.py validation-input evals/$name/pred allcond/analysis/variants/v7.json > logs/scorelab-v7-$name.log 2>&1 + taskset -c 16-21 $py allcond/analysis/ensemble_mean.py validation-input evals/$name/pred evals/anchor2/$name-matched.pkl > logs/matched-$name.log 2>&1 + echo "scored $name at $(date -u)" +done +echo finished at $(date -u) diff --git a/shared/package-files/f0/f02e2952a1764e7ed878caa7484563223c6ce19f549ed0fef3c21562de7c80e9/netprop-oracle-mix.log b/shared/package-files/f0/f02e2952a1764e7ed878caa7484563223c6ce19f549ed0fef3c21562de7c80e9/netprop-oracle-mix.log new file mode 100644 index 0000000000000000000000000000000000000000..0864b4a3d02bbc17e8c3f766ca2db6942c9e4bb9 --- /dev/null +++ b/shared/package-files/f0/f02e2952a1764e7ed878caa7484563223c6ce19f549ed0fef3c21562de7c80e9/netprop-oracle-mix.log @@ -0,0 +1,5 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.6105 (domain 0.6373 / other 0.5837) macro 0.5948 + lam 1.00/1.00: Hit@1 0.8165 (+0.0452 [+0.0211, +0.0735]) macro +0.0224 [+0.0157, +0.0292] pools +107 -31 | no top 20 +0.0338 cap30 +0.0379 [+0.0203, +0.0560] | Hit@5 +0.0037 macro@5 +0.0142 cap30@5 +0.0219 | twin +33 -5 other +74 -26 | dom +0.0080 oth +0.0825 + lam 2.00/2.00: Hit@1 0.8064 (+0.0351 [+0.0006, +0.0691]) macro +0.0248 [+0.0171, +0.0319] pools +128 -44 | no top 20 +0.0374 cap30 +0.0380 [+0.0195, +0.0574] | Hit@5 +0.0061 macro@5 +0.0157 cap30@5 +0.0246 | twin +33 -7 other +95 -37 | dom +0.0071 oth +0.0632 diff --git a/shared/package-files/f0/f039934e87efe7a0edcdec26928425897e92585dd621f9992bfab756b38fdcfe/B2-all-b32-seed2.log b/shared/package-files/f0/f039934e87efe7a0edcdec26928425897e92585dd621f9992bfab756b38fdcfe/B2-all-b32-seed2.log new file mode 100644 index 0000000000000000000000000000000000000000..34fc4a4cb41596e9ea77a1bed0d502e395ef79c1 --- /dev/null +++ b/shared/package-files/f0/f039934e87efe7a0edcdec26928425897e92585dd621f9992bfab756b38fdcfe/B2-all-b32-seed2.log @@ -0,0 +1,19 @@ +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "random", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 5000, "elapsed_seconds": 1394.3425170819974, "validation_loss": 0.7073428966104984, "validation_loss_ema": 0.6673278082162142} +{"step": 10000, "elapsed_seconds": 4412.34174187202, "validation_loss": 0.6268772426992655, "validation_loss_ema": 0.6139422971755266} +/opt/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 23 leaked semaphore objects to clean up at shutdown + warnings.warn('resource_tracker: There appear to be %d ' +DGL backend not selected or invalid. Assuming PyTorch for now. +Setting the default backend to "pytorch". You can change it in the ~/.dgl/config.json file or export the DGLBACKEND environment variable. Valid options are: pytorch, mxnet, tensorflow (all lowercase) +{"event": "resumed", "source": "/run-state/workspace/research/runs/B2-all-b32-seed2/last.ckpt", "step": 12000, "epoch": 2, "batch_in_epoch": 184, "elapsed": 4964.159852223005, "skipped": 0} +{"parameters": 15108154, "train_rows": 189066, "validation_rows": 2048, "steps_per_epoch": 5908, "identity": "random", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 15000, "elapsed_seconds": 5748.505283480001, "validation_loss": 0.6074428390711546, "validation_loss_ema": 0.59406559728086} +{"step": 20000, "elapsed_seconds": 6945.18486677701, "validation_loss": 0.594346446916461, "validation_loss_ema": 0.5829043434932828} +{"step": 25000, "elapsed_seconds": 8133.248736456997, "validation_loss": 0.5886475183069706, "validation_loss_ema": 0.5755023881793022} +{"step": 30000, "elapsed_seconds": 9298.063542745003, "validation_loss": 0.5774099119007587, "validation_loss_ema": 0.5690539684146643} +/opt/python/cpython-3.11.14-linux-x86_64-gnu/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 23 leaked semaphore objects to clean up at shutdown + warnings.warn('resource_tracker: There appear to be %d ' diff --git a/shared/package-files/f0/f03def26e315bcf408e54bd461ab2f21a447a89c2187dd4aea2893b2ae7c7e2d/v1.json b/shared/package-files/f0/f03def26e315bcf408e54bd461ab2f21a447a89c2187dd4aea2893b2ae7c7e2d/v1.json new file mode 100644 index 0000000000000000000000000000000000000000..4e4a15b18056499b702026a6e807c903d16f3400 --- /dev/null +++ b/shared/package-files/f0/f03def26e315bcf408e54bd461ab2f21a447a89c2187dd4aea2893b2ae7c7e2d/v1.json @@ -0,0 +1,14 @@ +{ + "base": {}, + "noprec": {"drop_precursor": true, "prec_window": 0.5}, + "noprec1.5": {"drop_precursor": true, "prec_window": 1.5}, + "base+noprec": [["base", 1], ["noprec", 1]], + "pred_pow0.5": {"pred_power": 0.5}, + "pred_pow2": {"pred_power": 2.0}, + "obs_pow0.25": {"obs_power": 0.25}, + "top50pred": {"topk_pred": 50}, + "top20pred": {"topk_pred": 20}, + "noprec_predpow0.5": {"drop_precursor": true, "pred_power": 0.5}, + "w0.02": {"num_bins": 75000}, + "base+w0.02": [["base", 1], ["w0.02", 1]] +} diff --git a/shared/package-files/f0/f040f081d508b6b8cd377c22bbc947f5e01102768c2714feb710ef37d2f6a68f/swap-N5-recur-hyb-s10-f5-p48-w1.0_0.3_0.5.log b/shared/package-files/f0/f040f081d508b6b8cd377c22bbc947f5e01102768c2714feb710ef37d2f6a68f/swap-N5-recur-hyb-s10-f5-p48-w1.0_0.3_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..e9b7b4ae7948cb2c28402d022a539d3f80afa559 --- /dev/null +++ b/shared/package-files/f0/f040f081d508b6b8cd377c22bbc947f5e01102768c2714feb710ef37d2f6a68f/swap-N5-recur-hyb-s10-f5-p48-w1.0_0.3_0.5.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.8043 pool-macro 0.8715 Hit@5 0.8804 Hit@20 0.9308 | twin pools 354 (macro 0.7825), others macro 0.8819 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4626 (domain 0.4228 / other 0.5025) macro 0.3842 + lam 1.00/1.00: Hit@1 0.8082 (+0.0039 [-0.0615, +0.0484]) macro +0.0136 [+0.0074, +0.0195] pools +81 -35 | no top 20 +0.0231 cap30 +0.0246 [+0.0116, +0.0389] | Hit@5 -0.0139 macro@5 +0.0080 cap30@5 +0.0144 +without consensus term: Hit@1 0.8043 (ref 0.7685; +0.0358 [-0.0019, +0.0950]) macro 0.8715 (+0.0065 [+0.0018, +0.0112]) pools +48 -26 cap30 +0.0088 | Hit@5 0.8804 (+0.0012) Hit@20 0.9308 (-0.0050) + domain 0.9369 (+0.0068) other 0.6712 (+0.0650) | Orbitrap no energy 0.6470 (+0.0773) | above 850 0.6093 (+0.1876) below 850 0.8487 (+0.0013) +full rule : Hit@1 0.8082 (ref 0.8063; +0.0019 [-0.0148, +0.0188]) macro 0.8851 (+0.0038 [-0.0003, +0.0083]) pools +36 -23 cap30 +0.0017 | Hit@5 0.8665 (-0.0093) Hit@20 0.9028 (-0.0141) + domain 0.9449 (+0.0040) other 0.6709 (-0.0002) | Orbitrap no energy 0.6411 (-0.0014) | above 850 0.5494 (+0.0055) below 850 0.8671 (+0.0011) diff --git a/shared/package-files/f0/f047e8e7842bd2cad991761ad6e047cda9cb289f831fbe0eace5671ac74446fc/eval-B2-30k-full.log b/shared/package-files/f0/f047e8e7842bd2cad991761ad6e047cda9cb289f831fbe0eace5671ac74446fc/eval-B2-30k-full.log new file mode 100644 index 0000000000000000000000000000000000000000..327aa8d439744a7b71f022f97009ce24c13fb363 --- /dev/null +++ b/shared/package-files/f0/f047e8e7842bd2cad991761ad6e047cda9cb289f831fbe0eace5671ac74446fc/eval-B2-30k-full.log @@ -0,0 +1,46 @@ +{"event": "loaded", "queries": 19429, "pools": 3386, "members": 1, "inverse_members": 0, "workers": 12} +{"event": "canonicalized", "unique_candidates": 828117, "unsupported": 7007, "seconds": 50.67846394200751} +{"event": "planned", "queries": 19429, "groups": 10176, "molecules": 944948, "simulations": 2540748, "seconds": 54.31319727400842} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulating", "finished": 64000, "total": 2540748, "seconds": 21.786616919998778, "per_second": 2937.5832069297517} +{"event": "simulating", "finished": 128000, "total": 2540748, "seconds": 44.49729041499086, "per_second": 2876.5796480245367} +{"event": "simulating", "finished": 192000, "total": 2540748, "seconds": 67.47241741199105, "per_second": 2845.6072475903047} +{"event": "simulating", "finished": 256000, "total": 2540748, "seconds": 90.79447850699944, "per_second": 2819.5547153262705} +{"event": "simulating", "finished": 320000, "total": 2540748, "seconds": 114.25417473400012, "per_second": 2800.7729323239632} +{"event": "simulating", "finished": 384000, "total": 2540748, "seconds": 138.7500695859926, "per_second": 2767.56617957593} +{"event": "simulating", "finished": 448000, "total": 2540748, "seconds": 164.8041707999946, "per_second": 2718.3778045501663} +{"event": "simulating", "finished": 512000, "total": 2540748, "seconds": 190.84117102199525, "per_second": 2682.859244984353} +{"event": "simulating", "finished": 576000, "total": 2540748, "seconds": 226.6925444619992, "per_second": 2540.886385862397} +{"event": "simulating", "finished": 640000, "total": 2540748, "seconds": 256.3978353860002, "per_second": 2496.120917075984} +{"event": "simulating", "finished": 704000, "total": 2540748, "seconds": 285.19128643099975, "per_second": 2468.518617136391} +{"event": "simulating", "finished": 768000, "total": 2540748, "seconds": 313.28436852998857, "per_second": 2451.4469189881866} +{"event": "simulating", "finished": 832000, "total": 2540748, "seconds": 340.1841670089925, "per_second": 2445.734048457366} +{"event": "simulating", "finished": 896000, "total": 2540748, "seconds": 368.43444195999473, "per_second": 2431.9116183423735} +{"event": "simulating", "finished": 960000, "total": 2540748, "seconds": 396.5912156449922, "per_second": 2420.62850141225} +{"event": "simulating", "finished": 1024000, "total": 2540748, "seconds": 425.19124815599935, "per_second": 2408.328027542802} +{"event": "simulating", "finished": 1088000, "total": 2540748, "seconds": 454.05489465499704, "per_second": 2396.186040074937} +{"event": "simulating", "finished": 1152000, "total": 2540748, "seconds": 483.3049019869941, "per_second": 2383.588486820274} +{"event": "simulating", "finished": 1216000, "total": 2540748, "seconds": 512.8866415559896, "per_second": 2370.8942707318583} +{"event": "simulating", "finished": 1280000, "total": 2540748, "seconds": 542.4790116059885, "per_second": 2359.5382910955555} +{"event": "simulating", "finished": 1344000, "total": 2540748, "seconds": 570.9565531599947, "per_second": 2353.944433357579} +{"event": "simulating", "finished": 1408000, "total": 2540748, "seconds": 600.1692493549926, "per_second": 2346.004900306356} +{"event": "simulating", "finished": 1472000, "total": 2540748, "seconds": 630.4581852729898, "per_second": 2334.8098801550505} +{"event": "simulating", "finished": 1536000, "total": 2540748, "seconds": 660.7506645679969, "per_second": 2324.6287629604535} +{"event": "simulating", "finished": 1600000, "total": 2540748, "seconds": 692.2065313939966, "per_second": 2311.4488630695932} +{"event": "simulating", "finished": 1664000, "total": 2540748, "seconds": 724.7529187179898, "per_second": 2295.9548792758746} +{"event": "simulating", "finished": 1728000, "total": 2540748, "seconds": 757.2661133329966, "per_second": 2281.8926789084217} +{"event": "simulating", "finished": 1792000, "total": 2540748, "seconds": 789.6073426449875, "per_second": 2269.4824417377467} +{"event": "simulating", "finished": 1856000, "total": 2540748, "seconds": 822.265830734992, "per_second": 2257.177582511233} +{"event": "simulating", "finished": 1920000, "total": 2540748, "seconds": 856.1630914349953, "per_second": 2242.563384485463} +{"event": "simulating", "finished": 1984000, "total": 2540748, "seconds": 890.5804652099905, "per_second": 2227.7605196877876} +{"event": "simulating", "finished": 2048000, "total": 2540748, "seconds": 925.5598417529982, "per_second": 2212.7148430739117} +{"event": "simulating", "finished": 2112000, "total": 2540748, "seconds": 961.282631479, "per_second": 2197.064558162818} +{"event": "simulating", "finished": 2176000, "total": 2540748, "seconds": 999.7814324249921, "per_second": 2176.4757070173464} +{"event": "simulating", "finished": 2240000, "total": 2540748, "seconds": 1042.477267233, "per_second": 2148.7279103414216} +{"event": "simulating", "finished": 2304000, "total": 2540748, "seconds": 1089.7726994319964, "per_second": 2114.2023480684315} +{"event": "simulating", "finished": 2368000, "total": 2540748, "seconds": 1150.4423577299895, "per_second": 2058.3386765004466} +{"event": "simulating", "finished": 2432000, "total": 2540748, "seconds": 1233.0621770819998, "per_second": 1972.3255203198644} +{"event": "simulating", "finished": 2496000, "total": 2540748, "seconds": 1305.2131238729926, "per_second": 1912.3313689901881} +{"event": "simulated", "finished": 2540748, "total": 2540748, "failed": 0, "seconds": 1363.4980142599961} +{"event": "finished", "queries": 19429, "unscored": 0, "directly_scored": 19429, "scoring_seconds": 20.651782137996634, "total_seconds": 1454.8706369520078} diff --git a/shared/package-files/f0/f06e26eb78bc79f61c98c3e37f1807cf1aeb83d41c4ed6595a2c6de0c54a560d/e74-neigh-union-hyb-both.log b/shared/package-files/f0/f06e26eb78bc79f61c98c3e37f1807cf1aeb83d41c4ed6595a2c6de0c54a560d/e74-neigh-union-hyb-both.log new file mode 100644 index 0000000000000000000000000000000000000000..5a0a10fb5f0e75150b232f18aa32ea837ea96331 --- /dev/null +++ b/shared/package-files/f0/f06e26eb78bc79f61c98c3e37f1807cf1aeb83d41c4ed6595a2c6de0c54a560d/e74-neigh-union-hyb-both.log @@ -0,0 +1,2 @@ +union spectra for 17048 spectra (both) +19429 queries, 3386 pools, 15 s; best similarity median 0.347, 10th 0.169; share with best >= 0.5: 0.201, >= 0.7: 0.086 diff --git a/shared/package-files/f0/f0bbf6489a169dd204aedec5c522f7d61df5e8bf2c8bfebbcb59acd512b3f39c/selfsim-genx1.sh b/shared/package-files/f0/f0bbf6489a169dd204aedec5c522f7d61df5e8bf2c8bfebbcb59acd512b3f39c/selfsim-genx1.sh new file mode 100644 index 0000000000000000000000000000000000000000..bb4f445e04d7a2eed1246a329724f18b8264409a --- /dev/null +++ b/shared/package-files/f0/f0bbf6489a169dd204aedec5c522f7d61df5e8bf2c8bfebbcb59acd512b3f39c/selfsim-genx1.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# E61: self-simulation of generated structures gen-x1 (members 1,3), train-like conditions +cd /workspace/research +export CUDA_MPS_PIPE_DIRECTORY=/tmp/mps GLACIER_SOURCE=/workspace/research/ms-pred/src +PY=/opt/glacier/bin/python +OMP_NUM_THREADS=2 taskset -c 8-19 $PY allcond/inv/selfsim.py simulate genx1-train3 --source gen-x1 --from-train 3 --members 1,3 --workers 10 > logs/selfsim-genx1-train3-simulate.log 2>&1 +OMP_NUM_THREADS=1 taskset -c 8-21 $PY allcond/inv/selfsim.py annotate genx1-train3 inv/selfsim/genx1-train3.npz --floor 0.02 --workers 12 > logs/selfsim-genx1-train3-annotate.log 2>&1 +OMP_NUM_THREADS=2 taskset -c 8-11 $PY allcond/inv/selfsim.py merge inv/selfsim/corpus2+train3+genx1.npz inv/selfsim/corpus2.npz inv/selfsim/train3.npz inv/selfsim/genx1-train3.npz > logs/selfsim-corpus2+train3+genx1-merge.log 2>&1 +date -u > logs/selfsim-genx1.done diff --git a/shared/package-files/f3/f344504eeb10cf4c8d3300bc6415c93dbd5af8c80d327e82c8a80541f8bcba01/fused_eval.py b/shared/package-files/f3/f344504eeb10cf4c8d3300bc6415c93dbd5af8c80d327e82c8a80541f8bcba01/fused_eval.py new file mode 100644 index 0000000000000000000000000000000000000000..bd5119e0fbdea43fc8f1760530509a673175266d --- /dev/null +++ b/shared/package-files/f3/f344504eeb10cf4c8d3300bc6415c93dbd5af8c80d327e82c8a80541f8bcba01/fused_eval.py @@ -0,0 +1,159 @@ +"""Evaluate alternative branch sets INSIDE the released fused rule (lab; labels: evaluation only). + +fused_eval.py NAME=INV.pkl,INV.pkl[,...][@W_DOMAIN/FLOOR/SIZE] [NAME=...] [--forward PKL] [--bins NAME] + +Rule of generation-z3hoccsj: pool mean over the spectra of + forward Dmean + w * mean(inverse members) + u * library, w = 0.75 domain / max(0.05, 0.5 / n) other, + u = 0 domain / 0.4 other. +The reference is the released member set (forward 5M-S2-30k, inverse I1-50k + I3-30k + I3-100k). Every +variant replaces the inverse member list (and optionally the weights / the forward set). Printed per +variant: official Hit@1/5/20 with the paired pool bootstrap against the reference, per-spectrum fused +Hit@1 ("ind"), pools gained / lost, pool-macro, trimmed (without the 20 largest pools) and capped +(weight min(n, 30)) differences, and with --bins the pool-rule Hit@1 by stratum and precursor m/z. +""" +import argparse +import pickle +import sys +from pathlib import Path + +import numpy as np + +sys.path.insert(0, str(Path(__file__).resolve().parent)) +import scorelab +sys.path.insert(0, str(Path(__file__).resolve().parent.parent / 'pkg')) +import infer + +ROOT = Path('/workspace/research') +RELEASED = 'evals/I1/inv-50k.pkl,evals/I3/inv-30k.pkl,evals/I3/inv-100k.pkl' +BINS = [0, 400, 500, 600, 700, 850, 1001] + + +class Fuser: + def __init__(self, forward='evals/anchor2/5M-S2-30k-ensmean.pkl', knn='evals/knn/knn-pkg-sum-20-6-debias-inclusive.pkl'): + root = ROOT / 'validation-input' + self.queries = list(infer.read_jsonl(root / 'queries.jsonl')) + self.pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(root / 'candidate_pools.jsonl')} + self.ev = scorelab.Evaluator(self.queries, self.pools) + self.forward = self.load_forward(forward) + self.lib = pickle.load(open(ROOT / knn, 'rb'))['knn'] + self.cache = {} + ev = self.ev + self.size = ev.sizes + self.first = np.array([m[0] for m in ev.by_pool.values()]) + order = np.argsort(-self.size) + self.small = np.ones(len(self.size), bool) + self.small[order[:20]] = False + self.capped = np.minimum(self.size, 30) + self.draws = np.random.default_rng(0).integers(0, len(self.size), size=(2000, len(self.size))) + + @staticmethod + def load_forward(path): + return pickle.load(open(ROOT / path, 'rb'))['Dmean'] + + def inverse(self, paths, weights=None): + key = (tuple(paths), None if weights is None else tuple(weights)) + if key not in self.cache: + parts = [] + for path in paths: + if path not in self.cache: # FILE.pkl or FILE.pkl:KEY + name, _, key = path.partition(':') + self.cache[path] = pickle.load(open(ROOT / name, 'rb'))[key or 'pooled'] + parts.append(self.cache[path]) + w = np.ones(len(parts)) / len(parts) if weights is None else np.asarray(weights, float) / np.sum(weights) + self.cache[key] = [None if any(part[i] is None for part in parts) else + np.tensordot(w, np.stack([part[i] for part in parts]), axes=1) for i in range(len(self.queries))] + return self.cache[key] + + def ranks(self, inv, w_domain=0.75, floor=0.05, size=0.5, u_domain=0.0, u_other=0.4, forward=None, weight_fn=None, u_fn=None): + """(pool-rule rank, per-spectrum fused rank) of the target for every query.""" + ev = self.ev + fwd = self.forward if forward is None else forward + pool_rank = np.zeros(len(self.queries), dtype=int) + single_rank = np.zeros(len(self.queries), dtype=int) + for pid, members in ev.by_pool.items(): + n = len(self.pools[pid]) + total = np.zeros(n) + for i in members: + dom = ev.domain[i] + d = np.ones(n) if fwd[i] is None else np.asarray(fwd[i], dtype=float) + if inv[i] is not None: + w = (w_domain if dom else max(floor, size / len(members))) if weight_fn is None else weight_fn(i, len(members)) + d = d + w * inv[i] + if self.lib[i] is not None: + d = d + ((u_domain if dom else u_other) if u_fn is None else u_fn(i, len(members))) * self.lib[i] + total += d + single_rank[i] = int(np.where(np.lexsort((ev.ids[pid], d)) == ev.target[i])[0][0]) + order = np.lexsort((ev.ids[pid], total / len(members))) + for i in members: + pool_rank[i] = int(np.where(order == ev.target[i])[0][0]) + return pool_rank, single_rank + + def report(self, name, got, reference): + ev = self.ev + pool, single = got + text = ev.line(name, pool, reference[0]) + lo, hi = ev.paired(single == 0, reference[1] == 0) + print(text, f'| ind {np.mean(single == 0):.4f} {np.mean(single == 0) - np.mean(reference[1] == 0):+.4f} [{lo:+.4f},{hi:+.4f}]') + hit, hit0 = pool[self.first] == 0, reference[0][self.first] == 0 + delta = hit.astype(float) - hit0 + size, small, capped, draws = self.size, self.small, self.capped, self.draws + macro = delta[draws].mean(1) + trimmed = (delta * size * small)[draws].sum(1) / (size * small)[draws].sum(1) + cap = (delta * capped)[draws].sum(1) / capped[draws].sum(1) + print(f' pools +{int((hit & ~hit0).sum())} -{int((hit0 & ~hit).sum())}' + f' | macro {hit.mean():.4f} {delta.mean():+.4f} [{np.percentile(macro, 2.5):+.4f},{np.percentile(macro, 97.5):+.4f}]' + f' | without top 20 {np.sum(delta * size * small) / np.sum(size * small):+.4f} [{np.percentile(trimmed, 2.5):+.4f},{np.percentile(trimmed, 97.5):+.4f}]' + f' | weight min(n,30) {np.sum(delta * capped) / capped.sum():+.4f} [{np.percentile(cap, 2.5):+.4f},{np.percentile(cap, 97.5):+.4f}]', flush=True) + + def strata(self): + q = self.queries + mz = np.array([float(x['precursor_mz']) for x in q]) + adduct = np.array([x['adduct'] for x in q]) + energy = np.array([x.get('collision_energy') is not None for x in q]) + out = {'domain': (adduct == '[M+H]+') & energy, 'no CE [M+H]+': ~energy & (adduct == '[M+H]+'), + 'no CE [M+Na]+': ~energy & (adduct == '[M+Na]+')} + out['rest'] = ~(out['domain'] | out['no CE [M+H]+'] | out['no CE [M+Na]+']) + return mz, out + + def bins(self, name, got, reference, inv=None): + mz, strata = self.strata() + alone = None if inv is None else self.ev.ranks(inv, 1.0) + print(f'--- {name}: pool-rule Hit@1 by stratum and precursor m/z (variant / reference / difference in points of the official metric)') + n_all = len(self.queries) + for label, mask in strata.items(): + for lo, hi in zip(BINS[:-1], BINS[1:]): + s = mask & (mz >= lo) & (mz < hi) + if s.sum() < 20: + continue + a, b = got[0][s] == 0, reference[0][s] == 0 + extra = '' if alone is None else f' | inverse alone {np.mean(alone[s] == 0):.3f}' + print(f' {label:14s} [{lo:4d},{hi:4d}) n {int(s.sum()):5d} pools {len(set(self.ev.query_pool[s])):4d} | {a.mean():.3f} / {b.mean():.3f} / ' + f'{(a.sum() - b.sum()) / n_all:+.4f} | top-5 {np.mean(got[0][s] < 5):.3f} / {np.mean(reference[0][s] < 5):.3f}{extra}') + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('variants', nargs='*') + p.add_argument('--forward', help='candidate forward member set for every variant (the reference keeps the released one)') + p.add_argument('--bins', default='', help='comma list of variant names to print by stratum and m/z ("all" = every variant)') + args = p.parse_args() + lab = Fuser() + reference = lab.ranks(lab.inverse(RELEASED.split(','))) + lab.report('released', reference, reference) + forward = lab.load_forward(args.forward) if args.forward else None + if forward is not None: + got = lab.ranks(lab.inverse(RELEASED.split(',')), forward=forward) + lab.report('forward ' + Path(args.forward).name, got, reference) + for item in args.variants: + name, _, text = item.partition('=') + paths, _, weights = text.partition('@') + w = [float(x) for x in weights.split('/')] if weights else [0.75, 0.05, 0.5] + inv = lab.inverse([RELEASED.split(',')[int(x[1:])] if x in ('R0', 'R1', 'R2') else x for x in paths.split(',')]) + got = lab.ranks(inv, w_domain=w[0], floor=w[1], size=w[2], forward=forward) + lab.report(name, got, reference) + if args.bins == 'all' or name in args.bins.split(','): + lab.bins(name, got, reference, inv) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/f3/f35d7744e7043298295a93c9f27814d96fee3f5788598a0262d10e8ac657101b/netprop-released-sub-0_1-1.log b/shared/package-files/f3/f35d7744e7043298295a93c9f27814d96fee3f5788598a0262d10e8ac657101b/netprop-released-sub-0_1-1.log new file mode 100644 index 0000000000000000000000000000000000000000..6b1d313170bafd196f7f993873785fe80456aac9 --- /dev/null +++ b/shared/package-files/f3/f35d7744e7043298295a93c9f27814d96fee3f5788598a0262d10e8ac657101b/netprop-released-sub-0_1-1.log @@ -0,0 +1,4 @@ +released rule from saved branches: Hit@1 0.7684 pool-macro 0.8319 Hit@5 0.8482 Hit@20 0.8867 | twin pools 36 (macro 0.7778), others macro 0.8383 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain debias=fold control=none shuffle=None: alone Hit@1 0.1429 (domain 0.1249 / other 0.1712) macro 0.1180 + lam 1.00/1.00: Hit@1 0.7684 (+0.0000 [-0.0247, +0.0222]) macro +0.0029 [-0.0059, +0.0118] pools +2 -1 | no top 20 +0.0000 cap30 +0.0000 [-0.0276, +0.0239] | Hit@5 +0.0011 macro@5 +0.0029 cap30@5 +0.0012 diff --git a/shared/package-files/f3/f36c3148ac8a4bc004479a77646a49552fa285f2bc130e7a30ae186a49775245/fullfold-5Ms-I9b+I13-L-ion.done b/shared/package-files/f3/f36c3148ac8a4bc004479a77646a49552fa285f2bc130e7a30ae186a49775245/fullfold-5Ms-I9b+I13-L-ion.done new file mode 100644 index 0000000000000000000000000000000000000000..34f2c6d2d7f9fbb8bf5f7ad6250655d48ede213e --- /dev/null +++ b/shared/package-files/f3/f36c3148ac8a4bc004479a77646a49552fa285f2bc130e7a30ae186a49775245/fullfold-5Ms-I9b+I13-L-ion.done @@ -0,0 +1 @@ +12:00:39 diff --git a/shared/package-files/f3/f383d37437e1dd04e20e7700c5746eeff5a836610b6f24f4cb27eb59b57325c7/miss_bottom.py b/shared/package-files/f3/f383d37437e1dd04e20e7700c5746eeff5a836610b6f24f4cb27eb59b57325c7/miss_bottom.py new file mode 100644 index 0000000000000000000000000000000000000000..fac857c499108193931d0055ea4fa1fe8ea5c49a --- /dev/null +++ b/shared/package-files/f3/f383d37437e1dd04e20e7700c5746eeff5a836610b6f24f4cb27eb59b57325c7/miss_bottom.py @@ -0,0 +1,70 @@ +"""Where in the ranking the label of a missed pool sits, and the pools ranked at the very end (analysis only, E66) + +miss_bottom.py --rankings evals/fullfold/NAME/rankings.jsonl [--bottom 245] + +Reads validation labels (analysis only). Prints the histogram of the label's relative rank in the +missed pools with >= 50 candidates and, for the pools whose label is ranked at or beyond +``--bottom``, the label, the pool's adducts / precursor values, the formulae of the first three +candidates and the strongest peaks of the pool's first spectrum. +""" +import argparse +import hashlib +import json +from collections import Counter, defaultdict + +import numpy as np +from rdkit import Chem, RDLogger +from rdkit.Chem import Descriptors, rdMolDescriptors + +RDLogger.DisableLog('rdApp.*') +ROOT = '/workspace/research/' + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--rankings', required=True) + parser.add_argument('--bottom', type=int, default=245) + args = parser.parse_args() + rows = defaultdict(list) + for line in open('/workspace/data/validation.jsonl'): + r = json.loads(line) + rows[r['target_smiles']].append(r) + rank = {} + for line in open(ROOT + args.rankings): + r = json.loads(line) + rank[r['query_id']] = r['ranking'] + rel, info, want = [], [], {} + for s, rs in rows.items(): + ids = rank[rs[0]['query_id']] + rk = ids.index(hashlib.sha256(s.encode()).hexdigest()) + 1 + if rk > 1 and len(ids) >= 50: + rel.append((rk - 1) / (len(ids) - 1)) + info.append((len(rs), rk, len(ids), rs[0]['adduct'], rs[0].get('collision_energy'), round(rs[0]['precursor_mz'], 2))) + if rk >= args.bottom: + want[rs[0]['candidate_pool_id']] = (s, rs, ids, rk) + rel = np.array(rel) + edges = [0, .02, .05, .1, .2, .3, .4, .5, .6, .7, .8, .9, .95, 1.0001] + print('missed pools with >= 50 candidates:', len(rel)) + print('relative rank of the label, bins', edges[:-1] + [1], ':', np.histogram(rel, bins=edges)[0].tolist()) + bottom = [i for i, v in enumerate(rel) if v >= 0.9] + print('pools in the last tenth:', len(bottom), 'queries', sum(info[i][0] for i in bottom)) + for line in open('/workspace/data/validation_candidate_pools.jsonl'): + p = json.loads(line) + pid = p.get('candidate_pool_id') or p.get('pool_id') + if pid not in want: + continue + s, rs, ids, rk = want[pid] + cands = {c['candidate_id']: c['smiles'] for c in p['candidates']} + formulae = Counter(rdMolDescriptors.CalcMolFormula(Chem.MolFromSmiles(x)) for x in cands.values()) + mol = Chem.MolFromSmiles(s) + print(f'{len(rs)} spectra | rank {rk} of {len(ids)} | label {s[:80]} {rdMolDescriptors.CalcMolFormula(mol)} {Descriptors.ExactMolWt(mol):.4f}') + print(' adducts', Counter(r['adduct'] for r in rs).most_common(), 'precursor', Counter(round(r['precursor_mz'], 2) for r in rs).most_common(3), + '| formulae in the pool', len(formulae), formulae.most_common(3)) + for i in ids[:3]: + print(' first:', cands[i][:90], rdMolDescriptors.CalcMolFormula(Chem.MolFromSmiles(cands[i]))) + r = rs[0] + print(' spectrum 0:', r['adduct'], r['precursor_mz'], [round(m, 3) for m, v in sorted(zip(r['mzs'], r['intensities']), key=lambda t: -t[1])[:8]]) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/f3/f3a4f7cb3cd8e71600fd227f089e4e394288b36fba162722929c6484dca67604/eval-score-I16+I18+I21.log b/shared/package-files/f3/f3a4f7cb3cd8e71600fd227f089e4e394288b36fba162722929c6484dca67604/eval-score-I16+I18+I21.log new file mode 100644 index 0000000000000000000000000000000000000000..80d22bdd2a0e116093a8408fa1c50e6bdd4f61d9 --- /dev/null +++ b/shared/package-files/f3/f3a4f7cb3cd8e71600fd227f089e4e394288b36fba162722929c6484dca67604/eval-score-I16+I18+I21.log @@ -0,0 +1,41 @@ +19429 queries, 3 members, 84.7 s +cos pool rule all=0.6074 dom=0.8462 non=0.3677 h5=0.7146 macro=0.7289 +cen pool rule all=0.5912 dom=0.8221 non=0.3594 h5=0.7165 macro=0.7053 +cos_pm pool rule all=0.6062 dom=0.8444 non=0.3671 h5=0.7146 macro=0.7253 +dot pool rule all=0.6236 dom=0.8080 non=0.4384 h5=0.7561 macro=0.7129 +geo pool rule all=0.5909 dom=0.8295 non=0.3514 h5=0.7032 macro=0.7141 +idf05 pool rule all=0.6061 dom=0.8449 non=0.3664 h5=0.7334 macro=0.7283 +idf1 pool rule all=0.6081 dom=0.8437 non=0.3715 h5=0.7385 macro=0.7271 +lin pool rule all=0.5678 dom=0.7966 non=0.3380 h5=0.6834 macro=0.6849 +log01 pool rule all=0.6085 dom=0.8406 non=0.3756 h5=0.7614 macro=0.7283 +log05 pool rule all=0.6149 dom=0.8540 non=0.3747 h5=0.7324 macro=0.7354 +log20 pool rule all=0.6143 dom=0.8496 non=0.3781 h5=0.7305 macro=0.7342 +nll02 pool rule all=0.4593 dom=0.7317 non=0.1859 h5=0.6024 macro=0.5957 +nll10 pool rule all=0.4270 dom=0.6800 non=0.1731 h5=0.5666 macro=0.5431 +poolcen pool rule all=0.5969 dom=0.8167 non=0.3763 h5=0.7313 macro=0.7064 +pow020 pool rule all=0.5801 dom=0.8092 non=0.3500 h5=0.7472 macro=0.7011 +pow030 pool rule all=0.5932 dom=0.8243 non=0.3612 h5=0.7504 macro=0.7103 +pow040 pool rule all=0.6014 dom=0.8343 non=0.3676 h5=0.7624 macro=0.7242 +pow05 pool rule all=0.6117 dom=0.8420 non=0.3805 h5=0.7331 macro=0.7301 +pow05idf025 pool rule all=0.6144 dom=0.8483 non=0.3796 h5=0.7353 macro=0.7360 +pow05idf05 pool rule all=0.6144 dom=0.8492 non=0.3788 h5=0.7390 macro=0.7389 +pow05m pool rule all=0.6150 dom=0.8442 non=0.3848 h5=0.7334 macro=0.7339 +pow05s pool rule all=0.6106 dom=0.8429 non=0.3773 h5=0.7291 macro=0.7301 +pow060 pool rule all=0.6140 dom=0.8470 non=0.3801 h5=0.7275 macro=0.7318 +pow060idf025 pool rule all=0.6170 dom=0.8514 non=0.3815 h5=0.7336 macro=0.7357 +pow060idf050 pool rule all=0.6178 dom=0.8528 non=0.3818 h5=0.7383 macro=0.7372 +pow060m pool rule all=0.6122 dom=0.8478 non=0.3757 h5=0.7288 macro=0.7336 +pow065 pool rule all=0.6126 dom=0.8453 non=0.3791 h5=0.7293 macro=0.7324 +pow070 pool rule all=0.6143 dom=0.8455 non=0.3823 h5=0.7271 macro=0.7327 +pow070idf025 pool rule all=0.6132 dom=0.8488 non=0.3766 h5=0.7326 macro=0.7351 +pow070idf050 pool rule all=0.6130 dom=0.8509 non=0.3741 h5=0.7367 macro=0.7357 +pow070m pool rule all=0.6116 dom=0.8469 non=0.3753 h5=0.7254 macro=0.7327 +pow075 pool rule all=0.6119 dom=0.8462 non=0.3766 h5=0.7273 macro=0.7327 +pow080 pool rule all=0.6100 dom=0.8460 non=0.3731 h5=0.7262 macro=0.7307 +pow080m pool rule all=0.6102 dom=0.8469 non=0.3725 h5=0.7249 macro=0.7318 +pow085 pool rule all=0.6096 dom=0.8458 non=0.3724 h5=0.7267 macro=0.7295 +pow085idf025 pool rule all=0.6089 dom=0.8473 non=0.3696 h5=0.7343 macro=0.7327 +pow085idf050 pool rule all=0.6092 dom=0.8483 non=0.3692 h5=0.7350 macro=0.7318 +pow090 pool rule all=0.6101 dom=0.8464 non=0.3728 h5=0.7270 macro=0.7289 +pow2 pool rule all=0.5749 dom=0.8115 non=0.3374 h5=0.7008 macro=0.6994 +tani pool rule all=0.5881 dom=0.8222 non=0.3531 h5=0.7236 macro=0.7112 diff --git a/shared/package-files/f3/f3b61422b044c81c1d0b88fd5e9060b499b0342476d1077032c47a11125efed0/recur-mof-10.log b/shared/package-files/f3/f3b61422b044c81c1d0b88fd5e9060b499b0342476d1077032c47a11125efed0/recur-mof-10.log new file mode 100644 index 0000000000000000000000000000000000000000..68d4458537e493b7a9a8f1f7c2c1aa78ac5e4790 --- /dev/null +++ b/shared/package-files/f3/f3b61422b044c81c1d0b88fd5e9060b499b0342476d1077032c47a11125efed0/recur-mof-10.log @@ -0,0 +1,4 @@ +DGL backend not selected or invalid. Assuming PyTorch for now. +Setting the default backend to "pytorch". You can change it in the ~/.dgl/config.json file or export the DGLBACKEND environment variable. Valid options are: pytorch, mxnet, tensorflow (all lowercase) +merged tol 10 mDa: 7962 of 19429 spectra in groups of >= 3; peaks 139302 -> 853636; 0 s +wrote /workspace/research/inv/recur/mof-10.npz 167 s diff --git a/shared/package-files/f3/f3b864caed2fee353fe8b9d864d9a0d6933873a63ce66a2c2c46c598a7729d22/netprop-eval-randcand.log b/shared/package-files/f3/f3b864caed2fee353fe8b9d864d9a0d6933873a63ce66a2c2c46c598a7729d22/netprop-eval-randcand.log new file mode 100644 index 0000000000000000000000000000000000000000..ccb84cec29f149ab4781613130e02b3a4a418114 --- /dev/null +++ b/shared/package-files/f3/f3b864caed2fee353fe8b9d864d9a0d6933873a63ce66a2c2c46c598a7729d22/netprop-eval-randcand.log @@ -0,0 +1,6 @@ +released rule from saved branches: Hit@1 0.7713 pool-macro 0.8591 Hit@5 0.8797 Hit@20 0.9377 | twin pools 354 (macro 0.7429), others macro 0.8727 + +k=10 p=6.0 norm | m=1 tau=1.0 kernel=plain debias=fold control=random-candidate shuffle=None: alone Hit@1 0.0144 (domain 0.0067 / other 0.0222) macro 0.0112 + lam 0.00/0.25: Hit@1 0.7605 (-0.0108 [-0.0218, -0.0034]) macro -0.0050 [-0.0077, -0.0024] pools +2 -19 | no top 20 -0.0076 cap30 -0.0095 [-0.0170, -0.0037] | Hit@5 -0.0049 macro@5 -0.0021 cap30@5 -0.0049 | twin +1 -3 other +1 -16 | dom +0.0000 oth -0.0217 + lam 0.00/0.50: Hit@1 0.7621 (-0.0093 [-0.0249, +0.0053]) macro -0.0086 [-0.0121, -0.0050] pools +6 -35 | no top 20 -0.0143 cap30 -0.0123 [-0.0231, -0.0026] | Hit@5 -0.0120 macro@5 -0.0056 cap30@5 -0.0128 | twin +2 -8 other +4 -27 | dom +0.0002 oth -0.0188 + lam 0.50/0.50: Hit@1 0.7586 (-0.0127 [-0.0298, +0.0032]) macro -0.0095 [-0.0139, -0.0050] pools +12 -44 | no top 20 -0.0181 cap30 -0.0149 [-0.0264, -0.0038] | Hit@5 -0.0112 macro@5 -0.0053 cap30@5 -0.0119 | twin +6 -11 other +6 -33 | dom -0.0017 oth -0.0237 diff --git a/shared/package-files/f3/f3c257e103c7cc52c56a27efc8b710a00c353a45d902d450ec7cbb8ceb790c20/README.md b/shared/package-files/f3/f3c257e103c7cc52c56a27efc8b710a00c353a45d902d450ec7cbb8ceb790c20/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d25e7fb9c8a53f22ea17750e28f95fac33ad2fa2 --- /dev/null +++ b/shared/package-files/f3/f3c257e103c7cc52c56a27efc8b710a00c353a45d902d450ec7cbb8ceb790c20/README.md @@ -0,0 +1,89 @@ +# MassSpecGym v1.5 retrieval package: scratch-trained GLACIER simulator + pool aggregation + +Interim release (the research loop continues; see `EXPERIMENTS.md` at the package root). + +## What it does + +`bash infer.sh INPUT_ROOT OUTPUT_ROOT` reads `queries.jsonl` and `candidate_pools.jsonl` and +writes `OUTPUT_ROOT/rankings.jsonl` with one complete ranking per query. + +1. Every supported candidate SMILES is simulated with a GLACIER forward model (ms-pred commit + `ed8311f2`, vendored under `vendor/ms_pred`) under the query's adduct, instrument and + rounded collision energy (missing energy -> the model's "no energy" embedding; missing + instrument -> `Unknown`). Simulations are deduplicated across queries. +2. Each observed spectrum is compared with each simulated candidate spectrum by a + Jensen-Shannon distance on 0.01 Da bins (top-50 observed peaks, square-root observed + intensities, top-100 predicted fragments), as in GLACIER retrieval, with two global, + label-free changes selected on validation (`views` in `model_config.json`): + - **fragment-only view**: observed and predicted peaks at or above `precursor_mz - 0.5` + are left out before normalization (the simulator puts most intensity on the intact + precursor for `[M+Na]+`/no-energy spectra, while many observed spectra do not contain + it); a spectrum with no fragment peak falls back to the full-spectrum distance; + - predicted intensities are raised to the power 0.75 before normalization. + Unsupported candidates get distance 1. +3. **Pool aggregation (multi-spectrum evidence).** Queries that name the same + `candidate_pool_id` are spectra of the same unknown, so the final distance of a candidate + is the mean of its distances over all scored spectra of that pool + (`pool_aggregation: 1.0` in `model_config.json`; set it to `0.0` for independent + per-spectrum ranking). This uses only the supplied inputs: no labels, no formulae, no + candidate positions, no fitted or query-specific parameters. With weight 1 all spectra + of a pool receive the same ranking. +4. Candidates are sorted by distance, ties by candidate id. + +## Model + +- One GLACIER network (15.1 M parameters), **randomly initialized** and trained only on the + MassSpecGym v1.5 train fold: run A, `[M+H]+` spectra with a recorded collision energy + (the stock GLACIER condition domain), 10,000 steps, batch 32, seed 1, EMA weights. + No pretrained assets, no published GLACIER weights. +- `model.pt` is a single PyTorch file holding the member list (one member here). +- Source checkpoint sha256 `443eabf604abbc946b19529d51ec405c44f5ec0dc13bd27afbd7e85dcd472252`. + +## Validation (selection evidence; not comparable to the test reference) + +Full validation fold, 19,429 queries / 3,386 pools, query-set sha256 +`7e6f5034f6196d3f18afe31ec8cfc24305b12d09b6cd04293da061cd3f7746e6`. + +| ranking | Hit@1 | Hit@5 | Hit@20 | 95 % CI Hit@1 (molecule-group bootstrap) | +|---|---|---|---|---| +| released (fragment-only view, power 0.75, pool aggregation) | 0.5636 | 0.7131 | 0.8193 | 0.5125 - 0.6110 | +| previous release (full-spectrum distance, pool aggregation) | 0.5116 | 0.6436 | 0.7283 | 0.4647 - 0.5559 | +| previous scoring, independent spectra | 0.4058 | 0.5482 | 0.6371 | 0.3709 - 0.4383 | + +Paired pool bootstrap, released vs previous release (same simulations): +0.0520 +[+0.0333, +0.0703]. Strata (released): `[M+H]+` 0.661, `[M+Na]+` 0.263; recorded energy +0.66-0.80, missing energy 0.340; stock GLACIER domain 0.783, other 0.343. + +How these numbers were produced: the network is the one of the previous release, whose +2,540,748 full-validation simulations were saved during that release's relocated replay +run (`research/evals/A10k-full`). The released scoring code (`infer.py`, same file as in +this package) re-scored those simulations (`--load-predictions`, 80 s). The relocated, +read-only copy of this exact package was then replayed end to end on `val-sub` (2,147 +queries, whole pools; 267 s; Hit@1 0.5771, Hit@5 0.7177, Hit@20 0.8165). Against the +full-fold rankings of the same queries, the top-1 candidate is identical for all 2,147 +queries and Hit@1/5/20 are identical; 3.2 % of target ranks differ by at most 2 positions +below rank 20 (float noise from different batch composition among near-tied candidates; +E14 in `EXPERIMENTS.md`). A full-fold replay of this package was not repeated; simulation +cost is unchanged from the previous release (1,362 s for the full fold; 1,440 s end to end). + +## Limits + +- Non-domain conditions (`[M+Na]+`, missing collision energy) were not seen in training by + this member; an all-condition model is in training (run B in `EXPERIMENTS.md`). +- With aggregation weight 1 a pool is hit or missed as a whole, so the estimate has a wide + molecule-group confidence interval and depends on a few very large pools. +- Candidates that RDKit cannot parse, contain unsupported elements or have more than 100 + heavy atoms get distance 1 (ranked last, by candidate id). + +## Runtime + +`/opt/glacier/bin/python` (override with `MASSSPECGYM_GLACIER_PYTHON`), one GPU, <= 14 CPU +featurization workers, about 3 GiB of host memory for the validation fold, no network, no +writes inside the package. Measured: 2.54 M simulations in 1,362 s, 1,440 s end to end. + +## Files + +`infer.sh`, `infer.py`, `fastfeat.py` (compact featurization, tensor-equal to the stock one), +`model.pt`, `model_config.json`, `model_manifest.json`, `vendor/ms_pred` (+ `LICENSE.ms-pred`), +`training/` (training, preparation, publication and analysis source used for this release). +Experiment records: `EXPERIMENTS.md` and `research/` at the package root. diff --git a/shared/package-files/f3/f3f80cf4bca120d2faedcb429829c309a9ace08a91501fb55f535a62d23435f8/A-domain-b32.log b/shared/package-files/f3/f3f80cf4bca120d2faedcb429829c309a9ace08a91501fb55f535a62d23435f8/A-domain-b32.log new file mode 100644 index 0000000000000000000000000000000000000000..c3dcc343c9ce612437918a0e9c9640df316ed56a --- /dev/null +++ b/shared/package-files/f3/f3f80cf4bca120d2faedcb429829c309a9ace08a91501fb55f535a62d23435f8/A-domain-b32.log @@ -0,0 +1,11 @@ +{"parameters": 15108154, "train_rows": 99119, "validation_rows": 2048, "steps_per_epoch": 3097, "identity": "random", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 2500, "elapsed_seconds": 476.47718064906076, "validation_loss": 0.6196546740829945, "validation_loss_ema": 0.5919880140572786} +{"step": 5000, "elapsed_seconds": 975.7144453800283, "validation_loss": 0.5896129664033651, "validation_loss_ema": 0.5621519554406404} +{"step": 7500, "elapsed_seconds": 1727.8614929110045, "validation_loss": 0.5107987560331821, "validation_loss_ema": 0.4982716413214803} +{"event": "resumed", "step": 8000, "epoch": 2, "batch_in_epoch": 1806, "elapsed": 1871.1361643830314, "skipped": 0} +{"parameters": 15108154, "train_rows": 99119, "validation_rows": 2048, "steps_per_epoch": 3097, "identity": "random", "gpu": "NVIDIA H100 80GB HBM3"} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"step": 10000, "elapsed_seconds": 2334.5592241840204, "validation_loss": 0.492212338373065, "validation_loss_ema": 0.46857665106654167} diff --git a/shared/package-files/f9/f961832b1b0f7abc5d96b0d88dbfb976dcd5589646cf0b3dec25273487ea7707/library-reverse-eval-ztop_.log b/shared/package-files/f9/f961832b1b0f7abc5d96b0d88dbfb976dcd5589646cf0b3dec25273487ea7707/library-reverse-eval-ztop_.log new file mode 100644 index 0000000000000000000000000000000000000000..f714e94fa24ee7eb072a412538b252dede809ce5 --- /dev/null +++ b/shared/package-files/f9/f961832b1b0f7abc5d96b0d88dbfb976dcd5589646cf0b3dec25273487ea7707/library-reverse-eval-ztop_.log @@ -0,0 +1,55 @@ +base (released rule without consensus): Hit@1 0.7685 domain 0.9301 other 0.6062 macro 0.8650 +ztop_1_0 alone per spectrum 0.1319 (0.1472 / 0.1165) pool mean 0.1931 (0.1906 / 0.1956) macro 0.1624 + other w 0.50 (x0.05/sd): Hit@1 0.7207 (-0.0478 [-0.0785, -0.0221]) macro 0.8550 (-0.0100 [-0.0157, -0.0041]) pools +29 -63 | domain 0.9244 other 0.5161 Hit@5 0.8237 + other w 1.00 (x0.05/sd): Hit@1 0.6919 (-0.0766 [-0.1090, -0.0483]) macro 0.8320 (-0.0331 [-0.0405, -0.0260]) pools +31 -143 | domain 0.9241 other 0.4587 Hit@5 0.8049 + other w 2.00 (x0.05/sd): Hit@1 0.6491 (-0.1194 [-0.1529, -0.0912]) macro 0.7921 (-0.0729 [-0.0830, -0.0632]) pools +30 -277 | domain 0.9188 other 0.3782 Hit@5 0.7812 + other w 4.00 (x0.05/sd): Hit@1 0.6103 (-0.1582 [-0.1949, -0.1257]) macro 0.7475 (-0.1175 [-0.1291, -0.1063]) pools +30 -428 | domain 0.9145 other 0.3048 Hit@5 0.7383 + all w 0.50 (x0.05/sd): Hit@1 0.7135 (-0.0550 [-0.0855, -0.0279]) macro 0.8473 (-0.0177 [-0.0254, -0.0100]) pools +50 -110 | domain 0.9102 other 0.5160 Hit@5 0.8216 + all w 1.00 (x0.05/sd): Hit@1 0.6697 (-0.0988 [-0.1332, -0.0707]) macro 0.7989 (-0.0662 [-0.0765, -0.0558]) pools +55 -279 | domain 0.8817 other 0.4568 Hit@5 0.8015 + all w 2.00 (x0.05/sd): Hit@1 0.5654 (-0.2030 [-0.2373, -0.1702]) macro 0.6607 (-0.2044 [-0.2188, -0.1902]) pools +56 -748 | domain 0.7541 other 0.3761 Hit@5 0.7705 + all w 4.00 (x0.05/sd): Hit@1 0.3882 (-0.3803 [-0.4219, -0.3393]) macro 0.4253 (-0.4398 [-0.4584, -0.4220]) pools +51 -1540 | domain 0.4855 other 0.2905 Hit@5 0.6811 +ztop_1_4 alone per spectrum 0.1337 (0.1484 / 0.1188) pool mean 0.1945 (0.1932 / 0.1957) macro 0.1633 + other w 0.50 (x0.05/sd): Hit@1 0.7207 (-0.0478 [-0.0785, -0.0221]) macro 0.8550 (-0.0100 [-0.0157, -0.0041]) pools +29 -63 | domain 0.9244 other 0.5161 Hit@5 0.8237 + other w 1.00 (x0.05/sd): Hit@1 0.6919 (-0.0766 [-0.1090, -0.0483]) macro 0.8320 (-0.0331 [-0.0405, -0.0260]) pools +31 -143 | domain 0.9241 other 0.4587 Hit@5 0.8049 + other w 2.00 (x0.05/sd): Hit@1 0.6490 (-0.1195 [-0.1529, -0.0912]) macro 0.7918 (-0.0732 [-0.0833, -0.0635]) pools +30 -278 | domain 0.9188 other 0.3781 Hit@5 0.7812 + other w 4.00 (x0.05/sd): Hit@1 0.6103 (-0.1582 [-0.1949, -0.1257]) macro 0.7475 (-0.1175 [-0.1291, -0.1063]) pools +30 -428 | domain 0.9145 other 0.3048 Hit@5 0.7381 + all w 0.50 (x0.05/sd): Hit@1 0.7135 (-0.0550 [-0.0855, -0.0279]) macro 0.8473 (-0.0177 [-0.0254, -0.0100]) pools +50 -110 | domain 0.9102 other 0.5160 Hit@5 0.8214 + all w 1.00 (x0.05/sd): Hit@1 0.6697 (-0.0988 [-0.1332, -0.0707]) macro 0.7989 (-0.0662 [-0.0765, -0.0558]) pools +55 -279 | domain 0.8817 other 0.4568 Hit@5 0.8014 + all w 2.00 (x0.05/sd): Hit@1 0.5642 (-0.2043 [-0.2389, -0.1720]) macro 0.6580 (-0.2070 [-0.2218, -0.1931]) pools +56 -757 | domain 0.7516 other 0.3760 Hit@5 0.7704 + all w 4.00 (x0.05/sd): Hit@1 0.3877 (-0.3808 [-0.4221, -0.3396]) macro 0.4244 (-0.4406 [-0.4590, -0.4232]) pools +51 -1543 | domain 0.4845 other 0.2905 Hit@5 0.6804 +ztop_20_0 alone per spectrum 0.1588 (0.1683 / 0.1493) pool mean 0.2776 (0.2088 / 0.3467) macro 0.2333 + other w 0.50 (x0.05/sd): Hit@1 0.7808 (+0.0124 [-0.0297, +0.0732]) macro 0.8562 (-0.0089 [-0.0145, -0.0030]) pools +37 -67 | domain 0.9307 other 0.6304 Hit@5 0.8887 + other w 1.00 (x0.05/sd): Hit@1 0.7503 (-0.0182 [-0.0716, +0.0463]) macro 0.8423 (-0.0227 [-0.0298, -0.0151]) pools +44 -121 | domain 0.9288 other 0.5711 Hit@5 0.8749 + other w 2.00 (x0.05/sd): Hit@1 0.7218 (-0.0467 [-0.1002, +0.0220]) macro 0.8157 (-0.0493 [-0.0585, -0.0399]) pools +43 -210 | domain 0.9257 other 0.5170 Hit@5 0.8551 + other w 4.00 (x0.05/sd): Hit@1 0.6842 (-0.0843 [-0.1416, -0.0167]) macro 0.7791 (-0.0859 [-0.0969, -0.0753]) pools +42 -333 | domain 0.9183 other 0.4492 Hit@5 0.8182 + all w 0.50 (x0.05/sd): Hit@1 0.7768 (+0.0083 [-0.0354, +0.0693]) macro 0.8517 (-0.0133 [-0.0204, -0.0062]) pools +55 -100 | domain 0.9275 other 0.6255 Hit@5 0.8886 + all w 1.00 (x0.05/sd): Hit@1 0.7403 (-0.0282 [-0.0810, +0.0360]) macro 0.8258 (-0.0393 [-0.0484, -0.0298]) pools +65 -198 | domain 0.9122 other 0.5677 Hit@5 0.8785 + all w 2.00 (x0.05/sd): Hit@1 0.6724 (-0.0961 [-0.1535, -0.0247]) macro 0.7510 (-0.1140 [-0.1270, -0.1013]) pools +66 -452 | domain 0.8373 other 0.5069 Hit@5 0.8553 + all w 4.00 (x0.05/sd): Hit@1 0.5450 (-0.2235 [-0.2860, -0.1442]) macro 0.5975 (-0.2676 [-0.2841, -0.2516]) pools +58 -964 | domain 0.6595 other 0.4299 Hit@5 0.8046 +ztop_20_4 alone per spectrum 0.2263 (0.2358 / 0.2167) pool mean 0.3322 (0.2901 / 0.3745) macro 0.2631 + other w 0.50 (x0.05/sd): Hit@1 0.7463 (-0.0222 [-0.0483, +0.0004]) macro 0.8556 (-0.0095 [-0.0154, -0.0032]) pools +37 -69 | domain 0.9311 other 0.5608 Hit@5 0.8910 + other w 1.00 (x0.05/sd): Hit@1 0.7298 (-0.0387 [-0.0671, -0.0141]) macro 0.8452 (-0.0198 [-0.0272, -0.0118]) pools +53 -120 | domain 0.9304 other 0.5283 Hit@5 0.8744 + other w 2.00 (x0.05/sd): Hit@1 0.7295 (-0.0390 [-0.0957, +0.0257]) macro 0.8175 (-0.0475 [-0.0576, -0.0381]) pools +52 -213 | domain 0.9269 other 0.5313 Hit@5 0.8522 + other w 4.00 (x0.05/sd): Hit@1 0.6975 (-0.0710 [-0.1283, -0.0072]) macro 0.7859 (-0.0791 [-0.0916, -0.0682]) pools +59 -327 | domain 0.9232 other 0.4710 Hit@5 0.8323 + all w 0.50 (x0.05/sd): Hit@1 0.7449 (-0.0236 [-0.0496, -0.0017]) macro 0.8529 (-0.0121 [-0.0189, -0.0047]) pools +57 -98 | domain 0.9281 other 0.5609 Hit@5 0.8905 + all w 1.00 (x0.05/sd): Hit@1 0.7183 (-0.0502 [-0.0781, -0.0244]) macro 0.8296 (-0.0354 [-0.0440, -0.0260]) pools +72 -192 | domain 0.9114 other 0.5243 Hit@5 0.8742 + all w 2.00 (x0.05/sd): Hit@1 0.6914 (-0.0770 [-0.1345, -0.0114]) macro 0.7575 (-0.1075 [-0.1208, -0.0951]) pools +76 -440 | domain 0.8568 other 0.5254 Hit@5 0.8506 + all w 4.00 (x0.05/sd): Hit@1 0.5682 (-0.2003 [-0.2641, -0.1266]) macro 0.6057 (-0.2593 [-0.2764, -0.2431]) pools +83 -961 | domain 0.6771 other 0.4589 Hit@5 0.8185 +ztop_5_0 alone per spectrum 0.1672 (0.1780 / 0.1564) pool mean 0.2233 (0.2091 / 0.2375) macro 0.2268 + other w 0.50 (x0.05/sd): Hit@1 0.7360 (-0.0325 [-0.0583, -0.0100]) macro 0.8585 (-0.0065 [-0.0121, -0.0009]) pools +36 -58 | domain 0.9270 other 0.5443 Hit@5 0.8676 + other w 1.00 (x0.05/sd): Hit@1 0.7127 (-0.0557 [-0.0850, -0.0300]) macro 0.8447 (-0.0204 [-0.0278, -0.0130]) pools +40 -109 | domain 0.9302 other 0.4944 Hit@5 0.8600 + other w 2.00 (x0.05/sd): Hit@1 0.6832 (-0.0853 [-0.1170, -0.0566]) macro 0.8139 (-0.0511 [-0.0605, -0.0416]) pools +41 -214 | domain 0.9261 other 0.4393 Hit@5 0.8352 + other w 4.00 (x0.05/sd): Hit@1 0.6446 (-0.1239 [-0.1565, -0.0926]) macro 0.7800 (-0.0851 [-0.0960, -0.0735]) pools +41 -329 | domain 0.9144 other 0.3736 Hit@5 0.8067 + all w 0.50 (x0.05/sd): Hit@1 0.7339 (-0.0346 [-0.0618, -0.0113]) macro 0.8532 (-0.0118 [-0.0189, -0.0047]) pools +51 -91 | domain 0.9211 other 0.5458 Hit@5 0.8711 + all w 1.00 (x0.05/sd): Hit@1 0.6938 (-0.0747 [-0.1042, -0.0475]) macro 0.8204 (-0.0446 [-0.0538, -0.0357]) pools +56 -207 | domain 0.8975 other 0.4893 Hit@5 0.8605 + all w 2.00 (x0.05/sd): Hit@1 0.6255 (-0.1430 [-0.1754, -0.1103]) macro 0.7336 (-0.1314 [-0.1447, -0.1184]) pools +58 -503 | domain 0.8193 other 0.4309 Hit@5 0.8280 + all w 4.00 (x0.05/sd): Hit@1 0.5021 (-0.2664 [-0.3026, -0.2306]) macro 0.5700 (-0.2950 [-0.3113, -0.2779]) pools +52 -1051 | domain 0.6407 other 0.3629 Hit@5 0.7790 +ztop_5_4 alone per spectrum 0.1913 (0.2135 / 0.1690) pool mean 0.2556 (0.2464 / 0.2649) macro 0.2321 + other w 0.50 (x0.05/sd): Hit@1 0.7456 (-0.0229 [-0.0478, +0.0012]) macro 0.8594 (-0.0056 [-0.0115, +0.0006]) pools +41 -60 | domain 0.9279 other 0.5626 Hit@5 0.8726 + other w 1.00 (x0.05/sd): Hit@1 0.7167 (-0.0518 [-0.0843, -0.0224]) macro 0.8447 (-0.0204 [-0.0275, -0.0127]) pools +47 -116 | domain 0.9296 other 0.5028 Hit@5 0.8603 + other w 2.00 (x0.05/sd): Hit@1 0.6775 (-0.0909 [-0.1260, -0.0613]) macro 0.8163 (-0.0487 [-0.0585, -0.0393]) pools +49 -214 | domain 0.9278 other 0.4263 Hit@5 0.8348 + other w 4.00 (x0.05/sd): Hit@1 0.6476 (-0.1209 [-0.1570, -0.0921]) macro 0.7803 (-0.0848 [-0.0966, -0.0741]) pools +47 -334 | domain 0.9185 other 0.3757 Hit@5 0.8135 + all w 0.50 (x0.05/sd): Hit@1 0.7426 (-0.0259 [-0.0523, -0.0015]) macro 0.8550 (-0.0100 [-0.0171, -0.0029]) pools +60 -94 | domain 0.9215 other 0.5630 Hit@5 0.8761 + all w 1.00 (x0.05/sd): Hit@1 0.7002 (-0.0682 [-0.1014, -0.0370]) macro 0.8222 (-0.0428 [-0.0526, -0.0322]) pools +69 -214 | domain 0.8997 other 0.4999 Hit@5 0.8637 + all w 2.00 (x0.05/sd): Hit@1 0.6203 (-0.1482 [-0.1860, -0.1167]) macro 0.7310 (-0.1341 [-0.1483, -0.1208]) pools +68 -522 | domain 0.8204 other 0.4194 Hit@5 0.8291 + all w 4.00 (x0.05/sd): Hit@1 0.4975 (-0.2710 [-0.3103, -0.2325]) macro 0.5570 (-0.3080 [-0.3246, -0.2900]) pools +62 -1105 | domain 0.6285 other 0.3660 Hit@5 0.7850 diff --git a/shared/package-files/f9/f99a5d80de4405a49c3c04c2332dd702bec2d1792d2e8626470e1dc1ca04370b/profile_sim.py b/shared/package-files/f9/f99a5d80de4405a49c3c04c2332dd702bec2d1792d2e8626470e1dc1ca04370b/profile_sim.py new file mode 100644 index 0000000000000000000000000000000000000000..4c8053e7b6cbc7d3e6fb1ae467a78ef1b2d40ad1 --- /dev/null +++ b/shared/package-files/f9/f99a5d80de4405a49c3c04c2332dd702bec2d1792d2e8626470e1dc1ca04370b/profile_sim.py @@ -0,0 +1,109 @@ +"""Where does simulation time go, and what do cheaper numerics change? (development only) + +profile_sim.py BUILD_DIR INPUT_ROOT [--batches 12] [--batch-size 128] + +Loads the first forward member of BUILD_DIR/model.pt, featurizes the first simulation batches +of INPUT_ROOT in-process, and times `predict_topk` (GPU synchronised) under + fp32 the released numerics, + tf32 torch.backends.cuda.matmul.allow_tf32 = True, + bf16 torch.autocast(bfloat16), +reporting simulations per second and the deviation of the predicted masses / intensities from +fp32, followed by an operator profile of the fp32 path. No labels are read. +""" +import argparse +import json +import sys +import time +from pathlib import Path + +import numpy as np +import torch + + +def main(): + p = argparse.ArgumentParser(description=__doc__) + p.add_argument('build', type=Path) + p.add_argument('root', type=Path) + p.add_argument('--batches', type=int, default=12) + p.add_argument('--batch-size', type=int, default=None) + p.add_argument('--profile', action='store_true') + args = p.parse_args() + sys.path.insert(0, str(args.build.resolve())) + sys.path.insert(0, str(args.build.resolve() / 'vendor')) + import infer + from ms_pred import common + from fastfeat import expand_graphormer + config = json.loads((args.build / 'model_config.json').read_text()) + queries = list(infer.read_jsonl(args.root / 'queries.jsonl')) + pools = {r['candidate_pool_id']: r['candidates'] for r in infer.read_jsonl(args.root / 'candidate_pools.jsonl')} + inst = lambda name: common.instrument2onehot_pos.get(name or 'Unknown', common.instrument2onehot_pos['Unknown']) + plan = infer.Plan(queries, pools, 6, inst, set(common.ion2onehot_pos)) + size = args.batch_size or int(config['inference_batch_size']) + dataset = infer.TaskBatches(plan, size, config['model']) + members, _ = infer.load_members([args.build / 'model.pt']) + device = torch.device('cuda') + model = infer.build_model(members[0], device) + k = int(config['sparse_k']) + batches = [] + for number in range(min(args.batches, len(dataset))): + batch = dataset[number] + if batch is None: + continue + batch.pop('task_index') + compact = {key: value.to(device) for key, value in batch.pop('graphormer_compact').items()} + batch = {key: value.to(device) for key, value in batch.items()} + batch['graphormer_input'] = expand_graphormer(compact) + batches.append(batch) + rows = sum(int(b['num_atoms'].shape[0]) for b in batches) + + def run(mode): + torch.backends.cuda.matmul.allow_tf32 = mode == 'tf32' + torch.backends.cudnn.allow_tf32 = mode != 'fp32-strict' + out = [] + torch.cuda.synchronize() + started = time.monotonic() + with torch.inference_mode(): + for batch in batches: + with torch.autocast('cuda', dtype=torch.bfloat16, enabled=mode == 'bf16'): + mass, top = infer.predict_topk(model, batch, k) + out.append((mass.double().cpu(), top.double().cpu())) + torch.cuda.synchronize() + return time.monotonic() - started, out + + run('fp32') # warm-up + reference = None + for mode in ('fp32', 'tf32', 'bf16', 'fp32', 'tf32', 'bf16'): + seconds, out = run(mode) + line = {'mode': mode, 'batch_size': size, 'simulations': rows, 'seconds': round(seconds, 3), + 'per_second': round(rows / seconds, 1)} + if reference is None: + reference = out + else: + mass_dev, top_dev, moved = 0.0, 0.0, 0 + total = 0 + for (m0, t0), (m1, t1) in zip(reference, out): + # compare as sets of peaks: sort by mass + o0, o1 = torch.argsort(m0, dim=1), torch.argsort(m1, dim=1) + a, b = torch.gather(m0, 1, o0), torch.gather(m1, 1, o1) + ta, tb = torch.gather(t0, 1, o0), torch.gather(t1, 1, o1) + same = (a - b).abs() < 1e-3 + moved += int((~same).sum()) + total += a.numel() + mass_dev = max(mass_dev, float((a - b).abs()[same].max()) if same.any() else 0.0) + top_dev = max(top_dev, float((ta - tb).abs()[same].max()) if same.any() else 0.0) + line.update(peaks=total, peaks_not_aligned=moved, max_mass_dev_aligned=mass_dev, max_inten_dev_aligned=top_dev) + print(json.dumps(line), flush=True) + if args.profile: + torch.backends.cuda.matmul.allow_tf32 = False + from torch.profiler import profile, ProfilerActivity + with profile(activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA]) as prof: + with torch.inference_mode(): + for batch in batches[:4]: + infer.predict_topk(model, batch, k) + torch.cuda.synchronize() + print(prof.key_averages().table(sort_by='cuda_time_total', row_limit=18, max_name_column_width=40)) + print(prof.key_averages().table(sort_by='self_cpu_time_total', row_limit=18, max_name_column_width=40)) + + +if __name__ == '__main__': + main() diff --git a/shared/package-files/ff/ff00a10d854cb3edd03962bb33d23f6132c7ba04ada79b35ad86be10c487137e/swap-N5m10-w0.75_0.1_0.5.log b/shared/package-files/ff/ff00a10d854cb3edd03962bb33d23f6132c7ba04ada79b35ad86be10c487137e/swap-N5m10-w0.75_0.1_0.5.log new file mode 100644 index 0000000000000000000000000000000000000000..74efc1e83c117a6fb016554e49e90b1a02ecbef6 --- /dev/null +++ b/shared/package-files/ff/ff00a10d854cb3edd03962bb33d23f6132c7ba04ada79b35ad86be10c487137e/swap-N5m10-w0.75_0.1_0.5.log @@ -0,0 +1,8 @@ +released rule from saved branches: Hit@1 0.7728 pool-macro 0.8677 Hit@5 0.8812 Hit@20 0.9345 | twin pools 354 (macro 0.7542), others macro 0.8809 + +k=10 p=3.0 half=0.5 | m=10 tau=0.02 kernel=plain fps=morgan debias=fold control=none shuffle=None: alone Hit@1 0.4604 (domain 0.4181 / other 0.5029) macro 0.3828 + lam 1.00/1.00: Hit@1 0.8112 (+0.0384 [+0.0188, +0.0635]) macro +0.0165 [+0.0103, +0.0227] pools +90 -34 | no top 20 +0.0304 cap30 +0.0314 [+0.0172, +0.0458] | Hit@5 +0.0007 macro@5 +0.0062 cap30@5 +0.0172 +without consensus term: Hit@1 0.7728 (ref 0.7685; +0.0043 [-0.0029, +0.0120]) macro 0.8677 (+0.0027 [-0.0003, +0.0056]) pools +18 -9 cap30 +0.0052 | Hit@5 0.8812 (+0.0020) Hit@20 0.9345 (-0.0012) + domain 0.9327 (+0.0026) other 0.6123 (+0.0061) | Orbitrap no energy 0.5764 (+0.0067) | above 850 0.4420 (+0.0203) below 850 0.8482 (+0.0007) +full rule : Hit@1 0.8112 (ref 0.8063; +0.0049 [-0.0075, +0.0175]) macro 0.8842 (+0.0030 [+0.0000, +0.0059]) pools +18 -8 cap30 +0.0048 | Hit@5 0.8819 (+0.0061) Hit@20 0.9065 (-0.0103) + domain 0.9450 (+0.0041) other 0.6768 (+0.0058) | Orbitrap no energy 0.6482 (+0.0057) | above 850 0.5344 (-0.0094) below 850 0.8742 (+0.0082) diff --git a/shared/package-files/ff/ff2b08c051512a0af2af83460bc98daeea14c1ffe83c5266720662f036f6c0a2/anchor-mix-4member.log b/shared/package-files/ff/ff2b08c051512a0af2af83460bc98daeea14c1ffe83c5266720662f036f6c0a2/anchor-mix-4member.log new file mode 100644 index 0000000000000000000000000000000000000000..245300d82464de6bd203732ae2b77962971eb9ff --- /dev/null +++ b/shared/package-files/ff/ff2b08c051512a0af2af83460bc98daeea14c1ffe83c5266720662f036f6c0a2/anchor-mix-4member.log @@ -0,0 +1,54 @@ +=== members: B20k=evals/anchor/B20k-v1.pkl,B30k=evals/anchor/B30k-v1.pkl,B2-20k=evals/anchor/B2-20k-v1.pkl,B2-30k=evals/anchor/B2-30k-v1.pkl +released all=0.7384 dom=0.9007 non=0.5755 h5=0.8418 h20=0.9104 macro=0.8210 | +0.0000 [+0.0000,+0.0000] | h5 +0.0000 [+0.0000,+0.0000] | ind 0.5743 +0.0000 [+0.0000,+0.0000] +released forward only all=0.6539 dom=0.8039 non=0.5034 h5=0.8177 h20=0.8925 macro=0.7519 | +0.0000 [+0.0000,+0.0000] | h5 +0.0000 [+0.0000,+0.0000] | ind 0.4790 +0.0000 [+0.0000,+0.0000] +p10f1/p20f4 lam=0.0 w=0.75,0.05,0.5 all=0.7123 dom=0.9012 non=0.5227 h5=0.8512 h20=0.9097 macro=0.8204 | -0.0260 [-0.0874,+0.0196] | h5 +0.0094 [-0.0059,+0.0318] | ind 0.5807 +0.0064 [+0.0009,+0.0112] + forward only p10f1/p20f4 lam=0.0 all=0.6220 dom=0.8015 non=0.4418 h5=0.8226 h20=0.8958 macro=0.7563 | -0.0319 [-0.0930,+0.0066] | h5 +0.0049 [-0.0046,+0.0165] | ind 0.4847 +0.0058 [-0.0009,+0.0118] + n=1 [431 pools] 0.7865->0.7865 (+8 -8); n=2-3 [2088 pools] 0.8740->0.8736 (+19 -20); n=4-9 [502 pools] 0.7550->0.7629 (+16 -12); n=10-29 [238 pools] 0.6303->0.6218 (+4 -6); n>=30 [127 pools] 0.6850->0.6614 (+1 -4); domain [2153 pools] 0.9118->0.9108 (+13 -15); mixed [254 pools] 0.7677->0.7598 (+4 -6); other [979 pools] 0.6353->0.6374 (+31 -29) +p10f1/p20f4 lam=0.5 w=0.75,0.05,0.5 all=0.7279 dom=0.9059 non=0.5493 h5=0.8555 h20=0.9120 macro=0.8263 | -0.0104 [-0.0744,+0.0360] | h5 +0.0137 [-0.0049,+0.0360] | ind 0.5911 +0.0168 [+0.0113,+0.0219] + forward only p10f1/p20f4 lam=0.5 all=0.6443 dom=0.8156 non=0.4724 h5=0.8363 h20=0.9045 macro=0.7685 | -0.0096 [-0.0715,+0.0315] | h5 +0.0186 [+0.0062,+0.0322] | ind 0.4978 +0.0188 [+0.0128,+0.0251] + n=1 [431 pools] 0.7865->0.7935 (+10 -7); n=2-3 [2088 pools] 0.8740->0.8784 (+27 -18); n=4-9 [502 pools] 0.7550->0.7570 (+14 -13); n=10-29 [238 pools] 0.6303->0.6471 (+11 -7); n>=30 [127 pools] 0.6850->0.6929 (+4 -3); domain [2153 pools] 0.9118->0.9150 (+21 -14); mixed [254 pools] 0.7677->0.7638 (+5 -6); other [979 pools] 0.6353->0.6476 (+40 -28) +p10f1/p20f4 lam=0.75 w=0.75,0.05,0.5 all=0.7304 dom=0.9065 non=0.5535 h5=0.8567 h20=0.9142 macro=0.8275 | -0.0080 [-0.0725,+0.0382] | h5 +0.0149 [-0.0044,+0.0369] | ind 0.5907 +0.0164 [+0.0093,+0.0227] + forward only p10f1/p20f4 lam=0.75 all=0.6482 dom=0.8174 non=0.4783 h5=0.8423 h20=0.9045 macro=0.7688 | -0.0057 [-0.0653,+0.0349] | h5 +0.0246 [+0.0111,+0.0411] | ind 0.4976 +0.0186 [+0.0109,+0.0259] + n=1 [431 pools] 0.7865->0.8005 (+12 -6); n=2-3 [2088 pools] 0.8740->0.8779 (+27 -19); n=4-9 [502 pools] 0.7550->0.7550 (+15 -15); n=10-29 [238 pools] 0.6303->0.6597 (+14 -7); n>=30 [127 pools] 0.6850->0.6929 (+5 -4); domain [2153 pools] 0.9118->0.9164 (+23 -13); mixed [254 pools] 0.7677->0.7638 (+6 -7); other [979 pools] 0.6353->0.6486 (+44 -31) +p10f1/p20f4 lam=1.0 w=0.75,0.05,0.5 all=0.7316 dom=0.9066 non=0.5559 h5=0.8563 h20=0.9152 macro=0.8290 | -0.0068 [-0.0716,+0.0406] | h5 +0.0146 [-0.0046,+0.0369] | ind 0.5882 +0.0139 [+0.0071,+0.0205] + forward only p10f1/p20f4 lam=1.0 all=0.6459 dom=0.8138 non=0.4773 h5=0.8429 h20=0.9052 macro=0.7688 | -0.0080 [-0.0701,+0.0324] | h5 +0.0252 [+0.0111,+0.0419] | ind 0.4946 +0.0156 [+0.0081,+0.0231] + n=1 [431 pools] 0.7865->0.8074 (+15 -6); n=2-3 [2088 pools] 0.8740->0.8793 (+31 -20); n=4-9 [502 pools] 0.7550->0.7510 (+14 -16); n=10-29 [238 pools] 0.6303->0.6639 (+15 -7); n>=30 [127 pools] 0.6850->0.6929 (+5 -4); domain [2153 pools] 0.9118->0.9169 (+25 -14); mixed [254 pools] 0.7677->0.7677 (+6 -6); other [979 pools] 0.6353->0.6517 (+49 -33) +p10f1 lam=0.0 w=0.75,0.05,0.5 all=0.7123 dom=0.9012 non=0.5227 h5=0.8512 h20=0.9097 macro=0.8204 | -0.0260 [-0.0874,+0.0196] | h5 +0.0094 [-0.0059,+0.0318] | ind 0.5807 +0.0064 [+0.0009,+0.0112] + forward only p10f1 lam=0.0 all=0.6220 dom=0.8015 non=0.4418 h5=0.8226 h20=0.8958 macro=0.7563 | -0.0319 [-0.0930,+0.0066] | h5 +0.0049 [-0.0046,+0.0165] | ind 0.4847 +0.0058 [-0.0009,+0.0118] + n=1 [431 pools] 0.7865->0.7865 (+8 -8); n=2-3 [2088 pools] 0.8740->0.8736 (+19 -20); n=4-9 [502 pools] 0.7550->0.7629 (+16 -12); n=10-29 [238 pools] 0.6303->0.6218 (+4 -6); n>=30 [127 pools] 0.6850->0.6614 (+1 -4); domain [2153 pools] 0.9118->0.9108 (+13 -15); mixed [254 pools] 0.7677->0.7598 (+4 -6); other [979 pools] 0.6353->0.6374 (+31 -29) +p10f1 lam=0.5 w=0.75,0.05,0.5 all=0.7275 dom=0.9034 non=0.5508 h5=0.8550 h20=0.9113 macro=0.8266 | -0.0109 [-0.0749,+0.0354] | h5 +0.0132 [-0.0050,+0.0358] | ind 0.5908 +0.0165 [+0.0111,+0.0217] + forward only p10f1 lam=0.5 all=0.6449 dom=0.8157 non=0.4733 h5=0.8358 h20=0.9039 macro=0.7682 | -0.0091 [-0.0710,+0.0321] | h5 +0.0181 [+0.0056,+0.0319] | ind 0.4971 +0.0182 [+0.0121,+0.0247] + n=1 [431 pools] 0.7865->0.7935 (+9 -6); n=2-3 [2088 pools] 0.8740->0.8760 (+24 -20); n=4-9 [502 pools] 0.7550->0.7729 (+21 -12); n=10-29 [238 pools] 0.6303->0.6387 (+9 -7); n>=30 [127 pools] 0.6850->0.6929 (+4 -3); domain [2153 pools] 0.9118->0.9145 (+20 -14); mixed [254 pools] 0.7677->0.7677 (+6 -6); other [979 pools] 0.6353->0.6486 (+41 -28) +p10f1 lam=0.75 w=0.75,0.05,0.5 all=0.7298 dom=0.9034 non=0.5554 h5=0.8557 h20=0.9133 macro=0.8275 | -0.0086 [-0.0732,+0.0385] | h5 +0.0139 [-0.0056,+0.0359] | ind 0.5909 +0.0166 [+0.0094,+0.0230] + forward only p10f1 lam=0.75 all=0.6437 dom=0.8120 non=0.4748 h5=0.8420 h20=0.9047 macro=0.7667 | -0.0102 [-0.0728,+0.0308] | h5 +0.0243 [+0.0106,+0.0411] | ind 0.4963 +0.0173 [+0.0097,+0.0251] + n=1 [431 pools] 0.7865->0.7981 (+11 -6); n=2-3 [2088 pools] 0.8740->0.8764 (+25 -20); n=4-9 [502 pools] 0.7550->0.7649 (+20 -15); n=10-29 [238 pools] 0.6303->0.6555 (+13 -7); n>=30 [127 pools] 0.6850->0.6929 (+5 -4); domain [2153 pools] 0.9118->0.9150 (+20 -13); mixed [254 pools] 0.7677->0.7638 (+7 -8); other [979 pools] 0.6353->0.6517 (+47 -31) +p10f1 lam=1.0 w=0.75,0.05,0.5 all=0.7303 dom=0.9033 non=0.5566 h5=0.8557 h20=0.9144 macro=0.8269 | -0.0081 [-0.0718,+0.0393] | h5 +0.0139 [-0.0051,+0.0364] | ind 0.5876 +0.0133 [+0.0061,+0.0200] + forward only p10f1 lam=1.0 all=0.6407 dom=0.8095 non=0.4713 h5=0.8434 h20=0.9054 macro=0.7652 | -0.0132 [-0.0767,+0.0269] | h5 +0.0257 [+0.0115,+0.0423] | ind 0.4915 +0.0125 [+0.0052,+0.0203] + n=1 [431 pools] 0.7865->0.7981 (+12 -7); n=2-3 [2088 pools] 0.8740->0.8755 (+26 -23); n=4-9 [502 pools] 0.7550->0.7629 (+20 -16); n=10-29 [238 pools] 0.6303->0.6597 (+14 -7); n>=30 [127 pools] 0.6850->0.6929 (+5 -4); domain [2153 pools] 0.9118->0.9155 (+22 -14); mixed [254 pools] 0.7677->0.7638 (+7 -8); other [979 pools] 0.6353->0.6486 (+48 -35) +=== members: B2-20k=evals/anchor/B2-20k-v1.pkl,B2-30k=evals/anchor/B2-30k-v1.pkl +released all=0.7384 dom=0.9007 non=0.5755 h5=0.8418 h20=0.9104 macro=0.8210 | +0.0000 [+0.0000,+0.0000] | h5 +0.0000 [+0.0000,+0.0000] | ind 0.5743 +0.0000 [+0.0000,+0.0000] +released forward only all=0.6539 dom=0.8039 non=0.5034 h5=0.8177 h20=0.8925 macro=0.7519 | +0.0000 [+0.0000,+0.0000] | h5 +0.0000 [+0.0000,+0.0000] | ind 0.4790 +0.0000 [+0.0000,+0.0000] +p10f1/p20f4 lam=0.0 w=0.75,0.05,0.5 all=0.6928 dom=0.8988 non=0.4859 h5=0.8387 h20=0.9022 macro=0.8122 | -0.0456 [-0.1091,-0.0018] | h5 -0.0030 [-0.0235,+0.0204] | ind 0.5717 -0.0026 [-0.0087,+0.0036] + forward only p10f1/p20f4 lam=0.0 all=0.6108 dom=0.8037 non=0.4172 h5=0.8028 h20=0.8953 macro=0.7445 | -0.0431 [-0.1067,+0.0049] | h5 -0.0149 [-0.0409,+0.0091] | ind 0.4753 -0.0037 [-0.0115,+0.0043] + n=1 [431 pools] 0.7865->0.7726 (+11 -17); n=2-3 [2088 pools] 0.8740->0.8649 (+29 -48); n=4-9 [502 pools] 0.7550->0.7610 (+24 -21); n=10-29 [238 pools] 0.6303->0.6218 (+8 -10); n>=30 [127 pools] 0.6850->0.6378 (+4 -10); domain [2153 pools] 0.9118->0.9076 (+25 -34); mixed [254 pools] 0.7677->0.7480 (+9 -14); other [979 pools] 0.6353->0.6190 (+42 -58) +p10f1/p20f4 lam=0.5 w=0.75,0.05,0.5 all=0.7029 dom=0.9026 non=0.5024 h5=0.8113 h20=0.9049 macro=0.8196 | -0.0355 [-0.0999,+0.0109] | h5 -0.0305 [-0.0895,+0.0077] | ind 0.5832 +0.0089 [+0.0018,+0.0162] + forward only p10f1/p20f4 lam=0.5 all=0.6295 dom=0.8147 non=0.4436 h5=0.8024 h20=0.9046 macro=0.7578 | -0.0244 [-0.0888,+0.0242] | h5 -0.0153 [-0.0838,+0.0358] | ind 0.4864 +0.0074 [-0.0012,+0.0159] + n=1 [431 pools] 0.7865->0.7819 (+14 -16); n=2-3 [2088 pools] 0.8740->0.8726 (+38 -41); n=4-9 [502 pools] 0.7550->0.7610 (+23 -20); n=10-29 [238 pools] 0.6303->0.6303 (+10 -10); n>=30 [127 pools] 0.6850->0.6614 (+6 -9); domain [2153 pools] 0.9118->0.9127 (+31 -29); mixed [254 pools] 0.7677->0.7520 (+9 -13); other [979 pools] 0.6353->0.6323 (+51 -54) +p10f1/p20f4 lam=0.75 w=0.75,0.05,0.5 all=0.7041 dom=0.9033 non=0.5041 h5=0.8150 h20=0.9063 macro=0.8204 | -0.0343 [-0.0985,+0.0118] | h5 -0.0268 [-0.0850,+0.0113] | ind 0.5840 +0.0097 [+0.0019,+0.0173] + forward only p10f1/p20f4 lam=0.75 all=0.6272 dom=0.8126 non=0.4409 h5=0.8035 h20=0.9050 macro=0.7555 | -0.0268 [-0.0901,+0.0232] | h5 -0.0142 [-0.0833,+0.0364] | ind 0.4889 +0.0099 [+0.0012,+0.0187] + n=1 [431 pools] 0.7865->0.7842 (+15 -16); n=2-3 [2088 pools] 0.8740->0.8731 (+40 -42); n=4-9 [502 pools] 0.7550->0.7590 (+24 -22); n=10-29 [238 pools] 0.6303->0.6429 (+14 -11); n>=30 [127 pools] 0.6850->0.6535 (+6 -10); domain [2153 pools] 0.9118->0.9141 (+34 -29); mixed [254 pools] 0.7677->0.7520 (+10 -14); other [979 pools] 0.6353->0.6323 (+55 -58) +p10f1/p20f4 lam=1.0 w=0.75,0.05,0.5 all=0.7037 dom=0.9063 non=0.5003 h5=0.8159 h20=0.8767 macro=0.8201 | -0.0347 [-0.0989,+0.0111] | h5 -0.0259 [-0.0848,+0.0117] | ind 0.5823 +0.0080 [+0.0001,+0.0161] + forward only p10f1/p20f4 lam=1.0 all=0.6280 dom=0.8140 non=0.4413 h5=0.8024 h20=0.8764 macro=0.7546 | -0.0259 [-0.0899,+0.0235] | h5 -0.0153 [-0.0833,+0.0358] | ind 0.4871 +0.0081 [-0.0013,+0.0174] + n=1 [431 pools] 0.7865->0.7842 (+15 -16); n=2-3 [2088 pools] 0.8740->0.8736 (+42 -43); n=4-9 [502 pools] 0.7550->0.7550 (+23 -23); n=10-29 [238 pools] 0.6303->0.6429 (+14 -11); n>=30 [127 pools] 0.6850->0.6535 (+6 -10); domain [2153 pools] 0.9118->0.9150 (+37 -30); mixed [254 pools] 0.7677->0.7520 (+10 -14); other [979 pools] 0.6353->0.6292 (+53 -59) +p10f1 lam=0.0 w=0.75,0.05,0.5 all=0.6928 dom=0.8988 non=0.4859 h5=0.8387 h20=0.9022 macro=0.8122 | -0.0456 [-0.1091,-0.0018] | h5 -0.0030 [-0.0235,+0.0204] | ind 0.5717 -0.0026 [-0.0087,+0.0036] + forward only p10f1 lam=0.0 all=0.6108 dom=0.8037 non=0.4172 h5=0.8028 h20=0.8953 macro=0.7445 | -0.0431 [-0.1067,+0.0049] | h5 -0.0149 [-0.0409,+0.0091] | ind 0.4753 -0.0037 [-0.0115,+0.0043] + n=1 [431 pools] 0.7865->0.7726 (+11 -17); n=2-3 [2088 pools] 0.8740->0.8649 (+29 -48); n=4-9 [502 pools] 0.7550->0.7610 (+24 -21); n=10-29 [238 pools] 0.6303->0.6218 (+8 -10); n>=30 [127 pools] 0.6850->0.6378 (+4 -10); domain [2153 pools] 0.9118->0.9076 (+25 -34); mixed [254 pools] 0.7677->0.7480 (+9 -14); other [979 pools] 0.6353->0.6190 (+42 -58) +p10f1 lam=0.5 w=0.75,0.05,0.5 all=0.7027 dom=0.9021 non=0.5025 h5=0.8104 h20=0.9045 macro=0.8193 | -0.0357 [-0.0996,+0.0108] | h5 -0.0313 [-0.0903,+0.0070] | ind 0.5827 +0.0084 [+0.0010,+0.0156] + forward only p10f1 lam=0.5 all=0.6304 dom=0.8171 non=0.4429 h5=0.8022 h20=0.9040 macro=0.7569 | -0.0235 [-0.0883,+0.0257] | h5 -0.0155 [-0.0843,+0.0354] | ind 0.4862 +0.0073 [-0.0013,+0.0157] + n=1 [431 pools] 0.7865->0.7842 (+14 -15); n=2-3 [2088 pools] 0.8740->0.8712 (+36 -42); n=4-9 [502 pools] 0.7550->0.7629 (+25 -21); n=10-29 [238 pools] 0.6303->0.6303 (+10 -10); n>=30 [127 pools] 0.6850->0.6614 (+6 -9); domain [2153 pools] 0.9118->0.9122 (+30 -29); mixed [254 pools] 0.7677->0.7480 (+9 -14); other [979 pools] 0.6353->0.6333 (+52 -54) +p10f1 lam=0.75 w=0.75,0.05,0.5 all=0.7046 dom=0.9030 non=0.5053 h5=0.8138 h20=0.9057 macro=0.8213 | -0.0338 [-0.0983,+0.0126] | h5 -0.0280 [-0.0860,+0.0102] | ind 0.5841 +0.0098 [+0.0024,+0.0174] + forward only p10f1 lam=0.75 all=0.6285 dom=0.8149 non=0.4414 h5=0.8012 h20=0.9046 macro=0.7555 | -0.0254 [-0.0877,+0.0245] | h5 -0.0165 [-0.0856,+0.0348] | ind 0.4868 +0.0078 [-0.0012,+0.0166] + n=1 [431 pools] 0.7865->0.7889 (+15 -14); n=2-3 [2088 pools] 0.8740->0.8721 (+38 -42); n=4-9 [502 pools] 0.7550->0.7649 (+27 -22); n=10-29 [238 pools] 0.6303->0.6429 (+14 -11); n>=30 [127 pools] 0.6850->0.6535 (+6 -10); domain [2153 pools] 0.9118->0.9136 (+33 -29); mixed [254 pools] 0.7677->0.7520 (+10 -14); other [979 pools] 0.6353->0.6364 (+57 -56) +p10f1 lam=1.0 w=0.75,0.05,0.5 all=0.7020 dom=0.9032 non=0.4999 h5=0.8148 h20=0.8758 macro=0.8201 | -0.0364 [-0.1005,+0.0092] | h5 -0.0270 [-0.0859,+0.0106] | ind 0.5820 +0.0077 [+0.0000,+0.0156] + forward only p10f1 lam=1.0 all=0.6267 dom=0.8118 non=0.4408 h5=0.8016 h20=0.8766 macro=0.7537 | -0.0272 [-0.0907,+0.0217] | h5 -0.0161 [-0.0841,+0.0353] | ind 0.4834 +0.0044 [-0.0046,+0.0137] + n=1 [431 pools] 0.7865->0.7865 (+15 -15); n=2-3 [2088 pools] 0.8740->0.8712 (+38 -44); n=4-9 [502 pools] 0.7550->0.7669 (+27 -21); n=10-29 [238 pools] 0.6303->0.6345 (+13 -12); n>=30 [127 pools] 0.6850->0.6535 (+6 -10); domain [2153 pools] 0.9118->0.9136 (+34 -30); mixed [254 pools] 0.7677->0.7559 (+10 -13); other [979 pools] 0.6353->0.6313 (+55 -59) diff --git a/shared/package-files/ff/ff47e5ce8046b76d95779d76185bd914bfe66393b3dcc69f25353bf0a0e6f856/summary.txt b/shared/package-files/ff/ff47e5ce8046b76d95779d76185bd914bfe66393b3dcc69f25353bf0a0e6f856/summary.txt new file mode 100644 index 0000000000000000000000000000000000000000..de1895e1aafcc9de5b29997539c464b4493a11d0 --- /dev/null +++ b/shared/package-files/ff/ff47e5ce8046b76d95779d76185bd914bfe66393b3dcc69f25353bf0a0e6f856/summary.txt @@ -0,0 +1,48 @@ +evals/B20k-full/report-ind.json + {'hit_rate_at_1': 0.4436, 'hit_rate_at_20': 0.6718, 'hit_rate_at_5': 0.5886} CI 0.4134 0.4733 n 19429 valid 19429 err None + adduct {'[M+H]+': (0.542, 14692), '[M+Na]+': (0.14, 4737)} + instrument_type {'': (0.564, 486), 'Orbitrap': (0.439, 16439), 'QTOF': (0.449, 2504)} + collision_energy {'20-39.999': (0.697, 4088), '40-59.999': (0.687, 1567), '<20': (0.515, 1200), '>=60': (0.67, 3120), 'missing': (0.21, 9454)} + routing_domain {'fallback': (0.213, 9695), 'glacier_released': (0.674, 9734)} +evals/B20k-full/report-agg1.json + {'hit_rate_at_1': 0.6068, 'hit_rate_at_20': 0.8505, 'hit_rate_at_5': 0.7585} CI 0.5674 0.6468 n 19429 valid 19429 err None + adduct {'[M+H]+': (0.677, 14692), '[M+Na]+': (0.389, 4737)} + instrument_type {'': (0.63, 486), 'Orbitrap': (0.607, 16439), 'QTOF': (0.599, 2504)} + collision_energy {'20-39.999': (0.813, 4088), '40-59.999': (0.748, 1567), '<20': (0.69, 1200), '>=60': (0.806, 3120), 'missing': (0.418, 9454)} + routing_domain {'fallback': (0.422, 9695), 'glacier_released': (0.791, 9734)} +all n=19429 hit1_ind=0.446 hit1_agg=0.607 h5_agg=0.759 h20_agg=0.850 npk=15 d_t=0.676 d_min=0.617 ties=0.22 cands=256 +('H', 'ce') n= 9734 hit1_ind=0.674 hit1_agg=0.791 h5_agg=0.932 h20_agg=0.977 npk=19 d_t=0.538 d_min=0.513 ties=0.01 cands=256 +('H', 'ceNA') n= 4958 hit1_ind=0.289 hit1_agg=0.453 h5_agg=0.640 h20_agg=0.768 npk=12 d_t=0.943 d_min=0.807 ties=0.44 cands=256 +('Na', 'ce') n= 241 hit1_ind=0.320 hit1_agg=0.568 h5_agg=0.763 h20_agg=0.859 npk=10 d_t=0.663 d_min=0.600 ties=0.07 cands=256 +('Na', 'ceNA') n= 4496 hit1_ind=0.131 hit1_agg=0.379 h5_agg=0.514 h20_agg=0.667 npk=9 d_t=0.988 d_min=0.827 ties=0.47 cands=256 +('H', 'ce', 'Orbitrap') n= 8211 hit1_ind=0.726 hit1_agg=0.830 h5_agg=0.958 h20_agg=0.988 npk=20 d_t=0.518 d_min=0.498 ties=0.00 cands=256 +('H', 'ce', 'QTOF') n= 1523 hit1_ind=0.391 hit1_agg=0.582 h5_agg=0.793 h20_agg=0.921 npk=18 d_t=0.693 d_min=0.625 ties=0.02 cands=256 +('H', 'ceNA', 'Orbitrap') n= 3987 hit1_ind=0.204 hit1_agg=0.402 h5_agg=0.585 h20_agg=0.724 npk=9 d_t=1.000 d_min=0.884 ties=0.55 cands=256 +('H', 'ceNA', 'QTOF') n= 672 hit1_ind=0.628 hit1_agg=0.661 h5_agg=0.868 h20_agg=0.945 npk=64 d_t=0.630 d_min=0.608 ties=0.01 cands=256 +('H', 'ceNA', 'none') n= 299 hit1_ind=0.662 hit1_agg=0.666 h5_agg=0.863 h20_agg=0.953 npk=111 d_t=0.630 d_min=0.610 ties=0.02 cands=256 +('Na', 'ce', 'Orbitrap') n= 159 hit1_ind=0.333 hit1_agg=0.553 h5_agg=0.774 h20_agg=0.906 npk=10 d_t=0.656 d_min=0.620 ties=0.06 cands=256 +('Na', 'ce', 'QTOF') n= 82 hit1_ind=0.293 hit1_agg=0.598 h5_agg=0.744 h20_agg=0.768 npk=9 d_t=0.697 d_min=0.374 ties=0.09 cands=256 +('Na', 'ceNA', 'Orbitrap') n= 4082 hit1_ind=0.106 hit1_agg=0.362 h5_agg=0.489 h20_agg=0.644 npk=8 d_t=1.000 d_min=0.871 ties=0.51 cands=256 +('Na', 'ceNA', 'QTOF') n= 227 hit1_ind=0.361 hit1_agg=0.533 h5_agg=0.744 h20_agg=0.877 npk=88 d_t=0.625 d_min=0.586 ties=0.03 cands=256 +('Na', 'ceNA', 'none') n= 187 hit1_ind=0.406 hit1_agg=0.572 h5_agg=0.765 h20_agg=0.904 npk=102 d_t=0.657 d_min=0.606 ties=0.01 cands=256 +--- non-domain queries by pool composition +nondomain, pool has domain spectra n= 1272 hit1_ind=0.354 hit1_agg=0.481 h5_agg=0.686 h20_agg=0.947 npk=28 d_t=0.682 d_min=0.616 ties=0.18 cands=256 +nondomain, pool has no domain spectra n= 8423 hit1_ind=0.196 hit1_agg=0.413 h5_agg=0.569 h20_agg=0.689 npk=9 d_t=0.991 d_min=0.845 ties=0.48 cands=256 +--- by number of peaks +npk [1,3) n= 1370 hit1_ind=0.118 hit1_agg=0.356 h5_agg=0.502 h20_agg=0.626 npk=2 d_t=1.000 d_min=0.966 ties=0.69 cands=256 +npk [3,6) n= 2640 hit1_ind=0.246 hit1_agg=0.467 h5_agg=0.624 h20_agg=0.744 npk=4 d_t=0.951 d_min=0.729 ties=0.45 cands=256 +npk [6,11) n= 3655 hit1_ind=0.314 hit1_agg=0.549 h5_agg=0.701 h20_agg=0.808 npk=8 d_t=0.763 d_min=0.657 ties=0.32 cands=256 +npk [11,21) n= 4376 hit1_ind=0.490 hit1_agg=0.642 h5_agg=0.787 h20_agg=0.866 npk=15 d_t=0.627 d_min=0.580 ties=0.17 cands=256 +npk [21,51) n= 4471 hit1_ind=0.622 hit1_agg=0.720 h5_agg=0.863 h20_agg=0.934 npk=31 d_t=0.609 d_min=0.585 ties=0.06 cands=256 +npk [51,1000000) n= 2917 hit1_ind=0.607 hit1_agg=0.697 h5_agg=0.869 h20_agg=0.956 npk=86 d_t=0.630 d_min=0.604 ties=0.02 cands=256 +--- by pool size (queries per pool) +pool_n [1,2) n= 431 hit1_ind=0.684 hit1_agg=0.684 h5_agg=0.852 h20_agg=0.923 npk=41 d_t=0.601 d_min=0.589 ties=0.03 cands=256 +pool_n [2,4) n= 5762 hit1_ind=0.748 hit1_agg=0.818 h5_agg=0.938 h20_agg=0.965 npk=22 d_t=0.517 d_min=0.501 ties=0.01 cands=256 +pool_n [4,8) n= 1969 hit1_ind=0.559 hit1_agg=0.689 h5_agg=0.835 h20_agg=0.915 npk=22 d_t=0.568 d_min=0.535 ties=0.07 cands=256 +pool_n [8,16) n= 2219 hit1_ind=0.475 hit1_agg=0.635 h5_agg=0.804 h20_agg=0.875 npk=17 d_t=0.629 d_min=0.582 ties=0.13 cands=256 +pool_n [16,1000000) n= 9048 hit1_ind=0.210 hit1_agg=0.444 h5_agg=0.612 h20_agg=0.754 npk=9 d_t=0.946 d_min=0.801 ties=0.43 cands=256 +--- by candidates +cands [32,128) n= 36 hit1_ind=0.139 hit1_agg=0.139 h5_agg=0.167 h20_agg=0.167 npk=5 d_t=1.000 d_min=0.980 ties=0.83 cands=90 +cands [128,256) n= 241 hit1_ind=0.261 hit1_agg=0.365 h5_agg=0.519 h20_agg=0.900 npk=20 d_t=0.726 d_min=0.640 ties=0.12 cands=219 +cands [256,257) n=19152 hit1_ind=0.449 hit1_agg=0.611 h5_agg=0.763 h20_agg=0.851 npk=15 d_t=0.674 d_min=0.616 ties=0.22 cands=256 +pool-level hit1_agg (pools weighted equally): 0.7333136444181926 3386 diff --git a/shared/package-files/ff/ff6817ed678c530ff5d013015dd159c2083ce18d1adc5970afc89b318b0af4f8/smoke-meqq___h.log b/shared/package-files/ff/ff6817ed678c530ff5d013015dd159c2083ce18d1adc5970afc89b318b0af4f8/smoke-meqq___h.log new file mode 100644 index 0000000000000000000000000000000000000000..381d9af7601e6781b06a106baf8e6a00b0a49bc6 --- /dev/null +++ b/shared/package-files/ff/ff6817ed678c530ff5d013015dd159c2083ce18d1adc5970afc89b318b0af4f8/smoke-meqq___h.log @@ -0,0 +1,10 @@ +{"event": "loaded", "queries": 180, "pools": 40, "members": 2, "inverse_members": 3, "workers": 12} +{"event": "canonicalized", "unique_candidates": 10240, "unsupported": 76, "seconds": 1.289289340027608} +{"event": "planned", "queries": 180, "groups": 115, "molecules": 11169, "simulations": 29258, "seconds": 1.3182875229977071} +{"event": "inverse_annotated", "pools": 40, "pairs": 9390, "formulae": 1921, "unsupported_candidates": 75, "seconds": 0.8819622920127586} +{"event": "inverse", "scored": 180, "seconds": 2.5002228419762105} +/opt/glacier/lib/python3.11/site-packages/torch/nn/modules/transformer.py:508: UserWarning: The PyTorch API of nested tensors is in prototype stage and will change in the near future. We recommend specifying layout=torch.jagged when constructing a nested tensor, as this layout receives active development, has better operator coverage, and works with torch.compile. (Triggered internally at /pytorch/aten/src/ATen/NestedTensorImpl.cpp:178.) + output = torch._nested_tensor_from_mask( +{"event": "simulated", "finished": 29258, "total": 29258, "failed": 0, "seconds": 45.0078019060893} +{"event": "finished", "queries": 180, "unscored": 0, "directly_scored": 180, "scoring_seconds": 0.486324648023583, "total_seconds": 61.8250099089928} +{"event": "measured", "exit_code": 0, "wall_seconds": 63.4, "user_seconds": 172.2, "system_seconds": 6.7, "max_rss_gib": 2.15} diff --git a/shared/package-files/ff/ff97b1fd354e97ff451ba77ca8f5c5d7610fe383fa092e59ebfbc447c833c148/report-ind.json b/shared/package-files/ff/ff97b1fd354e97ff451ba77ca8f5c5d7610fe383fa092e59ebfbc447c833c148/report-ind.json new file mode 100644 index 0000000000000000000000000000000000000000..a0b9d3e926b747f76f2e5ac729656a2fa39d878b --- /dev/null +++ b/shared/package-files/ff/ff97b1fd354e97ff451ba77ca8f5c5d7610fe383fa092e59ebfbc447c833c148/report-ind.json @@ -0,0 +1,107 @@ +{ + "benchmark_score": { + "at_or_above_upper_reference": false, + "comparable_to_test_reference": false, + "direction": "maximize", + "evaluation_fold": "validation", + "lower_reference": 0.04004329004329004, + "metric": "hit_rate_at_1", + "raw_performance": 0.4573823940381928, + "saturation": null, + "score": 0.9195287788321427, + "unclipped_score": 0.9195287788321427, + "upper_reference": 0.4939052175894281, + "version": "massspecgym-retrieval-score/v1" + }, + "external_reference_context": { + "comparable_to_this_validation_report": false, + "fold": "test", + "hit_rate_at_1": 0.4939052175894281, + "name": "GLACIER no-CF with strict-clean MIST fallback" + }, + "global_error": null, + "metrics": { + "hit_rate_at_1": 0.4573823940381928, + "hit_rate_at_20": 0.6534699580810434, + "hit_rate_at_5": 0.5803446669771775 + }, + "queries": 2147, + "schema": "massspecgym-retrieval-development-report/v1", + "strata": { + "adduct": { + "[M+H]+": { + "hit_rate_at_1": 0.5639324487334137, + "queries": 1658 + }, + "[M+Na]+": { + "hit_rate_at_1": 0.09611451942740286, + "queries": 489 + } + }, + "candidate_pool_size": { + "129-256": { + "hit_rate_at_1": 0.4573823940381928, + "queries": 2147 + } + }, + "collision_energy": { + "20-39.999": { + "hit_rate_at_1": 0.66015625, + "queries": 512 + }, + "40-59.999": { + "hit_rate_at_1": 0.7401129943502824, + "queries": 177 + }, + "<20": { + "hit_rate_at_1": 0.4503311258278146, + "queries": 151 + }, + ">=60": { + "hit_rate_at_1": 0.7528735632183908, + "queries": 348 + }, + "missing": { + "hit_rate_at_1": 0.1908237747653806, + "queries": 959 + } + }, + "instrument_type": { + "": { + "hit_rate_at_1": 0.4857142857142857, + "queries": 35 + }, + "Orbitrap": { + "hit_rate_at_1": 0.46684491978609627, + "queries": 1870 + }, + "QTOF": { + "hit_rate_at_1": 0.38016528925619836, + "queries": 242 + } + }, + "routing_domain": { + "fallback": { + "hit_rate_at_1": 0.1917255297679112, + "queries": 991 + }, + "glacier_released": { + "hit_rate_at_1": 0.6851211072664359, + "queries": 1156 + } + } + }, + "uncertainty": { + "confidence": 0.95, + "estimate": 0.4573823940381928, + "grouping": "supplied target_inchikey connectivity block", + "lower": 0.38552990787156216, + "molecule_groups": 413, + "queries": 2147, + "resamples": 2000, + "seed": 0, + "statistic": "spectrum-weighted mean; molecules sampled with replacement", + "upper": 0.5381582368613729 + }, + "valid_rankings": 2147 +} diff --git a/shared/package-files/ff/ffaa2b41542c4c56bef7b408c15166a1752a1c63fd888c21b1b58a06bcd63386/eval-score-I14+I16.log b/shared/package-files/ff/ffaa2b41542c4c56bef7b408c15166a1752a1c63fd888c21b1b58a06bcd63386/eval-score-I14+I16.log new file mode 100644 index 0000000000000000000000000000000000000000..cc413057373768efdc5d273df9ef3cb62209409d --- /dev/null +++ b/shared/package-files/ff/ffaa2b41542c4c56bef7b408c15166a1752a1c63fd888c21b1b58a06bcd63386/eval-score-I14+I16.log @@ -0,0 +1,41 @@ +19429 queries, 2 members, 70.6 s +cos pool rule all=0.6054 dom=0.8498 non=0.3601 h5=0.7080 macro=0.7271 +cen pool rule all=0.5908 dom=0.8307 non=0.3500 h5=0.7020 macro=0.7053 +cos_pm pool rule all=0.6021 dom=0.8459 non=0.3574 h5=0.7080 macro=0.7256 +dot pool rule all=0.5955 dom=0.8184 non=0.3716 h5=0.7181 macro=0.7103 +geo pool rule all=0.5862 dom=0.8333 non=0.3381 h5=0.6959 macro=0.7123 +idf05 pool rule all=0.6075 dom=0.8495 non=0.3645 h5=0.7178 macro=0.7280 +idf1 pool rule all=0.6088 dom=0.8493 non=0.3673 h5=0.7253 macro=0.7277 +lin pool rule all=0.5680 dom=0.8039 non=0.3312 h5=0.6866 macro=0.6872 +log01 pool rule all=0.6052 dom=0.8401 non=0.3693 h5=0.7359 macro=0.7215 +log05 pool rule all=0.6144 dom=0.8519 non=0.3761 h5=0.7367 macro=0.7363 +log20 pool rule all=0.6151 dom=0.8519 non=0.3774 h5=0.7276 macro=0.7357 +nll02 pool rule all=0.4625 dom=0.7408 non=0.1831 h5=0.5897 macro=0.6069 +nll10 pool rule all=0.4290 dom=0.6911 non=0.1660 h5=0.5581 macro=0.5588 +poolcen pool rule all=0.5952 dom=0.8272 non=0.3622 h5=0.7172 macro=0.7067 +pow020 pool rule all=0.5618 dom=0.7873 non=0.3354 h5=0.7174 macro=0.6831 +pow030 pool rule all=0.5863 dom=0.8090 non=0.3627 h5=0.7217 macro=0.7029 +pow040 pool rule all=0.5984 dom=0.8347 non=0.3611 h5=0.7311 macro=0.7185 +pow05 pool rule all=0.6065 dom=0.8425 non=0.3696 h5=0.7296 macro=0.7277 +pow05idf025 pool rule all=0.6133 dom=0.8470 non=0.3785 h5=0.7287 macro=0.7304 +pow05idf05 pool rule all=0.6146 dom=0.8467 non=0.3816 h5=0.7345 macro=0.7310 +pow05m pool rule all=0.6134 dom=0.8461 non=0.3798 h5=0.7259 macro=0.7298 +pow05s pool rule all=0.6080 dom=0.8473 non=0.3677 h5=0.7190 macro=0.7286 +pow060 pool rule all=0.6099 dom=0.8501 non=0.3686 h5=0.7273 macro=0.7333 +pow060idf025 pool rule all=0.6146 dom=0.8517 non=0.3767 h5=0.7276 macro=0.7336 +pow060idf050 pool rule all=0.6149 dom=0.8493 non=0.3796 h5=0.7304 macro=0.7327 +pow060m pool rule all=0.6145 dom=0.8507 non=0.3774 h5=0.7244 macro=0.7345 +pow065 pool rule all=0.6130 dom=0.8509 non=0.3741 h5=0.7280 macro=0.7345 +pow070 pool rule all=0.6110 dom=0.8504 non=0.3706 h5=0.7203 macro=0.7336 +pow070idf025 pool rule all=0.6134 dom=0.8526 non=0.3732 h5=0.7290 macro=0.7330 +pow070idf050 pool rule all=0.6137 dom=0.8529 non=0.3735 h5=0.7284 macro=0.7351 +pow070m pool rule all=0.6123 dom=0.8509 non=0.3727 h5=0.7165 macro=0.7342 +pow075 pool rule all=0.6101 dom=0.8507 non=0.3685 h5=0.7195 macro=0.7315 +pow080 pool rule all=0.6098 dom=0.8505 non=0.3680 h5=0.7180 macro=0.7315 +pow080m pool rule all=0.6117 dom=0.8517 non=0.3707 h5=0.7162 macro=0.7321 +pow085 pool rule all=0.6088 dom=0.8497 non=0.3669 h5=0.7155 macro=0.7295 +pow085idf025 pool rule all=0.6127 dom=0.8533 non=0.3711 h5=0.7178 macro=0.7324 +pow085idf050 pool rule all=0.6110 dom=0.8507 non=0.3704 h5=0.7235 macro=0.7315 +pow090 pool rule all=0.6090 dom=0.8506 non=0.3664 h5=0.7141 macro=0.7301 +pow2 pool rule all=0.5753 dom=0.8147 non=0.3349 h5=0.6921 macro=0.7008 +tani pool rule all=0.5817 dom=0.8171 non=0.3452 h5=0.7124 macro=0.7061 diff --git a/shared/package-files/ff/ffc925382cff374e3bcd3d2d029cb5f7a0037f776195e415da4a20284ddb755b/fp-families-meqq.log b/shared/package-files/ff/ffc925382cff374e3bcd3d2d029cb5f7a0037f776195e415da4a20284ddb755b/fp-families-meqq.log new file mode 100644 index 0000000000000000000000000000000000000000..6e8a8f31a068d5d325a6e27323b05821786d2656 --- /dev/null +++ b/shared/package-files/ff/ffc925382cff374e3bcd3d2d029cb5f7a0037f776195e415da4a20284ddb755b/fp-families-meqq.log @@ -0,0 +1,41 @@ +missed pools 606 (5083 queries); same formula 346 pools / 2505 queries; first spectrum in domain 229 pools +--- all missed pools: 606 pools, 5083 queries (pool-weighted statistics) + morgan2 ms/mol 0.086 bits 64.4 | Tanimoto(label, wrong top-1) mean 0.360 median 0.178 | identical 0.002 | >0.8 0.158 | <0.5 0.644 | corr with morgan2 1.00 + morgan3 ms/mol 0.089 bits 90.7 | Tanimoto(label, wrong top-1) mean 0.305 median 0.132 | identical 0.000 | >0.8 0.069 | <0.5 0.701 | corr with morgan2 0.99 + morgan1 ms/mol 0.048 bits 37.0 | Tanimoto(label, wrong top-1) mean 0.449 median 0.294 | identical 0.061 | >0.8 0.249 | <0.5 0.604 | corr with morgan2 0.99 + fmorgan2 ms/mol 0.203 bits 45.1 | Tanimoto(label, wrong top-1) mean 0.418 median 0.245 | identical 0.010 | >0.8 0.208 | <0.5 0.607 | corr with morgan2 0.98 + atompair ms/mol 0.296 bits 576.7 | Tanimoto(label, wrong top-1) mean 0.485 median 0.379 | identical 0.000 | >0.8 0.195 | <0.5 0.566 | corr with morgan2 0.93 + torsion ms/mol 0.199 bits 79.7 | Tanimoto(label, wrong top-1) mean 0.378 median 0.196 | identical 0.012 | >0.8 0.190 | <0.5 0.620 | corr with morgan2 0.98 + rdkit5 ms/mol 0.663 bits 350.4 | Tanimoto(label, wrong top-1) mean 0.488 median 0.332 | identical 0.056 | >0.8 0.335 | <0.5 0.563 | corr with morgan2 0.93 + rdkit7 ms/mol 2.661 bits 1186.3 | Tanimoto(label, wrong top-1) mean 0.484 median 0.302 | identical 0.007 | >0.8 0.304 | <0.5 0.584 | corr with morgan2 0.95 + maccs ms/mol 1.454 bits 51.2 | Tanimoto(label, wrong top-1) mean 0.669 median 0.640 | identical 0.160 | >0.8 0.419 | <0.5 0.333 | corr with morgan2 0.88 +--- same-formula misses: 346 pools, 2505 queries (pool-weighted statistics) + morgan2 ms/mol 0.086 bits 65.7 | Tanimoto(label, wrong top-1) mean 0.557 median 0.620 | identical 0.003 | >0.8 0.277 | <0.5 0.379 | corr with morgan2 1.00 + morgan3 ms/mol 0.089 bits 93.0 | Tanimoto(label, wrong top-1) mean 0.478 median 0.520 | identical 0.000 | >0.8 0.121 | <0.5 0.477 | corr with morgan2 0.99 + morgan1 ms/mol 0.048 bits 37.5 | Tanimoto(label, wrong top-1) mean 0.667 median 0.762 | identical 0.107 | >0.8 0.436 | <0.5 0.309 | corr with morgan2 0.98 + fmorgan2 ms/mol 0.203 bits 45.1 | Tanimoto(label, wrong top-1) mean 0.625 median 0.715 | identical 0.017 | >0.8 0.364 | <0.5 0.315 | corr with morgan2 0.96 + atompair ms/mol 0.296 bits 596.3 | Tanimoto(label, wrong top-1) mean 0.666 median 0.739 | identical 0.000 | >0.8 0.341 | <0.5 0.246 | corr with morgan2 0.87 + torsion ms/mol 0.199 bits 82.7 | Tanimoto(label, wrong top-1) mean 0.598 median 0.682 | identical 0.020 | >0.8 0.332 | <0.5 0.338 | corr with morgan2 0.97 + rdkit5 ms/mol 0.663 bits 321.4 | Tanimoto(label, wrong top-1) mean 0.736 median 0.881 | identical 0.098 | >0.8 0.587 | <0.5 0.234 | corr with morgan2 0.88 + rdkit7 ms/mol 2.661 bits 1109.7 | Tanimoto(label, wrong top-1) mean 0.701 median 0.834 | identical 0.012 | >0.8 0.532 | <0.5 0.275 | corr with morgan2 0.91 + maccs ms/mol 1.454 bits 51.4 | Tanimoto(label, wrong top-1) mean 0.869 median 0.949 | identical 0.280 | >0.8 0.734 | <0.5 0.032 | corr with morgan2 0.83 +--- same-formula misses, domain: 140 pools, 878 queries (pool-weighted statistics) + morgan2 ms/mol 0.086 bits 61.3 | Tanimoto(label, wrong top-1) mean 0.541 median 0.591 | identical 0.007 | >0.8 0.250 | <0.5 0.400 | corr with morgan2 1.00 + morgan3 ms/mol 0.089 bits 86.9 | Tanimoto(label, wrong top-1) mean 0.459 median 0.480 | identical 0.000 | >0.8 0.107 | <0.5 0.507 | corr with morgan2 0.99 + morgan1 ms/mol 0.048 bits 34.8 | Tanimoto(label, wrong top-1) mean 0.661 median 0.768 | identical 0.107 | >0.8 0.421 | <0.5 0.336 | corr with morgan2 0.98 + fmorgan2 ms/mol 0.203 bits 43.9 | Tanimoto(label, wrong top-1) mean 0.608 median 0.689 | identical 0.021 | >0.8 0.364 | <0.5 0.357 | corr with morgan2 0.97 + atompair ms/mol 0.296 bits 519.3 | Tanimoto(label, wrong top-1) mean 0.645 median 0.702 | identical 0.000 | >0.8 0.264 | <0.5 0.279 | corr with morgan2 0.86 + torsion ms/mol 0.199 bits 75.9 | Tanimoto(label, wrong top-1) mean 0.584 median 0.664 | identical 0.029 | >0.8 0.271 | <0.5 0.357 | corr with morgan2 0.97 + rdkit5 ms/mol 0.663 bits 334.1 | Tanimoto(label, wrong top-1) mean 0.689 median 0.814 | identical 0.114 | >0.8 0.514 | <0.5 0.307 | corr with morgan2 0.91 + rdkit7 ms/mol 2.661 bits 1089.7 | Tanimoto(label, wrong top-1) mean 0.656 median 0.750 | identical 0.007 | >0.8 0.450 | <0.5 0.329 | corr with morgan2 0.92 + maccs ms/mol 1.454 bits 51.3 | Tanimoto(label, wrong top-1) mean 0.864 median 0.947 | identical 0.243 | >0.8 0.700 | <0.5 0.014 | corr with morgan2 0.84 +--- other-formula misses: 260 pools, 2578 queries (pool-weighted statistics) + morgan2 ms/mol 0.086 bits 62.7 | Tanimoto(label, wrong top-1) mean 0.098 median 0.092 | identical 0.000 | >0.8 0.000 | <0.5 0.996 | corr with morgan2 1.00 + morgan3 ms/mol 0.089 bits 87.7 | Tanimoto(label, wrong top-1) mean 0.075 median 0.069 | identical 0.000 | >0.8 0.000 | <0.5 1.000 | corr with morgan2 0.98 + morgan1 ms/mol 0.048 bits 36.4 | Tanimoto(label, wrong top-1) mean 0.159 median 0.155 | identical 0.000 | >0.8 0.000 | <0.5 0.996 | corr with morgan2 0.95 + fmorgan2 ms/mol 0.203 bits 45.1 | Tanimoto(label, wrong top-1) mean 0.143 median 0.137 | identical 0.000 | >0.8 0.000 | <0.5 0.996 | corr with morgan2 0.70 + atompair ms/mol 0.296 bits 550.7 | Tanimoto(label, wrong top-1) mean 0.245 median 0.243 | identical 0.000 | >0.8 0.000 | <0.5 0.992 | corr with morgan2 0.60 + torsion ms/mol 0.199 bits 75.8 | Tanimoto(label, wrong top-1) mean 0.085 median 0.070 | identical 0.000 | >0.8 0.000 | <0.5 0.996 | corr with morgan2 0.69 + rdkit5 ms/mol 0.663 bits 389.0 | Tanimoto(label, wrong top-1) mean 0.159 median 0.136 | identical 0.000 | >0.8 0.000 | <0.5 1.000 | corr with morgan2 0.39 + rdkit7 ms/mol 2.661 bits 1288.2 | Tanimoto(label, wrong top-1) mean 0.194 median 0.187 | identical 0.000 | >0.8 0.000 | <0.5 0.996 | corr with morgan2 0.46 + maccs ms/mol 1.454 bits 50.9 | Tanimoto(label, wrong top-1) mean 0.402 median 0.406 | identical 0.000 | >0.8 0.000 | <0.5 0.735 | corr with morgan2 0.51 diff --git a/shared/package-files/ff/fff8b794c150637e8fc808c9b4f11bc03d4e72f271c623580eed75dd6bb9d918/v7.json b/shared/package-files/ff/fff8b794c150637e8fc808c9b4f11bc03d4e72f271c623580eed75dd6bb9d918/v7.json new file mode 100644 index 0000000000000000000000000000000000000000..66dffb0a940d49a0e33e5e3ffc5112dd52a25ccb --- /dev/null +++ b/shared/package-files/ff/fff8b794c150637e8fc808c9b4f11bc03d4e72f271c623580eed75dd6bb9d918/v7.json @@ -0,0 +1,3 @@ +{ + "noprec_pp0.75": {"drop_precursor": true, "pred_power": 0.75} +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/inference-manifest.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/inference-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..c06ea75a69301dbb06ea9c2c79c76c470b7fd4ac --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/inference-manifest.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "phase": "inference", + "recorded_utc": "2026-11-11T22:36:55.178973+00:00", + "slurm_job_id": null, + "slurm_partition": null, + "python_hash_seed": "0", + "fingerprints": { + "model": { + "encoder.pt": "0a2a0774238edad52f218f4878bb6b557c97c6b02b70aa81cf10144c845e0a44", + "config.json": "b3ed41322df55fcc2314a868bd160ec6e98b451caf2851e36f788d3b00966ddd", + "infer.py": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "provenance.json": "8141a3713cba2ece45d49c32ec17cccc841f153d3802dfae67655ab46c2ccb02", + "LICENSE-OlmoEarth": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + }, + "unlabeled_inputs": { + "awf": "bfd3d2e706b28e8f187f65ecba98cc57beae7f99bbcf77dcb896ca06feec01b7", + "lfmc": "4dcbe1f1c46659f1a47a5c1303cbd7b22953fc8d514ed6f4e80745fb1510f98a" + }, + "features": { + "awf": "708be4d5db2758b34a568d1754772c97734bb83e8ee60c83a4ad63188914b006", + "lfmc": "090b8311fba4226b44dc2ef095c696e065b496421a65ff28c2a7b20c8e63cd2a" + }, + "verifier": { + "grade.py": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d", + "replay.py": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2", + "namespace.py": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + }, + "probes": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2", + "package_contract": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + }, + "labels_read": false, + "adapted_isolation": "Beaker container + UID + Landlock + seccomp", + "adapter_sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0", + "sandbox_sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/report.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/report.json new file mode 100644 index 0000000000000000000000000000000000000000..5cc874da449cd496723b5d2fc1cb8df51b284e48 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/report.json @@ -0,0 +1,12 @@ +{ + "reward": 0.4122743011767425, + "awf_validation_accuracy": 0.6366279069767442, + "lfmc_test_mae": 19.843304266820258, + "lfmc_test_mae_skill": 0.18792069537674083, + "status": "scored", + "inference_manifest_sha256": "07b91d1a0f64e3087c080f4e20e4cb923c688d3b2a826131c771e6b663d4d4d1", + "label_file_sha256": { + "awf": "c7246b83e94c96ac171c81e963d118a9649dfa06f5313e4f39cafe300a6b28e4", + "lfmc": "9f883ce648b25736f98217593f42a2a9169a6cb6d47473ab2ba4679749040c9c" + } +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/reward.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/reward.json new file mode 100644 index 0000000000000000000000000000000000000000..4765455a8de5f6a87771dc55274c0e5dfc7e402c --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/reward.json @@ -0,0 +1,6 @@ +{ + "reward": 0.4122743011767425, + "awf_validation_accuracy": 0.6366279069767442, + "lfmc_test_mae": 19.843304266820258, + "lfmc_test_mae_skill": 0.18792069537674083 +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/inference-manifest.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/inference-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..27d63bc56b58d3f78b2c37e9c01d47415c03158a --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/inference-manifest.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "phase": "inference", + "recorded_utc": "2026-11-11T22:56:23.805179+00:00", + "slurm_job_id": null, + "slurm_partition": null, + "python_hash_seed": "0", + "fingerprints": { + "model": { + "encoder.pt": "c11119660a7ded1e02651bbac9a7b6803bbdbbeef4e0af5649b1d37ba34f2987", + "config.json": "59cb8deb04380941babfc46a0202319557779ebc98f78407dcfb38fab483ddbc", + "infer.py": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "provenance.json": "6e9726aa4eb31cead1e395ef55f4c9192887fe57e6c3f4d7834d173127ca0106", + "LICENSE-OlmoEarth": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + }, + "unlabeled_inputs": { + "awf": "bfd3d2e706b28e8f187f65ecba98cc57beae7f99bbcf77dcb896ca06feec01b7", + "lfmc": "4dcbe1f1c46659f1a47a5c1303cbd7b22953fc8d514ed6f4e80745fb1510f98a" + }, + "features": { + "awf": "0a4c3aaa8111701d60e5e7a6abfac6149552bc2a539f19701f34acf34b865688", + "lfmc": "e450d0031ab09b048706e6ec790a8a7e4592bf333192ab793566438a620016eb" + }, + "verifier": { + "grade.py": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d", + "replay.py": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2", + "namespace.py": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + }, + "probes": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2", + "package_contract": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + }, + "labels_read": false, + "adapted_isolation": "Beaker container + UID + Landlock + seccomp", + "adapter_sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0", + "sandbox_sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/report.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/report.json new file mode 100644 index 0000000000000000000000000000000000000000..6521a35233e8faae11402962703de04c12426d74 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/report.json @@ -0,0 +1,12 @@ +{ + "reward": 0.49816753644955425, + "awf_validation_accuracy": 0.7645348837209303, + "lfmc_test_mae": 18.771100922123622, + "lfmc_test_mae_skill": 0.23180018917817824, + "status": "scored", + "inference_manifest_sha256": "a40af6fddc09fc638134cc2b75c985f2a5b4bebc53f24e29a55812f11c0e6984", + "label_file_sha256": { + "awf": "c7246b83e94c96ac171c81e963d118a9649dfa06f5313e4f39cafe300a6b28e4", + "lfmc": "9f883ce648b25736f98217593f42a2a9169a6cb6d47473ab2ba4679749040c9c" + } +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/reward.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/reward.json new file mode 100644 index 0000000000000000000000000000000000000000..729e0e2ef636182bf4c3b0a4c141b56fd4f68447 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/reward.json @@ -0,0 +1,6 @@ +{ + "reward": 0.49816753644955425, + "awf_validation_accuracy": 0.7645348837209303, + "lfmc_test_mae": 18.771100922123622, + "lfmc_test_mae_skill": 0.23180018917817824 +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/inference-manifest.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/inference-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..2b19ded707ce2d2c6e64f18ef2f5578caa9e2352 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/inference-manifest.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "phase": "inference", + "recorded_utc": "2026-11-11T23:14:41.212705+00:00", + "slurm_job_id": null, + "slurm_partition": null, + "python_hash_seed": "0", + "fingerprints": { + "model": { + "encoder.pt": "28fb2ee96ba6d432a29103db18f9669418d6fddf4148dd1448525fb2588fb2ab", + "config.json": "59cb8deb04380941babfc46a0202319557779ebc98f78407dcfb38fab483ddbc", + "infer.py": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "provenance.json": "876e706cbf5eb4a9d3564ec109b3874c5ed9386d2cbf32ad141acd1279e6b000", + "LICENSE-OlmoEarth": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + }, + "unlabeled_inputs": { + "awf": "bfd3d2e706b28e8f187f65ecba98cc57beae7f99bbcf77dcb896ca06feec01b7", + "lfmc": "4dcbe1f1c46659f1a47a5c1303cbd7b22953fc8d514ed6f4e80745fb1510f98a" + }, + "features": { + "awf": "bafb30f668a3d5dca2525cf02921fcb125c89eb6fa705da22976e055f1b4973c", + "lfmc": "184246baa76caef236586f5722df30143414479003ee031e277b192a5286d0fd" + }, + "verifier": { + "grade.py": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d", + "replay.py": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2", + "namespace.py": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + }, + "probes": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2", + "package_contract": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + }, + "labels_read": false, + "adapted_isolation": "Beaker container + UID + Landlock + seccomp", + "adapter_sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0", + "sandbox_sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/report.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/report.json new file mode 100644 index 0000000000000000000000000000000000000000..0aba34518c09afe81a6abd93ce43f0cfd5f4a796 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/report.json @@ -0,0 +1,12 @@ +{ + "reward": 0.5166325548558109, + "awf_validation_accuracy": 0.8023255813953488, + "lfmc_test_mae": 18.7921313255043, + "lfmc_test_mae_skill": 0.23093952831627307, + "status": "scored", + "inference_manifest_sha256": "e9a795d3e1bc62aa068843dbaf4e50c5a22f10ce6ff4ecc094d9f15bcf1567e1", + "label_file_sha256": { + "awf": "c7246b83e94c96ac171c81e963d118a9649dfa06f5313e4f39cafe300a6b28e4", + "lfmc": "9f883ce648b25736f98217593f42a2a9169a6cb6d47473ab2ba4679749040c9c" + } +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/reward.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/reward.json new file mode 100644 index 0000000000000000000000000000000000000000..dbb7b306cd3af0bfe1b6fcf6a0e6afad1a8f56c6 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/reward.json @@ -0,0 +1,6 @@ +{ + "reward": 0.5166325548558109, + "awf_validation_accuracy": 0.8023255813953488, + "lfmc_test_mae": 18.7921313255043, + "lfmc_test_mae_skill": 0.23093952831627307 +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/inference-manifest.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/inference-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..b67e1b2d22e029c368011fd7e6dbac62fa5fab3f --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/inference-manifest.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "phase": "inference", + "recorded_utc": "2026-11-11T23:45:28.895657+00:00", + "slurm_job_id": null, + "slurm_partition": null, + "python_hash_seed": "0", + "fingerprints": { + "model": { + "encoder.pt": "bc3e19e0ca03d5b19044b3293cfa986da4d91ca439ee352275da1a02d704d14d", + "config.json": "14ca568126832cf80a45bbe4e18b523111f015bdc4b52711101ba42c20f2cbf7", + "infer.py": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "provenance.json": "e52c0a4bcb372ab3d830eaf3466745851d0c6f8965c3a688c2978a7158a3e461", + "LICENSE-OlmoEarth": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + }, + "unlabeled_inputs": { + "awf": "bfd3d2e706b28e8f187f65ecba98cc57beae7f99bbcf77dcb896ca06feec01b7", + "lfmc": "4dcbe1f1c46659f1a47a5c1303cbd7b22953fc8d514ed6f4e80745fb1510f98a" + }, + "features": { + "awf": "0bd88e944b3d7b6f5e49f0ed926b57ab8642f68ebf724a81520b8b38d09a9c8f", + "lfmc": "5a68455a7960e036e4d59b32bbae014c75845aa72883079fc4f154cbcdf3eee5" + }, + "verifier": { + "grade.py": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d", + "replay.py": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2", + "namespace.py": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + }, + "probes": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2", + "package_contract": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + }, + "labels_read": false, + "adapted_isolation": "Beaker container + UID + Landlock + seccomp", + "adapter_sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0", + "sandbox_sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/report.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/report.json new file mode 100644 index 0000000000000000000000000000000000000000..ffa382c063846bef1a10beb14c019d5446ac0cf1 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/report.json @@ -0,0 +1,12 @@ +{ + "reward": 0.5262490899231105, + "awf_validation_accuracy": 0.813953488372093, + "lfmc_test_mae": 18.606297792152365, + "lfmc_test_mae_skill": 0.23854469147412782, + "status": "scored", + "inference_manifest_sha256": "bed1a63fe8103b80d67ab3361d5b22439b8873e7221fd1398236ae2596b44d69", + "label_file_sha256": { + "awf": "c7246b83e94c96ac171c81e963d118a9649dfa06f5313e4f39cafe300a6b28e4", + "lfmc": "9f883ce648b25736f98217593f42a2a9169a6cb6d47473ab2ba4679749040c9c" + } +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/reward.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/reward.json new file mode 100644 index 0000000000000000000000000000000000000000..6e6fe8e5e3b56e44adf20c7ffdca44b036830c2c --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/reward.json @@ -0,0 +1,6 @@ +{ + "reward": 0.5262490899231105, + "awf_validation_accuracy": 0.813953488372093, + "lfmc_test_mae": 18.606297792152365, + "lfmc_test_mae_skill": 0.23854469147412782 +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/inference-manifest.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/inference-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..93c68e9cd55eef6f4e604c99a0c9edd918638d3c --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/inference-manifest.json @@ -0,0 +1,36 @@ +{ + "schema_version": 1, + "phase": "inference", + "recorded_utc": "2026-11-11T21:59:08.721474+00:00", + "slurm_job_id": null, + "slurm_partition": null, + "python_hash_seed": "0", + "fingerprints": { + "model": { + "encoder.pt": "53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d", + "config.json": "14ca568126832cf80a45bbe4e18b523111f015bdc4b52711101ba42c20f2cbf7", + "infer.py": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "provenance.json": "f65c65d09e202a3ad0bd35e10607a706a7a80a5444814b99a52d0138dabe00a6", + "LICENSE-OlmoEarth": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + }, + "unlabeled_inputs": { + "awf": "bfd3d2e706b28e8f187f65ecba98cc57beae7f99bbcf77dcb896ca06feec01b7", + "lfmc": "4dcbe1f1c46659f1a47a5c1303cbd7b22953fc8d514ed6f4e80745fb1510f98a" + }, + "features": { + "awf": "428915deea76938c6af9001158b00108fa55a9c87c9f04daa02361319abc0181", + "lfmc": "25f644cdfc5449f259bef27953b95533e6abcc4b169203bfaf4f078b8317dffd" + }, + "verifier": { + "grade.py": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d", + "replay.py": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2", + "namespace.py": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + }, + "probes": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2", + "package_contract": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + }, + "labels_read": false, + "adapted_isolation": "Beaker container + UID + Landlock + seccomp", + "adapter_sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0", + "sandbox_sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/report.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/report.json new file mode 100644 index 0000000000000000000000000000000000000000..6cd3068bd101954a76ea8cc8f53b866b4ef848ca --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/report.json @@ -0,0 +1,12 @@ +{ + "reward": 0.5184256527376616, + "awf_validation_accuracy": 0.8284883720930233, + "lfmc_test_mae": 19.343794494400615, + "lfmc_test_mae_skill": 0.20836293338229983, + "status": "scored", + "inference_manifest_sha256": "69a9503ca5fc7ba6cd339de0965c1cc3c925c82e97d59a1e915e5da8aa74293a", + "label_file_sha256": { + "awf": "c7246b83e94c96ac171c81e963d118a9649dfa06f5313e4f39cafe300a6b28e4", + "lfmc": "9f883ce648b25736f98217593f42a2a9169a6cb6d47473ab2ba4679749040c9c" + } +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/reward.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/reward.json new file mode 100644 index 0000000000000000000000000000000000000000..407fadbc8cdbe3fafaf154b47f67fa7ec05096f1 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/reward.json @@ -0,0 +1,6 @@ +{ + "reward": 0.5184256527376616, + "awf_validation_accuracy": 0.8284883720930233, + "lfmc_test_mae": 19.343794494400615, + "lfmc_test_mae_skill": 0.20836293338229983 +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/codex.stderr b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/codex.stderr new file mode 100644 index 0000000000000000000000000000000000000000..bf0334f998f924ebe8de60c292a936a6c8addec7 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/codex.stderr @@ -0,0 +1 @@ +[claude-code:unrecognized_model] {"model":"claude-fable-5-2","query_source":"sdk"} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/prompt.txt b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/prompt.txt new file mode 100644 index 0000000000000000000000000000000000000000..5d9609786c391bbfd142561f5ecd00d7863b8d3a --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/prompt.txt @@ -0,0 +1,10 @@ +It is now time to submit. Stop exploring the problem. Submit your best solution without further experiments. You will be given an additional 5 minutes starting now to submit. +The 48-hour research budget is over. This is a separate, hard-limited submission-only window. +Use only code, weights, observations, and development results you already produced. +Do not train, run inference/evaluations/simulations, search hyperparameters, or conduct any new experiment. +Choose using only your existing research notes and results; no sealed evaluation results are available. +Publish a complete portable package to /workspace/submission using the original task contract. +The original research tree is now read-only. Use /workspace/finalization or /tmp for packaging scratch; +/workspace/submission and its local parent support atomic publication. File listing, copying, +archiving, and static checks needed for packaging are allowed. Do not alter the scientific method. +The previous container's processes have ended. Finish and stop after publishing. Do not inspect credentials. diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/publication-review.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/publication-review.json new file mode 100644 index 0000000000000000000000000000000000000000..dae142c904245c3ac9369c4c794c3f69535a555b --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/publication-review.json @@ -0,0 +1,53 @@ +{ + "reviewed_utc": "2026-11-12T13:39:54.439032+00:00", + "task": "earth-observation-pretraining-transfer", + "research_run": "earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b", + "agent": "claude-code", + "result_label": "48h-plus-5m-submission-only", + "accepted_as_48h_result": false, + "thread_id": "8ed4bd89-09a1-4482-ac6e-eec82bef878b", + "same_original_thread": true, + "all_new_tool_calls_reviewed": true, + "publication_seconds": 22.896973808994517, + "research_seconds": 172800, + "model_spend_usd": 0.947925, + "no_new_experiments": true, + "no_new_experiments_basis": "passed: both tool calls reviewed. Call 1 lists the package, hashes encoder.pt and infer.py and compares each package file with the staged copy. Call 2 runs the task's package-contract validator on the package (structure and provenance fields) and prints two provenance values. No pretraining, probing, inference over data or evaluation ran. The package is byte-identical to the 48 h cutoff snapshot.", + "tool_calls": [ + { + "tool_use_id": "toolu_013deHqr2fwCvqhAgPNEH7ym", + "tool": "Bash", + "input": { + "command": "date -u; ls -la /workspace/submission/; sha256sum /workspace/submission/encoder.pt /workspace/submission/infer.py /workspace/baseline/starter/infer.py 2>&1 | cut -c1-110; for f in LICENSE-OlmoEarth config.json encoder.pt infer.py provenance.json; do cmp /workspace/submission/$f /workspace/research/validation/packages/E6-step2500/$f && echo \"same $f\"; done; ls /workspace/submission | wc -l", + "description": "Static integrity check of the live submission against the staged package" + } + }, + { + "tool_use_id": "toolu_016rGccKMQ8DJJxdEuaxJcNC", + "tool": "Bash", + "input": { + "command": "cd /workspace/evaluation && timeout 60 python -I -c \"\nimport sys; sys.path.insert(0,'/workspace/evaluation')\nimport package_contract as pc, json\nprint(pc.validate_package('/workspace/submission'))\np=json.load(open('/workspace/submission/provenance.json'))\nprint(p.get('origin'), p.get('training_validity'))\n\" 2>&1 | grep -v -i \"warn\\|^$\" | tail -n 5; date -u", + "description": "Static contract validation of the submission package" + } + } + ], + "submission_sha256": "fc39dd7e9cbcda09fcb986beaeb0c1d09f8f1de723619e7e31f4661e2d4fcf21", + "cutoff_package_sha256": "fc39dd7e9cbcda09fcb986beaeb0c1d09f8f1de723619e7e31f4661e2d4fcf21", + "package_changed": false, + "package_diff": { + "added": [], + "removed": [], + "changed": [] + }, + "inference_identity_unchanged": true, + "inference_key": null, + "equivalent_snapshot": "S005", + "same_inference_candidate_as": "S005", + "evaluation_decision": "reuse_existing_score", + "additional_evaluation_required": false, + "evaluation_root": "/weka/oe-adapt-default/stevenc/science-speedrun-runs/earth-observation-pretraining-transfer-fable52-native-eval-s005-20261111a", + "score_status_at_review": "S005 complete; score 0.5184256527376616", + "original_48h_history_unchanged": true, + "original_results_preserved": true, + "trajectory_sha256": "65976236d69a201afc6ae3e7b91718db44e96d7ea5a2427690cdc1e1e98f8878" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/status.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/status.json new file mode 100644 index 0000000000000000000000000000000000000000..4ac02c4f8d1290e512e146339ec6c9fd769d19e8 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/status.json @@ -0,0 +1,19 @@ +{ + "phase": "complete", + "error": null, + "elapsed_seconds": 22.896973808994517, + "total_publication_seconds": 22.896973808994517, + "thread_id": "8ed4bd89-09a1-4482-ac6e-eec82bef878b", + "turn_completed": true, + "submission_sha256": "fc39dd7e9cbcda09fcb986beaeb0c1d09f8f1de723619e7e31f4661e2d4fcf21", + "cutoff_submission_sha256": "fc39dd7e9cbcda09fcb986beaeb0c1d09f8f1de723619e7e31f4661e2d4fcf21", + "package_changed": false, + "result_label": "48h-plus-5m-submission-only", + "accepted_as_48h_result": false, + "no_experiments_review": "passed", + "original_results_preserved": true, + "model_spend_usd": 0.947925, + "publication_review": "/weka/oe-adapt-default/stevenc/science-speedrun-runs/earth-observation-pretraining-transfer-fable52-finalize-5m-20261112a/publication-review.json", + "additional_evaluation_required": false, + "same_inference_candidate_as": "S005" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/LICENSE-OlmoEarth b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/LICENSE-OlmoEarth new file mode 100644 index 0000000000000000000000000000000000000000..f764333f593fbb8103a98875d9eb17b534614eb0 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/LICENSE-OlmoEarth @@ -0,0 +1,127 @@ +OlmoEarth Artifact License + +By exercising the rights granted to you under this OlmoEarth Artifact License +("Agreement"), you accept and agree to its terms and conditions and enter into this +Agreement with The Allen Institute for Artificial Intelligence ("Ai2"). All references +to "you" herein means both an individual and legal entity that an individual is acting +on behalf of. + +Subject to your compliance with this Agreement, Ai2 grants you permission, free of +charge, to use the machine learning artifacts, materials, and documentation provided by +Ai2 under this Agreement as follows (collectively, "Artifacts"): + +- Model weights, including architecture and parameters ("Model"); +- Associated dataset or collection of data in connection with the Model ("Dataset"); and/or +- Associated software to process and run the Dataset and Model, including code in + source or binary form for training, inference, and evaluation ("Code"). + +1. Use Rights + +Subject to the terms in Section 2 and 3 below, you may: + +(a) Use, reproduce, modify, display and distribute the Artifacts, in whole or in part; +(b) Create any other machine learning models, datasets, and derivative works that are + derived from or based on the Artifacts, including by (i) transfer of patterns of + the weights, parameters, operations, or outputs of the Model, (ii) generating + outputs of the Model to produce synthetic data, and (iii) using Code to prepare any + work of authorship (collectively, "Derivatives"); and +(c) Publish and share Derivatives. + +2. Use Restrictions + +You will not (and will not encourage, permit, or facilitate any others to) use any +portion of the Artifacts or Derivatives for the following purposes: + +(a) Any military and defense-related applications and use cases, including without + limitation, for weapons development, military operations, intelligence gathering, + or human surveillance and policing activities. +(b) Any extractive activities, operations and use cases involving the removal of raw + materials from the earth, including without limitation, to plan or facilitate the + extraction of oil, natural gas and minerals through activities such as drilling, + mining, and deforestation. + +3. Distribution + +In any distribution of the Artifacts or Derivatives: + +(a) You will cite Ai2 as the source of the Artifacts in any distribution of Artifacts + or Derivatives. +(b) If you distribute any portion of the Artifacts, you will either link to or provide + a copy of this Agreement to all third party recipients. +(c) If you distribute any Derivatives, you may add your own intellectual property + notices and apply other licenses and terms of use, provided that you include and + require the use restrictions in Section 2 in all downstream distribution unless Ai2 + provides written approval otherwise. + +4. Termination + +This Agreement will automatically terminate with immediate effect and without notice to +you in the following circumstances: + +(a) Your breach of the use restrictions in Section 2 and any other terms and conditions + herein; or +(b) If you file, maintain, or voluntarily participate in a lawsuit against any person + or entity asserting that the Artifacts or any portion thereof directly or + indirectly infringe any patent, except where a lawsuit is filed in response to a + corresponding lawsuit first brought against you. + +For the avoidance of doubt, Ai2 may also offer the Artifacts under separate terms and +conditions or stop distributing the Artifacts at any time; however, doing so will not +terminate this Agreement. You may continue to use the Artifacts under this Agreement +unless it is terminated in accordance with the circumstances expressly stated herein. + +5. Rights Not Covered + +This Agreement does not cover any patents or trademarks associated with the Artifacts, +including with respect to any individual items of information and materials that are +included or incorporated within a Dataset ("Contents"). Such Contents may be factual +data or independent works such as text, images, audio, and audio visual material. +Contents may be subject to other rights, including copyright, patent, data protection, +privacy, or personality rights, and this Agreement does not cover such rights. The use +rights in Section 1 expressly exclude any and all other rights that may apply to the +Contents of a Dataset. + +6. Disclaimer and Limitation of Liability + +(a) THE ARTIFACTS ARE PROVIDED "AS IS", "AS AVAILABLE", AND "WITH ALL FAULTS", WITHOUT + ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, IMPLIED + WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT, FITNESS FOR A PARTICULAR + PURPOSE, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE + OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. AI2 MAKES NO REPRESENTATIONS OR + WARRANTIES AS TO THE RELIABILITY, COMPLETENESS, QUALITY, PERFORMANCE, + FUNCTIONALITY, OR UTILITY OF ANY ARTIFACTS. ANY USE OF THE ARTIFACTS IS AT YOUR + SOLE RISK AND DISCRETION. YOU ARE SOLELY RESPONSIBLE FOR (1) CLEARING ANY THIRD + PARTY RIGHTS THAT MAY APPLY TO OR BE EMBODIED IN ANY ARTIFACTS, INCLUDING ANY + CONTENTS IN A DATASET; (2) OBTAINING ANY NECESSARY RIGHTS, LICENSES, CONSENTS, OR + PERMISSIONS REQUIRED FOR YOUR USE OF THE ARTIFACTS; AND (3) PERFORMING ANY DUE + DILIGENCE ON THE ARTIFACTS TO VERIFY SUITABILITY FOR YOUR INTENDED USE. + +(b) TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, IN NO EVENT WILL AI2 BE + LIABLE FOR ANY CLAIM, DAMAGES, LOSSES, OR OTHER LIABILITY OF ANY KIND WHATSOEVER, + WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR IN CONNECTION + WITH THE ARTIFACTS OR YOUR USE THEREOF. + +(c) The disclaimers and limitations of liability set forth above will be interpreted in + a manner that, to the greatest extent possible, constitute an absolute disclaimer + and waiver of all liability. + +7. Other Agreements + +If you have entered into a separate written agreement with Ai2 regarding your use of +the specific Artifacts that are subject to this Agreement ("Other Agreement"), the +terms of such Other Agreement will supplement the terms herein. To the extent of any +conflict between the terms of the Other Agreement and this Agreement, the Other +Agreement will take precedence. + +8. Miscellaneous + +If any term or provision of this Agreement is deemed invalid or unenforceable, it will +automatically be reformed to the minimum extent necessary to make it enforceable. To +the extent it cannot be reformed, it will be severed from this Agreement, and the +remaining terms and conditions will remain in full force and effect. Any delay or +failure by Ai2 to take any action or enforce any breach of this Agreement will not be +deemed as a waiver or consent by Ai2. No term or provision of this Agreement will be +waived by Ai2 unless expressly agreed in writing. Nothing in this Agreement constitutes +as a limitation of any privileges, immunities, and rights that apply to you or Ai2 +under applicable laws, including from the legal processes of any jurisdiction or +authority. diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/config.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/config.json new file mode 100644 index 0000000000000000000000000000000000000000..aab9a674cc198978a2091ea8961b9a639ebe3031 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/config.json @@ -0,0 +1,40 @@ +{ + "supported_modality_names": [ + "sentinel2_l2a", + "sentinel1", + "landsat", + "worldcover", + "srtm", + "openstreetmap_raster", + "wri_canopy_height_map", + "cdl", + "worldcereal" + ], + "embedding_size": 2048, + "max_patch_size": 8, + "min_patch_size": 1, + "num_heads": 32, + "mlp_ratio": 4.0, + "depth": 6, + "drop_path": 0.1, + "max_sequence_length": 12, + "num_register_tokens": 0, + "learnable_channel_embeddings": true, + "random_channel_embeddings": false, + "num_projection_layers": 1, + "aggregate_then_project": true, + "use_flash_attn": false, + "frozen_patch_embeddings": false, + "qk_norm": false, + "log_token_norm_stats": false, + "use_linear_patch_embed": false, + "band_dropout_rate": 0.0, + "random_band_dropout": false, + "position_encoding": "absolute", + "rope_base": 10000.0, + "rope_coordinate_scale": 1.0, + "rope_mixed_base": 10.0, + "temporal_rope_dim_frac": 0.25, + "rope_temporal_coordinate_scale": 1.0, + "_CLASS_": "olmoearth_pretrain.nn.flexi_vit.EncoderConfig" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/infer.py b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/infer.py new file mode 100644 index 0000000000000000000000000000000000000000..89e755d822b1da92ac2d76c59ccf79feef9d198e --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/infer.py @@ -0,0 +1,196 @@ +"""Portable frozen OlmoEarth encoder. Input HDF5 has pixels and IDs only.""" + +import argparse +import json +import os +from pathlib import Path +from types import MethodType +import h5py +import numpy as np +import torch +from olmoearth_pretrain.data.constants import Modality +from olmoearth_pretrain.data.normalize import Normalizer, Strategy +from olmoearth_pretrain.datatypes import MaskedOlmoEarthSample +from olmoearth_pretrain.nn.flexi_vit import EncoderConfig +from olmoearth_pretrain.nn.pooling import pool_unmasked_tokens, PoolingType + + +def inference_attention_mask(self, new_mask, fast_pass): + # Upstream v1 discards this padding mask in eval mode, although missing + # observations produce variable sequence lengths. Preserve the training + # attention-mask semantics without enabling dropout or changing weights. + return None if fast_pass else new_mask + + +def configure_inference(model): + model.eval() + model._maybe_get_attn_mask = MethodType(inference_attention_mask, model) + return model + + +def normalized_pixels(h, start, end): + normalizer = Normalizer(Strategy.COMPUTED) + out = {} + for name in ["sentinel2_l2a", "sentinel1"]: + if name not in h: + continue + arr = h[name][start:end].astype(np.float32) + if name == "sentinel1": + arr = 10 * np.log10(np.maximum(arr, 1e-6)) + out[name] = normalizer.normalize(Modality.get(name), arr).astype(np.float32) + return out + + +def embed( + model, pixels, device, patch_size=4, center=False, valid=None, bilinear_point=False +): + batch = len(next(iter(pixels.values()))) + observed = np.zeros(batch, dtype=bool) + for name in pixels: + observed |= ( + valid[name].reshape(batch, -1).any(axis=1) + if valid is not None and name in valid + else True + ) + if not observed.all(): + # No source observations: an explicit no-information vector. Keep the row + # in evaluation; its downstream prediction is determined by the fitted probe. + result = np.zeros((batch, model.embedding_size), dtype=np.float32) + if observed.any(): + result[observed] = embed( + model, + {k: v[observed] for k, v in pixels.items()}, + device, + patch_size=patch_size, + center=center, + bilinear_point=bilinear_point, + valid={k: v[observed] for k, v in valid.items()} + if valid is not None + else None, + ) + return result + kwargs = {} + for name, arr in pixels.items(): + val = torch.from_numpy(arr).to(device) + kwargs[name] = val + spec = Modality.get(name) + mask = torch.zeros( + (*val.shape[:-1], spec.num_band_sets), dtype=torch.int32, device=device + ) + if valid is not None and name in valid: + missing = torch.from_numpy(~valid[name].astype(bool)).to(device) + if missing.ndim == 2: + missing = missing[:, :, None] + mask.masked_fill_(missing[:, None, None, :, :], 3) + kwargs[name + "_mask"] = mask + b, _, _, t, _ = next(iter(pixels.values())).shape + timestamps = torch.zeros((b, t, 3), dtype=torch.int32, device=device) + timestamps[:, :, 0] = 1 + timestamps[:, :, 1] = torch.arange(t, device=device) + timestamps[:, :, 2] = 2024 + kwargs["timestamps"] = timestamps + with ( + torch.inference_mode(), + torch.autocast( + device_type=device.type, dtype=torch.bfloat16, enabled=device.type == "cuda" + ), + ): + result = model( + MaskedOlmoEarthSample(**kwargs), + patch_size=patch_size, + fast_pass=valid is None or all(np.all(v) for v in valid.values()), + )["tokens_and_masks"] + vec = pool_unmasked_tokens(result, PoolingType.MEAN, spatial_pooling=center) + if center: + if bilinear_point: + # AWF's published head upsamples by four before its pointwise + # linear classifier. Sampling here preserves that interpolation. + vec = torch.nn.functional.interpolate( + vec.permute(0, 3, 1, 2), + scale_factor=patch_size, + mode="bilinear", + align_corners=False, + ).permute(0, 2, 3, 1) + vec = vec[:, vec.shape[1] // 2, vec.shape[2] // 2] + if valid: + present = np.stack( + [ + valid[name].reshape(batch, -1).any(axis=1) + if name in valid + else np.ones(batch, dtype=bool) + for name in pixels + ], + axis=1, + ) + # Upstream averages over modalities present anywhere in the + # batch. Average over each sample's observed modalities instead. + scale = present.any(axis=0).sum() / present.sum(axis=1) + vec = ( + vec + * torch.as_tensor(scale, device=device, dtype=vec.dtype)[:, None] + ) + return vec.float().cpu().numpy() + + +def main(): + p = argparse.ArgumentParser() + p.add_argument("--model", type=Path, required=True) + p.add_argument("--input", type=Path, required=True) + p.add_argument("--output", type=Path, required=True) + p.add_argument("--batch-size", type=int, default=16) + p.add_argument("--device", choices=["cpu", "cuda"], default="cuda") + a = p.parse_args() + if ( + a.device == "cuda" + and os.environ.get("EARTH_SLURM_PARTITION") + and os.environ.get("SLURM_JOB_PARTITION") != os.environ["EARTH_SLURM_PARTITION"] + ): + raise RuntimeError("GPU execution requires Slurm configured-gpu-partition") + config = json.loads((a.model / "config.json").read_text()) + model = EncoderConfig.from_dict(config).build() + model.load_state_dict( + torch.load(a.model / "encoder.pt", map_location="cpu", weights_only=True), + strict=True, + ) + configure_inference(model).to(a.device) + with h5py.File(a.input, "r") as h: + ids = h["ids"].asstr()[:] + if h.attrs["task"] not in ("awf", "lfmc"): + raise ValueError("Unknown evaluation task") + bilinear_point = h.attrs["task"] == "awf" + chunks = [] + for start in range(0, len(ids), a.batch_size): + valid = { + name: h[name + "_valid"][start : start + a.batch_size] + for name in ["sentinel2_l2a", "sentinel1"] + if name + "_valid" in h + } + chunks.append( + embed( + model, + normalized_pixels(h, start, start + a.batch_size), + torch.device(a.device), + center=True, + bilinear_point=bilinear_point, + valid=valid, + ) + ) + if start % (a.batch_size * 50) == 0: + print("embedded", start, len(ids), flush=True) + features = np.concatenate(chunks) + if ( + features.shape != (len(ids), config["embedding_size"]) + or not np.isfinite(features).all() + ): + raise ValueError("Invalid embeddings") + a.output.parent.mkdir(parents=True, exist_ok=True) + np.savez(a.output, ids=np.asarray(ids, dtype=str), features=features) + print( + json.dumps( + {"rows": len(ids), "dimension": features.shape[1], "output": str(a.output)} + ) + ) + + +if __name__ == "__main__": + main() diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/provenance.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..d2622a7ea9ba1ac485dc2290a405227d9689aa96 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/provenance.json @@ -0,0 +1,124 @@ +{ + "upstream": "0497dfbb6711ded4e6bf10cf089fc1e4d58c186b", + "origin": "own_from_scratch_training", + "variant": "v1-flexivit/w2048-d6-h32", + "block_structure": null, + "inference_adapter_version": 3, + "infer_sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "initialization_seed": 12536, + "data_seed": 3622, + "checkpoint": "/run-state/workspace/research/runs/E6/ckpt/step002500.pt", + "parameters": 315168768, + "training_recipe": { + "recipe_complete": true, + "hyperparameters": { + "width": 2048, + "depth": 6, + "heads": 32, + "drop_path": 0.1, + "stem": "", + "post": "", + "towers": 1, + "steps": 2500, + "warmup": 250, + "lr": 0.0002, + "head_lr": 0.001, + "wd": 0.02, + "clip": 1.0, + "final_lr_ratio": 0.05, + "b16": 128, + "b32": 32, + "w_wc": 1.0, + "w_traj": 1.0, + "w_summ": 0.5, + "w_time": 0.5, + "w_loc": 0.5, + "p_roll": 0.5, + "p_zero_slot": 0.03, + "p_tf": 0.0, + "w_geo": 0.0, + "w_wcpx": 0.0, + "w_cycle": 0.0, + "w_pct": 0.0, + "w_trajpx": 0.0, + "w_therm": 0.0, + "w_clu": 0.0, + "w_tclu": 0.0, + "w_tex": 0.0, + "w_texc": 0.0, + "w_toktex": 0.0, + "w_texd": 4.0, + "texd_dims": 24, + "texd_rep": 2, + "feat_drop": 0.0, + "holdout": 0, + "focus16": 0.0, + "focus16_region": "tropics", + "focus32": 0.0, + "jitter": 0.0, + "ema": 0.0, + "tail_steps": 0, + "tail_lr_ratio": 0.25 + }, + "checkpoint_step": 2500, + "weights": "raw", + "objective": "linear heads on contract-pooled patch features: WorldCover soft CE (patch fractions) and pixel CE on bilinearly upsampled features; smooth-L1 on clean S2/S1 per-slot trajectories (patch level, and pixel-level S2 trajectories read from the bilinearly upsampled features of 16-px crops); NDVI/NDMI/NBR min/max/std; temporal quantiles of clean bands/indices with tile context; annual-cycle completion of NDVI/NDMI/NBR/S1; MSE on month-of-slot-0, lat/lon unit vector and their random-Fourier/interaction expansions; smooth-L1 on Landsat thermal brightness temperature (B10, B10-B11) of the presented slots and its annual mean/max/min; cross-entropy on label-free phenology-codebook classes of each patch (k-means of temporal quantile features of pool imagery) and on the landscape-type class of the surrounding pool tile; smooth-L1 on sub-patch S2 texture summaries (temporal mean/std/quantiles of the within-patch and 8-px-window spatial std and mean absolute neighbour difference of NDVI, NDMI, B08, B04, B11, B03 over clear pixels; and of the within-window spatial correlations between those channels); head-free smooth-L1 that makes the first 24 pooled feature dims equal 0.5 x the temporal mean over clear slots of the standardized per-slot texture values (w_texd; dims 24..47 when w_toktex is also on; texd_dims > 24 adds the temporal std / q10 / q50 / q90 summaries, texd_rep > 1 repeats the block of targets in further dims); head-free token-level smooth-L1 that makes the first 24 dims of every observed S2 band-set token equal 0.5 x the standardized square-rooted mean absolute deviation / neighbour difference of that token's own bands (+ NDVI resp. NDMI) inside its 4-px patch in its own slot (zero in the other band sets' dims and for S1 tokens), so that the contract mean pooling yields their temporal mean (w_toktex) (terms with zero weight in args are inactive)", + "supervision_sources": [ + "worldcover", + "sentinel2_l2a", + "sentinel1", + "timestamps", + "latlon" + ], + "downstream_labels_used": false, + "pretrained_weights_used": false, + "initialization": "random (torch.manual_seed(initialization_seed) then EncoderConfig.build())", + "data": { + "source": "/task-data/19837", + "source_provenance_sha256": "417005224be7469547343ae743a06c913e9ed428841dbd53c5b095c2c0b51621", + "exclusion": "AWF bbox lon32..43 lat-6..6; LFMC Euclidean lonlat radius0.1deg, all labels", + "samples": 19837, + "layers_copied": [ + "sentinel2_l2a (raw uint16 DN)", + "sentinel1 (dB, float16, NaN=missing)", + "worldcover", + "timestamps", + "latlon" + ], + "layers_not_copied": [ + "gse", + "landsat", + "srtm", + "openstreetmap_raster", + "worldcereal", + "wri_canopy_height_map", + "cdl", + "worldpop" + ], + "source_sha256_digest_of_digests": "1cc6107a4ecc336b7f4f5cd020ba01a4956ee70c87281168ac807d04d500c6bf" + }, + "lineage": null, + "phenology_codebook": null, + "texture_pca": null, + "landsat_thermal_cache": null + }, + "training_implementation": { + "name": "research/code/train.py", + "source_hashes": { + "train.py": "29cd9acd0dc213c4bf0c535912ae717cc6020ecb25041cd6912a4414cf5d90b2", + "geolib.py": "2ceb7996e1ae92b4994a3fee5e1da0a866a44b11759f63c4bd2aa494fc6cbd48", + "merge_towers.py": "fa21617dd3c156bfaf2ae3a68c1b3b1e3c640ee6cd2222ee0cdb69ba3ece608e", + "build_cache.py": "a9099b722a73bdff79da137a3d0051d3b5bab342a5cca0b53d4ac9ef8ffdfbc8" + } + }, + "training_validity": "not_flagged_invalid", + "planned_training_duration": { + "steps": 2500, + "tail_steps": 0 + }, + "checkpoint_sha256": "843d09bc68e00a3aad7824f7def421aeed78b0e15b8d154423e00f810b2bb0b5", + "checkpoint_step": 2500, + "weights": "raw", + "training_recipe_source": "/run-state/workspace/research/runs/E6/ckpt/step002500.pt", + "encoder_sha256": "53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/trajectory.jsonl b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/trajectory.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..2ab9e927d2ae48b2eb68897a3ebf1eedc4df682b --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/trajectory.jsonl @@ -0,0 +1,13 @@ +{"type":"system","subtype":"init","cwd":"/workspace","session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","tools":["Task","Bash","CronCreate","CronDelete","CronList","Edit","EnterWorktree","ExitWorktree","ListAgents","Monitor","NotebookEdit","Read","ReportFindings","ScheduleWakeup","SendMessage","Skill","TaskStop","ToolSearch","Workflow","Write"],"mcp_servers":[],"model":"claude-fable-5-2","permissionMode":"bypassPermissions","slash_commands":["deep-research","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","claude-api","workflow-authoring","run","run-skill-generator","plugin-authoring","agents","auto-mode-setup","autocompact","clear","color","compact","config","output-style","context","effort","fast","focus","heapdump","init","mcp","model","__remote-workflow","workflow-launch-exec","reload-plugins","reload-skills","rename","security-review","usage","insights","recap","goal","list-agents","team-onboarding"],"terminal_slash_commands":["doctor","color","focus","reload-plugins"],"apiKeySource":"ANTHROPIC_API_KEY","claude_code_version":"2.1.319","output_style":"default","agents":["claude","Explore","general-purpose","Plan","statusline-setup"],"skills":["deep-research","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","claude-api","workflow-authoring","run","run-skill-generator","plugin-authoring"],"plugins":[{"name":"cc-plugin-sec-default","path":"builtin","source":"cc-plugin-sec-default@builtin"},{"name":"cc-plugin-agents-md","path":"builtin","source":"cc-plugin-agents-md@builtin"},{"name":"cc-plugin-privacy","path":"builtin","source":"cc-plugin-privacy@builtin"},{"name":"cc-plugin-plugin-authoring","path":"builtin","source":"cc-plugin-plugin-authoring@builtin"}],"capabilities":["interrupt_receipt_v1","interrupt_cancel_queued_v1","interrupt_send_now_v1","interrupt_requeue_taken_v1","msg_lifecycle_v1","request_marker_lists_v1","ask_user_question_unanswered_v1","lifecycle_wakeup_source_v1","sdk_mcp_tools_list_changed","sdk_mcp_manifests","mcp_read_resource_v1","mcp_tool_ui_meta_v1","ui_surface_v1","mcp_call_result_not_for_model_v1","mcp_call_check_permissions_v1"],"analytics_disabled":true,"product_feedback_disabled":true,"uuid":"be682d7b-1959-4c3a-94ab-8b710771bb85","memory_paths":{"auto":"/run-state/agent/claude/projects/-workspace/memory/"},"original_cwd":"/workspace","additional_directories":[],"messaging_socket_path":"/tmp/cc-socks/37.sock","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","per_turn_effort_active":false,"ultrathink_available":false,"ultrathink_typed_raises":false,"view_mode":"default"} +{"type":"system","subtype":"thinking_tokens","estimated_tokens":50,"estimated_tokens_delta":50,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"77779da7-bb57-48d9-b298-954da370853c"} +{"type":"system","subtype":"thinking_tokens","estimated_tokens":252,"estimated_tokens_delta":202,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"a9a004c5-1665-4f7d-985e-5307a70edebf"} +{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011Cgy4XQJhtaEnh7wY6HTr2","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"","signature":"CAQS5wcKEAgTGAI4AUIIdGhpbmtpbmcSDFUbbNf2ehh/mj6QNBoMjJie3LkmFkgcF675IjBQVe3h0ouDYB6A4eB1D3eG0yHgeBgw+cyA32rYrBk+ABtjtpUCaCN+7fmHoKPHXVMqhAd1eAcxqxFJLlF6uBwN8hoaX2bvuhxmrVbmtiypEXK70urCzIqpjEzxP4x4LzozunViElcrqu4Ld6uU1iD1fC/JMlF7hqeLclE201lDIUvWob/MFR7ZwtClI/HQ1jtMMM4nHvhVeZjHm2yLzpPdoDqrmAZBhWmBt4FlzCA+izlE2MB93S928Xa5BxwhvfB13MLOSW34/aw8Bdwd25wityWfA2jE9yy/GFEszeZc4/bD3KHMr5xtyxBHErBIcjr4hcM2XuBt8wf3sS/n1nZCUVGybVFlpdVFoT8UCzZGUcWgvdk6zRgksuPauybRs2RAGwWvTEeAvPcAWUjbrg2ZKoViQqI04BMBqxf84gdZn2Pu37WCY1LLP4dWQyS5X1AQZBTrPEa10Ax1JbhVpPiGLTPk3pXAHn+h8Sbuy3W0LnTEonJk1QWjPynshZw9OXd+SgKKm6u/NVJxkEVA8H6e+TmsB5p1Uz0n7I7XQpgWLgjga3t+TpOXgrhlR/fooVBAq9F2URUY+UdlAvl0nXhT/YRklu1HNdq3FX97iN/iEYDMfsZc2pLvixTuxo0xuvqrLNDXc3WBlPoUJPXWqNlOp43coHA1+gDrSbN3tkh4rsuooa6Raq5REYkZxXa3jQ4vBLE738n6QBCMAzhpL6BZYpuGyNk5Igiz9b2llrC9x9OnW/1CXnQ9KJpo8pu5f7TINi/pQL71WBac0El1Oor8DCnF9HvF6UucXvuXMVg4dPiLBdAcaHjbPYpm8X+NrGtgFj6WIPh3MwzSFmMW85kdXZN01Y/YjsX7H+1OCzcSukQ/aKU1c+wu8L5zkODs8sWb2WKruSUbgda/2Zs4IKEwVe7k4VUGtYB4bCcwu8CW05iPcd1Ohu2qnJYZeKqwH30dEoHkLUfVnE5slQ/d+S6QVfFc0D9oS9+fm+G5e1f9jafBLM/L44zQIxULk5CRwOWBPq3GPht9ug6C04marPYu+fe4Y0yifB5Y+KhjzRZfb32nTiVYAsNSG2FIKBx6yujQQrArajf7YBuNc2ztsu+Wxj1nm5qsRaP/sxCGpGPmURNZlyZp6HYUxjOghM6MiUbi/HS4FNDfBmtCStpq136iMhtX9D8Zdv5k0cfTdgM8chlbnamsK1PnWHZj99P2ZEUSJVz1PnrRaxZq3qMFO55BfjYPfmyUFhMsAXlIGVVvql9qnd/8PBsYAQ=="}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":79479,"cache_read_input_tokens":12899,"cache_creation":{"ephemeral_5m_input_tokens":79479,"ephemeral_1h_input_tokens":0},"output_tokens":6,"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"7a529c0a-e179-42a2-beef-9b841ac06daa","timestamp":"2026-11-12T12:49:24.558Z","request_id":"req_011Cgy4XQ16rBxokDn2PYxh6","thinking_duration_ms":1108,"thinking_display":"updates"} +{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011Cgy4XQJhtaEnh7wY6HTr2","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_013deHqr2fwCvqhAgPNEH7ym","name":"Bash","input":{"command":"date -u; ls -la /workspace/submission/; sha256sum /workspace/submission/encoder.pt /workspace/submission/infer.py /workspace/baseline/starter/infer.py 2>&1 | cut -c1-110; for f in LICENSE-OlmoEarth config.json encoder.pt infer.py provenance.json; do cmp /workspace/submission/$f /workspace/research/validation/packages/E6-step2500/$f && echo \"same $f\"; done; ls /workspace/submission | wc -l","description":"Static integrity check of the live submission against the staged package"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":79479,"cache_read_input_tokens":12899,"cache_creation":{"ephemeral_5m_input_tokens":79479,"ephemeral_1h_input_tokens":0},"output_tokens":6,"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"8e881059-8e4a-4fb3-afcd-500311822a24","timestamp":"2026-11-12T12:49:26.089Z","request_id":"req_011Cgy4XQ16rBxokDn2PYxh6"} +{"type":"system","subtype":"task_started","task_id":"b8kzzsb4s","run_id":"0mwdjooc3-6103b880","tool_use_id":"toolu_013deHqr2fwCvqhAgPNEH7ym","description":"Static integrity check of the live submission against the staged package","is_backgrounded":false,"task_type":"local_bash","uuid":"c853dbc5-7a2e-4776-b9d6-f08769d7345f","session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b"} +{"type":"system","subtype":"task_notification","task_id":"b8kzzsb4s","run_id":"0mwdjooc3-6103b880","tool_use_id":"toolu_013deHqr2fwCvqhAgPNEH7ym","status":"completed","output_file":"","summary":"Static integrity check of the live submission against the staged package","uuid":"4b4d57e9-53a4-4a63-8740-425d797a8c54","session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b"} +{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_013deHqr2fwCvqhAgPNEH7ym","type":"tool_result","content":"Thu Nov 12 12:49:26 UTC 2026\ntotal 1231212\ndrwx------ 2 researcher researcher 4096 Nov 11 03:53 .\ndrwxr-xr-x 1 researcher researcher 4096 Nov 12 12:49 ..\n-rw-r--r-- 1 researcher researcher 7091 Nov 11 03:53 LICENSE-OlmoEarth\n-rw-r--r-- 1 researcher researcher 1019 Nov 11 03:53 config.json\n-rw-r--r-- 1 researcher researcher 1260716723 Nov 11 03:53 encoder.pt\n-rw-r--r-- 1 researcher researcher 7602 Nov 11 03:53 infer.py\n-rw-r--r-- 1 researcher researcher 5585 Nov 11 03:53 provenance.json\n53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d /workspace/submission/encoder.pt\n903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7 /workspace/submission/infer.py\n903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7 /workspace/baseline/starter/infer.py\nsame LICENSE-OlmoEarth\nsame config.json\nsame encoder.pt\nsame infer.py\nsame provenance.json\n5","is_error":false}]},"parent_tool_use_id":null,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"be8b05d8-aa86-4971-bc6e-49b9f519cfc6","timestamp":"2026-11-12T12:49:31.287Z","tool_use_result":{"stdout":"Thu Nov 12 12:49:26 UTC 2026\ntotal 1231212\ndrwx------ 2 researcher researcher 4096 Nov 11 03:53 .\ndrwxr-xr-x 1 researcher researcher 4096 Nov 12 12:49 ..\n-rw-r--r-- 1 researcher researcher 7091 Nov 11 03:53 LICENSE-OlmoEarth\n-rw-r--r-- 1 researcher researcher 1019 Nov 11 03:53 config.json\n-rw-r--r-- 1 researcher researcher 1260716723 Nov 11 03:53 encoder.pt\n-rw-r--r-- 1 researcher researcher 7602 Nov 11 03:53 infer.py\n-rw-r--r-- 1 researcher researcher 5585 Nov 11 03:53 provenance.json\n53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d /workspace/submission/encoder.pt\n903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7 /workspace/submission/infer.py\n903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7 /workspace/baseline/starter/infer.py\nsame LICENSE-OlmoEarth\nsame config.json\nsame encoder.pt\nsame infer.py\nsame provenance.json\n5","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_013deHqr2fwCvqhAgPNEH7ym","permission_decision":{"decision":"accept","source":"config","reason_type":"mode"}}]} +{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011Cgy4Y5RfjUWWm9VKz66yb","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"","signature":"CAQSvQcKEAgTGAI4AUIIdGhpbmtpbmcSDH+gd6KLctUs0426VhoMKoIHfLaj7m77b6psIjDXhDPOjW+DCyJncvOGY2QweGW61UQFvco779KAlMOBQfN0/JFYkAtzIpY9RMCXds0q2gbqR6EZlR1TIwtwif6gBXUKnodjs97q8VBYIDv6aTuTjMdiFheejO0iwUP8JOUPAh6NnfDJaKCYk1EYUF1Oc6hx7gUUV4gN4hKtRuEgJhV+Kw/h/+x35Xqp7uwF3hQn3eM1AUlEgnyvWV2o1PpKcgNj6k3jIP7GazfkwxJ+cdQCNX9b8cBDIBH3GwlvaGgBtx2mt0LNfczF9rU/jSCSbHYI7GLYLn5apxSZ70HhBiIMw9xOpCtvOGOugbeno8eu2+od80etJNOxQkoueMS45l6IPEPTRMdriuWy/iNRjJverZ4DN1dXTb9ALJG4O9qN/0l/BRLAlzl0SJLGFvVfVC/GEuo1o0KlbSudUE7svHXTX3goxcOehvP1r5orxWwDI4UCb2Ef3KpCy5tQpe5L34x5tTem+j3Hfs5WFtsmXDOYTks6ep/Jpx+96wOHyESrfg1wKmszPhw2eLgdYaSAuGriiCI/hz/Moe3VDhft3x8bCIPH5gkOA2KyYoWbe1Pu8YB6hdMqE0s3A1QznxD5pbpN3yHX/1WKSWaFlBwmtB2kiNlhgS3HUKHilwuRi9NflU9uzpGg6JIBulBrFh3cn1oQYJkdgBsQgLvaaW8CXdXscXXYdRPZqp451Vxlwquddqful7wDES9Y1t/9qx6QIGSXLdTT08UzqJxlyu1smH1MjzKldHV1uM9BEBcFd/RF/guSKK/j+cSMBNitxyE1ev/LPIY5sFqRXAsA+VOHucx8Dk3BG0Bx+iU2qlV04WlHakBMwmjSCjuXGTI188JDZWO1nd8cH6AWkG6eGnu9ovRL/NsyxRN4NAzTUzr2Ial1hz76nghGp9rWfuw6eVAcf5G2iGdez6JBaCUuoSNhQmyOdGLGVNGx23mEb0bIQ3eh0IG2kOc7KtPTcf25tJp+R2g2nVYjrTHCdii9tNd2mssnVeGC2X6qOnNGEfGtq0jDtPgQ+Tg+uP2FmrnTcoDSoIVlMPbHikWWrlxP18yLWBGmiOnpaJLEGyaBTWDeKJELBjFrGlotGB2R82o3Ogek9P8qiX4/Ud2P6+tFftGczUtkj0Pn8+JjZsZq1OGFapp1+bF/5An0FN+1VWIYISyLrFoo4rMMgsXPmmkxcrFdM7aDP5N7S+wDXknMLlUYAQ=="}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":823,"cache_read_input_tokens":92378,"cache_creation":{"ephemeral_5m_input_tokens":823,"ephemeral_1h_input_tokens":0},"output_tokens":6,"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"cf69725e-6055-42e3-a806-0abee9813194","timestamp":"2026-11-12T12:49:32.934Z","request_id":"req_011Cgy4Y5EWa6jidFK1h2G4t","thinking_duration_ms":370,"thinking_display":"updates"} +{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011Cgy4Y5RfjUWWm9VKz66yb","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_016rGccKMQ8DJJxdEuaxJcNC","name":"Bash","input":{"command":"cd /workspace/evaluation && timeout 60 python -I -c \"\nimport sys; sys.path.insert(0,'/workspace/evaluation')\nimport package_contract as pc, json\nprint(pc.validate_package('/workspace/submission'))\np=json.load(open('/workspace/submission/provenance.json'))\nprint(p.get('origin'), p.get('training_validity'))\n\" 2>&1 | grep -v -i \"warn\\|^$\" | tail -n 5; date -u","description":"Static contract validation of the submission package"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":823,"cache_read_input_tokens":92378,"cache_creation":{"ephemeral_5m_input_tokens":823,"ephemeral_1h_input_tokens":0},"output_tokens":6,"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"644dfc99-5df4-4821-9a26-70a94a014824","timestamp":"2026-11-12T12:49:34.602Z","request_id":"req_011Cgy4Y5EWa6jidFK1h2G4t"} +{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_016rGccKMQ8DJJxdEuaxJcNC","type":"tool_result","content":"None\nown_from_scratch_training not_flagged_invalid\nThu Nov 12 12:49:35 UTC 2026\nShell cwd was reset to /workspace","is_error":false}]},"parent_tool_use_id":null,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"b525d80c-eeda-45c1-b402-591b40a9bfcc","timestamp":"2026-11-12T12:49:35.011Z","tool_use_result":{"stdout":"None\nown_from_scratch_training not_flagged_invalid\nThu Nov 12 12:49:35 UTC 2026","stderr":"\nShell cwd was reset to /workspace","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_016rGccKMQ8DJJxdEuaxJcNC","permission_decision":{"decision":"accept","source":"config","reason_type":"mode"}}]} +{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011Cgy4YMMPHFgB8ngot2E2B","type":"message","role":"assistant","content":[{"type":"text","text":"The submission is the `E6-step2500` package, already published at `/workspace/submission`; I left it in place. No candidate ever beat it under the declared publication rule.\n\n**Static checks just run (no training, inference or evaluation):**\n- All five required files are present: `LICENSE-OlmoEarth`, `config.json`, `encoder.pt`, `infer.py`, `provenance.json`.\n- Each is byte-identical to the staged package `research/validation/packages/E6-step2500`.\n- `infer.py` is byte-identical to the starter's.\n- `package_contract.validate_package` passes; provenance reads `own_from_scratch_training`, `not_flagged_invalid`.\n\n**What the package is:** a depth-6, width-2048 encoder trained from random initialisation for 2,500 steps on the filtered pretraining pool. Supervision was WorldCover plus moisture, trajectory, texture and acquisition-metadata targets derived from the pool tiles; no downstream labels and no pretrained weights were used.\n\n**Validation numbers (official probes):**\n\n| Model | AWF accuracy | LFMC MAE | Proxy |\n|---|---|---|---|\n| Published `E6-step2500` | 82.85 % | 20.879 | 0.5348 |\n| Starter, reproduced here | 74.42 % | 21.175 | 0.4873 |\n| Raw spectral features | 66.86 % | 22.319 | 0.4287 |\n| Matched random initialisation | — | — | 0.4156 |\n| Trivial predictors | 33.72 % | 27.513 | 0.1686 |\n\n**Caveats:**\n- **Best of seven:** the published package is the highest of seven runs of its recipe, whose mean proxy is 0.5272 (sd 0.007, fast probes). Expect the recipe mean rather than 0.5348.\n- **LFMC gain not resolved:** the improvement over the reproduced starter is clear for AWF (+7.3 pp, interval 3.4 to 10.9) but not for LFMC (0.30 MAE, interval −0.36 to +1.01).\n- **AWF bias:** AWF validation accuracy served as both the selection signal and the scored quantity across about 100 logged selection rows, so it is optimistically biased by an unmeasurable amount.\n- **Test split:** LFMC test labels and `--final-test` were never used.\n- **Unfinished work:** the four screens run on 12 Nov all closed below their bar. The 5,000-step schedule series was cut off after its first run started, so that question stays open.\n\nThe full record is in `/workspace/research/notes/REPORT.md` and `LOG.md`; the report's status line still describes the schedule series as running, since the research tree is now read-only."}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":343,"cache_read_input_tokens":93201,"cache_creation":{"ephemeral_5m_input_tokens":343,"ephemeral_1h_input_tokens":0},"output_tokens":807,"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","uuid":"b992722d-3083-479e-b8f3-dd74d28d70b7","timestamp":"2026-11-12T12:49:44.318Z","request_id":"req_011Cgy4YMAiMwHWeGnTcnWtL"} +{"duration_api_ms":24869496,"stop_reason":"end_turn","session_id":"8ed4bd89-09a1-4482-ac6e-eec82bef878b","total_cost_usd":225.21029720000035,"usage":{"input_tokens":8,"cache_creation_input_tokens":80645,"cache_read_input_tokens":198478,"output_tokens":1511,"output_tokens_details":{"thinking_tokens":103},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":80645},"inference_geo":"global","iterations":[],"speed":"standard","fallback_credit":null},"modelUsage":{"claude-fable-5-2":{"inputTokens":82057,"outputTokens":2354862,"thinkingTokens":1112555,"cacheReadInputTokens":130776496,"cacheCreationInputTokens":30325906,"cacheCreationEphemeral5mInputTokens":30325906,"cacheCreationEphemeral1hInputTokens":0,"webSearchRequests":0,"costUSD":225.21029720000035,"contextWindow":200000,"maxOutputTokens":32000,"canonicalModel":"claude-fable-5-2","provider":"firstParty","costBasis":"unknown"}},"permission_denials":[],"terminal_reason":"completed","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","subagent_stats":{"spawned":0,"requested":{"background":0,"foreground":0,"unset":0},"started_in_background":0,"max_depth":0,"spawned_by_subagents":0,"completed":0,"failed":0,"killed":{"parent":0,"user":0,"system":0},"refused":{"depth_limit":0,"concurrency_limit":0,"budget":0},"by_type":{}},"safety_stops":0,"is_error":false,"num_turns":3,"subtype":"success","api_error_status":null,"result":"The submission is the `E6-step2500` package, already published at `/workspace/submission`; I left it in place. No candidate ever beat it under the declared publication rule.\n\n**Static checks just run (no training, inference or evaluation):**\n- All five required files are present: `LICENSE-OlmoEarth`, `config.json`, `encoder.pt`, `infer.py`, `provenance.json`.\n- Each is byte-identical to the staged package `research/validation/packages/E6-step2500`.\n- `infer.py` is byte-identical to the starter's.\n- `package_contract.validate_package` passes; provenance reads `own_from_scratch_training`, `not_flagged_invalid`.\n\n**What the package is:** a depth-6, width-2048 encoder trained from random initialisation for 2,500 steps on the filtered pretraining pool. Supervision was WorldCover plus moisture, trajectory, texture and acquisition-metadata targets derived from the pool tiles; no downstream labels and no pretrained weights were used.\n\n**Validation numbers (official probes):**\n\n| Model | AWF accuracy | LFMC MAE | Proxy |\n|---|---|---|---|\n| Published `E6-step2500` | 82.85 % | 20.879 | 0.5348 |\n| Starter, reproduced here | 74.42 % | 21.175 | 0.4873 |\n| Raw spectral features | 66.86 % | 22.319 | 0.4287 |\n| Matched random initialisation | — | — | 0.4156 |\n| Trivial predictors | 33.72 % | 27.513 | 0.1686 |\n\n**Caveats:**\n- **Best of seven:** the published package is the highest of seven runs of its recipe, whose mean proxy is 0.5272 (sd 0.007, fast probes). Expect the recipe mean rather than 0.5348.\n- **LFMC gain not resolved:** the improvement over the reproduced starter is clear for AWF (+7.3 pp, interval 3.4 to 10.9) but not for LFMC (0.30 MAE, interval −0.36 to +1.01).\n- **AWF bias:** AWF validation accuracy served as both the selection signal and the scored quantity across about 100 logged selection rows, so it is optimistically biased by an unmeasurable amount.\n- **Test split:** LFMC test labels and `--final-test` were never used.\n- **Unfinished work:** the four screens run on 12 Nov all closed below their bar. The 5,000-step schedule series was cut off after its first run started, so that question stays open.\n\nThe full record is in `/workspace/research/notes/REPORT.md` and `LOG.md`; the report's status line still describes the schedule series as running, since the research tree is now read-only.","ttft_ms":2505,"type":"result","duration_ms":22271,"uuid":"e5c8d906-b037-44ac-8021-a9dc8fe58e47","ttft_stream_ms":1396,"time_to_request_ms":73,"first_content_frame_ms":1396,"queued_turn_count":0,"result_index":0,"model_usage_since_last_result":{"claude-fable-5-2":{"inputTokens":8,"outputTokens":1511,"cacheReadInputTokens":198478,"cacheCreationInputTokens":80645,"webSearchRequests":0,"costUSD":0.47317259999999994,"contextWindow":200000,"maxOutputTokens":32000,"thinkingTokens":103,"cacheCreationEphemeral5mInputTokens":80645,"cacheCreationEphemeral1hInputTokens":0,"canonicalModel":"claude-fable-5-2","provider":"firstParty","costBasis":"unknown"}}} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/index.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/index.json new file mode 100644 index 0000000000000000000000000000000000000000..89e5fe62822dddcd88f6edf08ee3e70cd0d56301 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/index.json @@ -0,0 +1,2264 @@ +{ + "agent": "claude-code", + "agent_version": "2.1.319", + "caveats": [ + "Claude Code trial: a fresh session with no prior work reused; same image, data and 48-hour one-H100 budget as the Astra trial of this task.", + "Interrupted/resumed research with preserved charged time; not an uninterrupted trial.", + "Adapted Beaker execution; exact original Docker isolation and memory ceilings are not claimed.", + "Post-budget publication is separate from the original 48-hour history." + ], + "distinct_candidates": 5, + "evaluations": { + "S001": { + "execution": { + "scientific_scorer_modified": false + }, + "files": [ + { + "bytes": 168, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/reward.json", + "sha256": "738c1ffbea7a90a71e60b6e7a0c5e09acf520ded72d313398bf027a507c17b01" + }, + { + "bytes": 477, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/report.json", + "sha256": "dfd2ed6b6ca5044291d660fa72d08f0e3574a78196fbf684a5415294d530b205" + }, + { + "bytes": 1791, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S001/inference-manifest.json", + "sha256": "07b91d1a0f64e3087c080f4e20e4cb923c688d3b2a826131c771e6b663d4d4d1" + } + ], + "runner_sources": [ + { + "original_path": "sealed_adapter.py", + "stored": { + "bytes": 12821, + "path": "reproduction/files/d5/d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0/sealed_adapter.py", + "sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0" + } + }, + { + "original_path": "sealed_sandbox.py", + "stored": { + "bytes": 10287, + "path": "reproduction/files/9e/9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c/sealed_sandbox.py", + "sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" + } + }, + { + "original_path": "task/environment/evaluation/compare_seeds.py", + "stored": { + "bytes": 10068, + "path": "reproduction/files/78/78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15/compare_seeds.py", + "sha256": "78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15" + } + }, + { + "original_path": "task/environment/evaluation/package_contract.py", + "stored": { + "bytes": 2434, + "path": "reproduction/files/c4/c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1/package_contract.py", + "sha256": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + } + }, + { + "original_path": "task/environment/evaluation/probes.py", + "stored": { + "bytes": 4971, + "path": "reproduction/files/4b/4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2/probes.py", + "sha256": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2" + } + }, + { + "original_path": "task/environment/evaluation/raw_features.py", + "stored": { + "bytes": 2170, + "path": "reproduction/files/dd/dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2/raw_features.py", + "sha256": "dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2" + } + }, + { + "original_path": "task/environment/evaluation/screening.py", + "stored": { + "bytes": 15794, + "path": "reproduction/files/36/3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0/screening.py", + "sha256": "3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0" + } + }, + { + "original_path": "task/tests/docker-compose.yaml", + "stored": { + "bytes": 809, + "path": "reproduction/files/80/80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a/docker-compose.yaml", + "sha256": "80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a" + } + }, + { + "original_path": "task/tests/grade.py", + "stored": { + "bytes": 6969, + "path": "reproduction/files/68/680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d/grade.py", + "sha256": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d" + } + }, + { + "original_path": "task/tests/namespace.py", + "stored": { + "bytes": 5071, + "path": "reproduction/files/83/833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e/namespace.py", + "sha256": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + } + }, + { + "original_path": "task/tests/replay.py", + "stored": { + "bytes": 2108, + "path": "reproduction/files/12/12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2/replay.py", + "sha256": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2" + } + }, + { + "original_path": "task/tests/test.sh", + "stored": { + "bytes": 1194, + "path": "reproduction/files/01/01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234/test.sh", + "sha256": "01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234" + } + }, + { + "original_path": "task/tests/test_awf_pair_gate.py", + "stored": { + "bytes": 4815, + "path": "reproduction/files/70/70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595/test_awf_pair_gate.py", + "sha256": "70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595" + } + }, + { + "original_path": "task/tests/test_contract.py", + "stored": { + "bytes": 3181, + "path": "reproduction/files/22/224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43/test_contract.py", + "sha256": "224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43" + } + }, + { + "original_path": "task/tests/test_delivery.py", + "stored": { + "bytes": 5380, + "path": "reproduction/files/48/48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de/test_delivery.py", + "sha256": "48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de" + } + }, + { + "original_path": "task/tests/test_downstream_encoder.py", + "stored": { + "bytes": 2862, + "path": "reproduction/files/dc/dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58/test_downstream_encoder.py", + "sha256": "dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58" + } + }, + { + "original_path": "task/tests/test_external_lfmc_metadata.py", + "stored": { + "bytes": 4037, + "path": "reproduction/files/fc/fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329/test_external_lfmc_metadata.py", + "sha256": "fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329" + } + }, + { + "original_path": "task/tests/test_external_lfmc_reconcile.py", + "stored": { + "bytes": 4937, + "path": "reproduction/files/5f/5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb/test_external_lfmc_reconcile.py", + "sha256": "5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb" + } + }, + { + "original_path": "task/tests/test_external_lfmc_resolved.py", + "stored": { + "bytes": 3919, + "path": "reproduction/files/b9/b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e/test_external_lfmc_resolved.py", + "sha256": "b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e" + } + }, + { + "original_path": "task/tests/test_external_lfmc_statistics.py", + "stored": { + "bytes": 4897, + "path": "reproduction/files/2a/2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2/test_external_lfmc_statistics.py", + "sha256": "2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2" + } + }, + { + "original_path": "task/tests/test_full_recomputation.py", + "stored": { + "bytes": 10070, + "path": "reproduction/files/bc/bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998/test_full_recomputation.py", + "sha256": "bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998" + } + }, + { + "original_path": "task/tests/test_heldout_confirmation.py", + "stored": { + "bytes": 10049, + "path": "reproduction/files/25/25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d/test_heldout_confirmation.py", + "sha256": "25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d" + } + }, + { + "original_path": "task/tests/test_inference.py", + "stored": { + "bytes": 2211, + "path": "reproduction/files/05/0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5/test_inference.py", + "sha256": "0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5" + } + }, + { + "original_path": "task/tests/test_large_launcher.py", + "stored": { + "bytes": 9133, + "path": "reproduction/files/d9/d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087/test_large_launcher.py", + "sha256": "d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087" + } + }, + { + "original_path": "task/tests/test_lfmc_batch.py", + "stored": { + "bytes": 1197, + "path": "reproduction/files/ae/aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb/test_lfmc_batch.py", + "sha256": "aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb" + } + }, + { + "original_path": "task/tests/test_lfmc_microbatch.py", + "stored": { + "bytes": 3730, + "path": "reproduction/files/9e/9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20/test_lfmc_microbatch.py", + "sha256": "9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20" + } + }, + { + "original_path": "task/tests/test_lfmc_official_head.py", + "stored": { + "bytes": 2846, + "path": "reproduction/files/6b/6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6/test_lfmc_official_head.py", + "sha256": "6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6" + } + }, + { + "original_path": "task/tests/test_lfmc_window.py", + "stored": { + "bytes": 2936, + "path": "reproduction/files/bb/bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1/test_lfmc_window.py", + "sha256": "bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1" + } + }, + { + "original_path": "task/tests/test_masked_spatial.py", + "stored": { + "bytes": 2532, + "path": "reproduction/files/e8/e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5/test_masked_spatial.py", + "sha256": "e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5" + } + }, + { + "original_path": "task/tests/test_prepare_hf.py", + "stored": { + "bytes": 7705, + "path": "reproduction/files/11/110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f/test_prepare_hf.py", + "sha256": "110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f" + } + }, + { + "original_path": "task/tests/test_recomputation.py", + "stored": { + "bytes": 2739, + "path": "reproduction/files/6b/6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3/test_recomputation.py", + "sha256": "6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3" + } + }, + { + "original_path": "task/tests/test_resume_lfmc_extraction.py", + "stored": { + "bytes": 3612, + "path": "reproduction/files/e9/e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac/test_resume_lfmc_extraction.py", + "sha256": "e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac" + } + }, + { + "original_path": "task/tests/test_schedule_prefix.py", + "stored": { + "bytes": 1965, + "path": "reproduction/files/7a/7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c/test_schedule_prefix.py", + "sha256": "7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c" + } + }, + { + "original_path": "task/tests/test_screening.py", + "stored": { + "bytes": 9612, + "path": "reproduction/files/2e/2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352/test_screening.py", + "sha256": "2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352" + } + }, + { + "original_path": "task/tests/test_seed_comparison.py", + "stored": { + "bytes": 6739, + "path": "reproduction/files/54/54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01/test_seed_comparison.py", + "sha256": "54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01" + } + }, + { + "original_path": "task/tests/test_selection.py", + "stored": { + "bytes": 3883, + "path": "reproduction/files/ec/ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4/test_selection.py", + "sha256": "ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4" + } + }, + { + "original_path": "task/tests/test_sharded_launcher.py", + "stored": { + "bytes": 3509, + "path": "reproduction/files/83/83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8/test_sharded_launcher.py", + "sha256": "83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8" + } + }, + { + "original_path": "task/tests/test_sharding.py", + "stored": { + "bytes": 4230, + "path": "reproduction/files/06/06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62/test_sharding.py", + "sha256": "06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62" + } + }, + { + "original_path": "task/tests/test_staged_verifier.py", + "stored": { + "bytes": 7458, + "path": "reproduction/files/fc/fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4/test_staged_verifier.py", + "sha256": "fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4" + } + }, + { + "original_path": "task/tests/test_trainval_extract.py", + "stored": { + "bytes": 2270, + "path": "reproduction/files/7d/7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa/test_trainval_extract.py", + "sha256": "7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa" + } + } + ] + }, + "S002": { + "execution": { + "scientific_scorer_modified": false + }, + "files": [ + { + "bytes": 169, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/reward.json", + "sha256": "fb6de096236a7eb874c10c3a5c9e49c1a89b7fa0467ae1c5672bc823bad40374" + }, + { + "bytes": 478, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/report.json", + "sha256": "d7e8467b19b8082d586bd9a731e07cc32bf4265ba78e1ba22a5d8b349493b8b2" + }, + { + "bytes": 1791, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S002/inference-manifest.json", + "sha256": "a40af6fddc09fc638134cc2b75c985f2a5b4bebc53f24e29a55812f11c0e6984" + } + ], + "runner_sources": [ + { + "original_path": "sealed_adapter.py", + "stored": { + "bytes": 12821, + "path": "reproduction/files/d5/d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0/sealed_adapter.py", + "sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0" + } + }, + { + "original_path": "sealed_sandbox.py", + "stored": { + "bytes": 10287, + "path": "reproduction/files/9e/9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c/sealed_sandbox.py", + "sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" + } + }, + { + "original_path": "task/environment/evaluation/compare_seeds.py", + "stored": { + "bytes": 10068, + "path": "reproduction/files/78/78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15/compare_seeds.py", + "sha256": "78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15" + } + }, + { + "original_path": "task/environment/evaluation/package_contract.py", + "stored": { + "bytes": 2434, + "path": "reproduction/files/c4/c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1/package_contract.py", + "sha256": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + } + }, + { + "original_path": "task/environment/evaluation/probes.py", + "stored": { + "bytes": 4971, + "path": "reproduction/files/4b/4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2/probes.py", + "sha256": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2" + } + }, + { + "original_path": "task/environment/evaluation/raw_features.py", + "stored": { + "bytes": 2170, + "path": "reproduction/files/dd/dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2/raw_features.py", + "sha256": "dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2" + } + }, + { + "original_path": "task/environment/evaluation/screening.py", + "stored": { + "bytes": 15794, + "path": "reproduction/files/36/3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0/screening.py", + "sha256": "3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0" + } + }, + { + "original_path": "task/tests/docker-compose.yaml", + "stored": { + "bytes": 809, + "path": "reproduction/files/80/80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a/docker-compose.yaml", + "sha256": "80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a" + } + }, + { + "original_path": "task/tests/grade.py", + "stored": { + "bytes": 6969, + "path": "reproduction/files/68/680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d/grade.py", + "sha256": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d" + } + }, + { + "original_path": "task/tests/namespace.py", + "stored": { + "bytes": 5071, + "path": "reproduction/files/83/833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e/namespace.py", + "sha256": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + } + }, + { + "original_path": "task/tests/replay.py", + "stored": { + "bytes": 2108, + "path": "reproduction/files/12/12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2/replay.py", + "sha256": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2" + } + }, + { + "original_path": "task/tests/test.sh", + "stored": { + "bytes": 1194, + "path": "reproduction/files/01/01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234/test.sh", + "sha256": "01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234" + } + }, + { + "original_path": "task/tests/test_awf_pair_gate.py", + "stored": { + "bytes": 4815, + "path": "reproduction/files/70/70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595/test_awf_pair_gate.py", + "sha256": "70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595" + } + }, + { + "original_path": "task/tests/test_contract.py", + "stored": { + "bytes": 3181, + "path": "reproduction/files/22/224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43/test_contract.py", + "sha256": "224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43" + } + }, + { + "original_path": "task/tests/test_delivery.py", + "stored": { + "bytes": 5380, + "path": "reproduction/files/48/48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de/test_delivery.py", + "sha256": "48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de" + } + }, + { + "original_path": "task/tests/test_downstream_encoder.py", + "stored": { + "bytes": 2862, + "path": "reproduction/files/dc/dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58/test_downstream_encoder.py", + "sha256": "dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58" + } + }, + { + "original_path": "task/tests/test_external_lfmc_metadata.py", + "stored": { + "bytes": 4037, + "path": "reproduction/files/fc/fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329/test_external_lfmc_metadata.py", + "sha256": "fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329" + } + }, + { + "original_path": "task/tests/test_external_lfmc_reconcile.py", + "stored": { + "bytes": 4937, + "path": "reproduction/files/5f/5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb/test_external_lfmc_reconcile.py", + "sha256": "5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb" + } + }, + { + "original_path": "task/tests/test_external_lfmc_resolved.py", + "stored": { + "bytes": 3919, + "path": "reproduction/files/b9/b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e/test_external_lfmc_resolved.py", + "sha256": "b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e" + } + }, + { + "original_path": "task/tests/test_external_lfmc_statistics.py", + "stored": { + "bytes": 4897, + "path": "reproduction/files/2a/2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2/test_external_lfmc_statistics.py", + "sha256": "2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2" + } + }, + { + "original_path": "task/tests/test_full_recomputation.py", + "stored": { + "bytes": 10070, + "path": "reproduction/files/bc/bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998/test_full_recomputation.py", + "sha256": "bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998" + } + }, + { + "original_path": "task/tests/test_heldout_confirmation.py", + "stored": { + "bytes": 10049, + "path": "reproduction/files/25/25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d/test_heldout_confirmation.py", + "sha256": "25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d" + } + }, + { + "original_path": "task/tests/test_inference.py", + "stored": { + "bytes": 2211, + "path": "reproduction/files/05/0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5/test_inference.py", + "sha256": "0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5" + } + }, + { + "original_path": "task/tests/test_large_launcher.py", + "stored": { + "bytes": 9133, + "path": "reproduction/files/d9/d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087/test_large_launcher.py", + "sha256": "d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087" + } + }, + { + "original_path": "task/tests/test_lfmc_batch.py", + "stored": { + "bytes": 1197, + "path": "reproduction/files/ae/aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb/test_lfmc_batch.py", + "sha256": "aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb" + } + }, + { + "original_path": "task/tests/test_lfmc_microbatch.py", + "stored": { + "bytes": 3730, + "path": "reproduction/files/9e/9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20/test_lfmc_microbatch.py", + "sha256": "9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20" + } + }, + { + "original_path": "task/tests/test_lfmc_official_head.py", + "stored": { + "bytes": 2846, + "path": "reproduction/files/6b/6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6/test_lfmc_official_head.py", + "sha256": "6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6" + } + }, + { + "original_path": "task/tests/test_lfmc_window.py", + "stored": { + "bytes": 2936, + "path": "reproduction/files/bb/bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1/test_lfmc_window.py", + "sha256": "bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1" + } + }, + { + "original_path": "task/tests/test_masked_spatial.py", + "stored": { + "bytes": 2532, + "path": "reproduction/files/e8/e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5/test_masked_spatial.py", + "sha256": "e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5" + } + }, + { + "original_path": "task/tests/test_prepare_hf.py", + "stored": { + "bytes": 7705, + "path": "reproduction/files/11/110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f/test_prepare_hf.py", + "sha256": "110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f" + } + }, + { + "original_path": "task/tests/test_recomputation.py", + "stored": { + "bytes": 2739, + "path": "reproduction/files/6b/6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3/test_recomputation.py", + "sha256": "6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3" + } + }, + { + "original_path": "task/tests/test_resume_lfmc_extraction.py", + "stored": { + "bytes": 3612, + "path": "reproduction/files/e9/e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac/test_resume_lfmc_extraction.py", + "sha256": "e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac" + } + }, + { + "original_path": "task/tests/test_schedule_prefix.py", + "stored": { + "bytes": 1965, + "path": "reproduction/files/7a/7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c/test_schedule_prefix.py", + "sha256": "7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c" + } + }, + { + "original_path": "task/tests/test_screening.py", + "stored": { + "bytes": 9612, + "path": "reproduction/files/2e/2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352/test_screening.py", + "sha256": "2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352" + } + }, + { + "original_path": "task/tests/test_seed_comparison.py", + "stored": { + "bytes": 6739, + "path": "reproduction/files/54/54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01/test_seed_comparison.py", + "sha256": "54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01" + } + }, + { + "original_path": "task/tests/test_selection.py", + "stored": { + "bytes": 3883, + "path": "reproduction/files/ec/ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4/test_selection.py", + "sha256": "ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4" + } + }, + { + "original_path": "task/tests/test_sharded_launcher.py", + "stored": { + "bytes": 3509, + "path": "reproduction/files/83/83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8/test_sharded_launcher.py", + "sha256": "83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8" + } + }, + { + "original_path": "task/tests/test_sharding.py", + "stored": { + "bytes": 4230, + "path": "reproduction/files/06/06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62/test_sharding.py", + "sha256": "06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62" + } + }, + { + "original_path": "task/tests/test_staged_verifier.py", + "stored": { + "bytes": 7458, + "path": "reproduction/files/fc/fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4/test_staged_verifier.py", + "sha256": "fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4" + } + }, + { + "original_path": "task/tests/test_trainval_extract.py", + "stored": { + "bytes": 2270, + "path": "reproduction/files/7d/7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa/test_trainval_extract.py", + "sha256": "7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa" + } + } + ] + }, + "S003": { + "execution": { + "scientific_scorer_modified": false + }, + "files": [ + { + "bytes": 166, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/reward.json", + "sha256": "3a24101b3860224eb8de327129d6b3e9e1d5de49ba914bd144d32286e422ea8e" + }, + { + "bytes": 475, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/report.json", + "sha256": "0173b75e96f3685d2581546669488ebd58567bfbbd0c25c84ca94047c309f156" + }, + { + "bytes": 1791, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S003/inference-manifest.json", + "sha256": "e9a795d3e1bc62aa068843dbaf4e50c5a22f10ce6ff4ecc094d9f15bcf1567e1" + } + ], + "runner_sources": [ + { + "original_path": "sealed_adapter.py", + "stored": { + "bytes": 12821, + "path": "reproduction/files/d5/d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0/sealed_adapter.py", + "sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0" + } + }, + { + "original_path": "sealed_sandbox.py", + "stored": { + "bytes": 10287, + "path": "reproduction/files/9e/9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c/sealed_sandbox.py", + "sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" + } + }, + { + "original_path": "task/environment/evaluation/compare_seeds.py", + "stored": { + "bytes": 10068, + "path": "reproduction/files/78/78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15/compare_seeds.py", + "sha256": "78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15" + } + }, + { + "original_path": "task/environment/evaluation/package_contract.py", + "stored": { + "bytes": 2434, + "path": "reproduction/files/c4/c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1/package_contract.py", + "sha256": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + } + }, + { + "original_path": "task/environment/evaluation/probes.py", + "stored": { + "bytes": 4971, + "path": "reproduction/files/4b/4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2/probes.py", + "sha256": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2" + } + }, + { + "original_path": "task/environment/evaluation/raw_features.py", + "stored": { + "bytes": 2170, + "path": "reproduction/files/dd/dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2/raw_features.py", + "sha256": "dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2" + } + }, + { + "original_path": "task/environment/evaluation/screening.py", + "stored": { + "bytes": 15794, + "path": "reproduction/files/36/3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0/screening.py", + "sha256": "3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0" + } + }, + { + "original_path": "task/tests/docker-compose.yaml", + "stored": { + "bytes": 809, + "path": "reproduction/files/80/80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a/docker-compose.yaml", + "sha256": "80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a" + } + }, + { + "original_path": "task/tests/grade.py", + "stored": { + "bytes": 6969, + "path": "reproduction/files/68/680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d/grade.py", + "sha256": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d" + } + }, + { + "original_path": "task/tests/namespace.py", + "stored": { + "bytes": 5071, + "path": "reproduction/files/83/833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e/namespace.py", + "sha256": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + } + }, + { + "original_path": "task/tests/replay.py", + "stored": { + "bytes": 2108, + "path": "reproduction/files/12/12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2/replay.py", + "sha256": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2" + } + }, + { + "original_path": "task/tests/test.sh", + "stored": { + "bytes": 1194, + "path": "reproduction/files/01/01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234/test.sh", + "sha256": "01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234" + } + }, + { + "original_path": "task/tests/test_awf_pair_gate.py", + "stored": { + "bytes": 4815, + "path": "reproduction/files/70/70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595/test_awf_pair_gate.py", + "sha256": "70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595" + } + }, + { + "original_path": "task/tests/test_contract.py", + "stored": { + "bytes": 3181, + "path": "reproduction/files/22/224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43/test_contract.py", + "sha256": "224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43" + } + }, + { + "original_path": "task/tests/test_delivery.py", + "stored": { + "bytes": 5380, + "path": "reproduction/files/48/48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de/test_delivery.py", + "sha256": "48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de" + } + }, + { + "original_path": "task/tests/test_downstream_encoder.py", + "stored": { + "bytes": 2862, + "path": "reproduction/files/dc/dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58/test_downstream_encoder.py", + "sha256": "dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58" + } + }, + { + "original_path": "task/tests/test_external_lfmc_metadata.py", + "stored": { + "bytes": 4037, + "path": "reproduction/files/fc/fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329/test_external_lfmc_metadata.py", + "sha256": "fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329" + } + }, + { + "original_path": "task/tests/test_external_lfmc_reconcile.py", + "stored": { + "bytes": 4937, + "path": "reproduction/files/5f/5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb/test_external_lfmc_reconcile.py", + "sha256": "5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb" + } + }, + { + "original_path": "task/tests/test_external_lfmc_resolved.py", + "stored": { + "bytes": 3919, + "path": "reproduction/files/b9/b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e/test_external_lfmc_resolved.py", + "sha256": "b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e" + } + }, + { + "original_path": "task/tests/test_external_lfmc_statistics.py", + "stored": { + "bytes": 4897, + "path": "reproduction/files/2a/2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2/test_external_lfmc_statistics.py", + "sha256": "2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2" + } + }, + { + "original_path": "task/tests/test_full_recomputation.py", + "stored": { + "bytes": 10070, + "path": "reproduction/files/bc/bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998/test_full_recomputation.py", + "sha256": "bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998" + } + }, + { + "original_path": "task/tests/test_heldout_confirmation.py", + "stored": { + "bytes": 10049, + "path": "reproduction/files/25/25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d/test_heldout_confirmation.py", + "sha256": "25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d" + } + }, + { + "original_path": "task/tests/test_inference.py", + "stored": { + "bytes": 2211, + "path": "reproduction/files/05/0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5/test_inference.py", + "sha256": "0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5" + } + }, + { + "original_path": "task/tests/test_large_launcher.py", + "stored": { + "bytes": 9133, + "path": "reproduction/files/d9/d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087/test_large_launcher.py", + "sha256": "d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087" + } + }, + { + "original_path": "task/tests/test_lfmc_batch.py", + "stored": { + "bytes": 1197, + "path": "reproduction/files/ae/aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb/test_lfmc_batch.py", + "sha256": "aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb" + } + }, + { + "original_path": "task/tests/test_lfmc_microbatch.py", + "stored": { + "bytes": 3730, + "path": "reproduction/files/9e/9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20/test_lfmc_microbatch.py", + "sha256": "9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20" + } + }, + { + "original_path": "task/tests/test_lfmc_official_head.py", + "stored": { + "bytes": 2846, + "path": "reproduction/files/6b/6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6/test_lfmc_official_head.py", + "sha256": "6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6" + } + }, + { + "original_path": "task/tests/test_lfmc_window.py", + "stored": { + "bytes": 2936, + "path": "reproduction/files/bb/bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1/test_lfmc_window.py", + "sha256": "bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1" + } + }, + { + "original_path": "task/tests/test_masked_spatial.py", + "stored": { + "bytes": 2532, + "path": "reproduction/files/e8/e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5/test_masked_spatial.py", + "sha256": "e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5" + } + }, + { + "original_path": "task/tests/test_prepare_hf.py", + "stored": { + "bytes": 7705, + "path": "reproduction/files/11/110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f/test_prepare_hf.py", + "sha256": "110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f" + } + }, + { + "original_path": "task/tests/test_recomputation.py", + "stored": { + "bytes": 2739, + "path": "reproduction/files/6b/6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3/test_recomputation.py", + "sha256": "6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3" + } + }, + { + "original_path": "task/tests/test_resume_lfmc_extraction.py", + "stored": { + "bytes": 3612, + "path": "reproduction/files/e9/e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac/test_resume_lfmc_extraction.py", + "sha256": "e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac" + } + }, + { + "original_path": "task/tests/test_schedule_prefix.py", + "stored": { + "bytes": 1965, + "path": "reproduction/files/7a/7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c/test_schedule_prefix.py", + "sha256": "7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c" + } + }, + { + "original_path": "task/tests/test_screening.py", + "stored": { + "bytes": 9612, + "path": "reproduction/files/2e/2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352/test_screening.py", + "sha256": "2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352" + } + }, + { + "original_path": "task/tests/test_seed_comparison.py", + "stored": { + "bytes": 6739, + "path": "reproduction/files/54/54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01/test_seed_comparison.py", + "sha256": "54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01" + } + }, + { + "original_path": "task/tests/test_selection.py", + "stored": { + "bytes": 3883, + "path": "reproduction/files/ec/ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4/test_selection.py", + "sha256": "ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4" + } + }, + { + "original_path": "task/tests/test_sharded_launcher.py", + "stored": { + "bytes": 3509, + "path": "reproduction/files/83/83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8/test_sharded_launcher.py", + "sha256": "83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8" + } + }, + { + "original_path": "task/tests/test_sharding.py", + "stored": { + "bytes": 4230, + "path": "reproduction/files/06/06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62/test_sharding.py", + "sha256": "06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62" + } + }, + { + "original_path": "task/tests/test_staged_verifier.py", + "stored": { + "bytes": 7458, + "path": "reproduction/files/fc/fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4/test_staged_verifier.py", + "sha256": "fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4" + } + }, + { + "original_path": "task/tests/test_trainval_extract.py", + "stored": { + "bytes": 2270, + "path": "reproduction/files/7d/7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa/test_trainval_extract.py", + "sha256": "7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa" + } + } + ] + }, + "S004": { + "execution": { + "scientific_scorer_modified": false + }, + "files": [ + { + "bytes": 167, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/reward.json", + "sha256": "9796f13946dd19433447fe773e3330bb2c2515d4067c77c4662d158bfdc019ce" + }, + { + "bytes": 476, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/report.json", + "sha256": "13d4b2ca4982528528c03afb66104876693d037a26da8d822a87dd265b55659d" + }, + { + "bytes": 1791, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S004/inference-manifest.json", + "sha256": "bed1a63fe8103b80d67ab3361d5b22439b8873e7221fd1398236ae2596b44d69" + } + ], + "runner_sources": [ + { + "original_path": "sealed_adapter.py", + "stored": { + "bytes": 12821, + "path": "reproduction/files/d5/d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0/sealed_adapter.py", + "sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0" + } + }, + { + "original_path": "sealed_sandbox.py", + "stored": { + "bytes": 10287, + "path": "reproduction/files/9e/9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c/sealed_sandbox.py", + "sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" + } + }, + { + "original_path": "task/environment/evaluation/compare_seeds.py", + "stored": { + "bytes": 10068, + "path": "reproduction/files/78/78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15/compare_seeds.py", + "sha256": "78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15" + } + }, + { + "original_path": "task/environment/evaluation/package_contract.py", + "stored": { + "bytes": 2434, + "path": "reproduction/files/c4/c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1/package_contract.py", + "sha256": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + } + }, + { + "original_path": "task/environment/evaluation/probes.py", + "stored": { + "bytes": 4971, + "path": "reproduction/files/4b/4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2/probes.py", + "sha256": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2" + } + }, + { + "original_path": "task/environment/evaluation/raw_features.py", + "stored": { + "bytes": 2170, + "path": "reproduction/files/dd/dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2/raw_features.py", + "sha256": "dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2" + } + }, + { + "original_path": "task/environment/evaluation/screening.py", + "stored": { + "bytes": 15794, + "path": "reproduction/files/36/3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0/screening.py", + "sha256": "3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0" + } + }, + { + "original_path": "task/tests/docker-compose.yaml", + "stored": { + "bytes": 809, + "path": "reproduction/files/80/80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a/docker-compose.yaml", + "sha256": "80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a" + } + }, + { + "original_path": "task/tests/grade.py", + "stored": { + "bytes": 6969, + "path": "reproduction/files/68/680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d/grade.py", + "sha256": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d" + } + }, + { + "original_path": "task/tests/namespace.py", + "stored": { + "bytes": 5071, + "path": "reproduction/files/83/833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e/namespace.py", + "sha256": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + } + }, + { + "original_path": "task/tests/replay.py", + "stored": { + "bytes": 2108, + "path": "reproduction/files/12/12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2/replay.py", + "sha256": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2" + } + }, + { + "original_path": "task/tests/test.sh", + "stored": { + "bytes": 1194, + "path": "reproduction/files/01/01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234/test.sh", + "sha256": "01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234" + } + }, + { + "original_path": "task/tests/test_awf_pair_gate.py", + "stored": { + "bytes": 4815, + "path": "reproduction/files/70/70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595/test_awf_pair_gate.py", + "sha256": "70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595" + } + }, + { + "original_path": "task/tests/test_contract.py", + "stored": { + "bytes": 3181, + "path": "reproduction/files/22/224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43/test_contract.py", + "sha256": "224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43" + } + }, + { + "original_path": "task/tests/test_delivery.py", + "stored": { + "bytes": 5380, + "path": "reproduction/files/48/48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de/test_delivery.py", + "sha256": "48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de" + } + }, + { + "original_path": "task/tests/test_downstream_encoder.py", + "stored": { + "bytes": 2862, + "path": "reproduction/files/dc/dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58/test_downstream_encoder.py", + "sha256": "dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58" + } + }, + { + "original_path": "task/tests/test_external_lfmc_metadata.py", + "stored": { + "bytes": 4037, + "path": "reproduction/files/fc/fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329/test_external_lfmc_metadata.py", + "sha256": "fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329" + } + }, + { + "original_path": "task/tests/test_external_lfmc_reconcile.py", + "stored": { + "bytes": 4937, + "path": "reproduction/files/5f/5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb/test_external_lfmc_reconcile.py", + "sha256": "5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb" + } + }, + { + "original_path": "task/tests/test_external_lfmc_resolved.py", + "stored": { + "bytes": 3919, + "path": "reproduction/files/b9/b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e/test_external_lfmc_resolved.py", + "sha256": "b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e" + } + }, + { + "original_path": "task/tests/test_external_lfmc_statistics.py", + "stored": { + "bytes": 4897, + "path": "reproduction/files/2a/2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2/test_external_lfmc_statistics.py", + "sha256": "2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2" + } + }, + { + "original_path": "task/tests/test_full_recomputation.py", + "stored": { + "bytes": 10070, + "path": "reproduction/files/bc/bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998/test_full_recomputation.py", + "sha256": "bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998" + } + }, + { + "original_path": "task/tests/test_heldout_confirmation.py", + "stored": { + "bytes": 10049, + "path": "reproduction/files/25/25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d/test_heldout_confirmation.py", + "sha256": "25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d" + } + }, + { + "original_path": "task/tests/test_inference.py", + "stored": { + "bytes": 2211, + "path": "reproduction/files/05/0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5/test_inference.py", + "sha256": "0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5" + } + }, + { + "original_path": "task/tests/test_large_launcher.py", + "stored": { + "bytes": 9133, + "path": "reproduction/files/d9/d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087/test_large_launcher.py", + "sha256": "d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087" + } + }, + { + "original_path": "task/tests/test_lfmc_batch.py", + "stored": { + "bytes": 1197, + "path": "reproduction/files/ae/aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb/test_lfmc_batch.py", + "sha256": "aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb" + } + }, + { + "original_path": "task/tests/test_lfmc_microbatch.py", + "stored": { + "bytes": 3730, + "path": "reproduction/files/9e/9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20/test_lfmc_microbatch.py", + "sha256": "9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20" + } + }, + { + "original_path": "task/tests/test_lfmc_official_head.py", + "stored": { + "bytes": 2846, + "path": "reproduction/files/6b/6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6/test_lfmc_official_head.py", + "sha256": "6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6" + } + }, + { + "original_path": "task/tests/test_lfmc_window.py", + "stored": { + "bytes": 2936, + "path": "reproduction/files/bb/bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1/test_lfmc_window.py", + "sha256": "bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1" + } + }, + { + "original_path": "task/tests/test_masked_spatial.py", + "stored": { + "bytes": 2532, + "path": "reproduction/files/e8/e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5/test_masked_spatial.py", + "sha256": "e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5" + } + }, + { + "original_path": "task/tests/test_prepare_hf.py", + "stored": { + "bytes": 7705, + "path": "reproduction/files/11/110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f/test_prepare_hf.py", + "sha256": "110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f" + } + }, + { + "original_path": "task/tests/test_recomputation.py", + "stored": { + "bytes": 2739, + "path": "reproduction/files/6b/6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3/test_recomputation.py", + "sha256": "6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3" + } + }, + { + "original_path": "task/tests/test_resume_lfmc_extraction.py", + "stored": { + "bytes": 3612, + "path": "reproduction/files/e9/e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac/test_resume_lfmc_extraction.py", + "sha256": "e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac" + } + }, + { + "original_path": "task/tests/test_schedule_prefix.py", + "stored": { + "bytes": 1965, + "path": "reproduction/files/7a/7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c/test_schedule_prefix.py", + "sha256": "7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c" + } + }, + { + "original_path": "task/tests/test_screening.py", + "stored": { + "bytes": 9612, + "path": "reproduction/files/2e/2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352/test_screening.py", + "sha256": "2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352" + } + }, + { + "original_path": "task/tests/test_seed_comparison.py", + "stored": { + "bytes": 6739, + "path": "reproduction/files/54/54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01/test_seed_comparison.py", + "sha256": "54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01" + } + }, + { + "original_path": "task/tests/test_selection.py", + "stored": { + "bytes": 3883, + "path": "reproduction/files/ec/ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4/test_selection.py", + "sha256": "ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4" + } + }, + { + "original_path": "task/tests/test_sharded_launcher.py", + "stored": { + "bytes": 3509, + "path": "reproduction/files/83/83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8/test_sharded_launcher.py", + "sha256": "83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8" + } + }, + { + "original_path": "task/tests/test_sharding.py", + "stored": { + "bytes": 4230, + "path": "reproduction/files/06/06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62/test_sharding.py", + "sha256": "06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62" + } + }, + { + "original_path": "task/tests/test_staged_verifier.py", + "stored": { + "bytes": 7458, + "path": "reproduction/files/fc/fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4/test_staged_verifier.py", + "sha256": "fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4" + } + }, + { + "original_path": "task/tests/test_trainval_extract.py", + "stored": { + "bytes": 2270, + "path": "reproduction/files/7d/7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa/test_trainval_extract.py", + "sha256": "7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa" + } + } + ] + }, + "S005": { + "execution": { + "scientific_scorer_modified": false + }, + "files": [ + { + "bytes": 168, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/reward.json", + "sha256": "43dfa9095c9372c3d24f46b0358a6b39816d5cca019c9a2746b175fc32a9869c" + }, + { + "bytes": 477, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/report.json", + "sha256": "f22ac3ddb3d22e6c4117d3c831a2b7f5ca3d4d5ce588630979857b3af3599ec9" + }, + { + "bytes": 1791, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/evaluations/S005/inference-manifest.json", + "sha256": "69a9503ca5fc7ba6cd339de0965c1cc3c925c82e97d59a1e915e5da8aa74293a" + } + ], + "runner_sources": [ + { + "original_path": "sealed_adapter.py", + "stored": { + "bytes": 12821, + "path": "reproduction/files/d5/d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0/sealed_adapter.py", + "sha256": "d5ff131205d3c351f4c9e9ab411235f84fa2426a5346adc3220051ee0d761dd0" + } + }, + { + "original_path": "sealed_sandbox.py", + "stored": { + "bytes": 10287, + "path": "reproduction/files/9e/9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c/sealed_sandbox.py", + "sha256": "9eb5943f537cc11091b6c1d1a040c332fb03f0076aee990dd25f82dcd7cbd39c" + } + }, + { + "original_path": "task/environment/evaluation/compare_seeds.py", + "stored": { + "bytes": 10068, + "path": "reproduction/files/78/78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15/compare_seeds.py", + "sha256": "78cd92a008764f147aabf0ecedf02e9b39f796f057b556617aa6c6dc2b282e15" + } + }, + { + "original_path": "task/environment/evaluation/package_contract.py", + "stored": { + "bytes": 2434, + "path": "reproduction/files/c4/c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1/package_contract.py", + "sha256": "c4f8af4a34b581dca33c5b26d819cd89aef68281a5f144676551a2f23dc548f1" + } + }, + { + "original_path": "task/environment/evaluation/probes.py", + "stored": { + "bytes": 4971, + "path": "reproduction/files/4b/4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2/probes.py", + "sha256": "4b5267cbb4325dc7dc4c732c99d90c24f8d54253a664442fcb999937f8a76aa2" + } + }, + { + "original_path": "task/environment/evaluation/raw_features.py", + "stored": { + "bytes": 2170, + "path": "reproduction/files/dd/dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2/raw_features.py", + "sha256": "dd789172f4b9d4d775c43628a9b326e95c86ce4fb53f625f74a8b1432a8c1db2" + } + }, + { + "original_path": "task/environment/evaluation/screening.py", + "stored": { + "bytes": 15794, + "path": "reproduction/files/36/3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0/screening.py", + "sha256": "3672316bc2c989a915025f7948742278b6f30efc6ed9072c1b61fbd6226eb7a0" + } + }, + { + "original_path": "task/tests/docker-compose.yaml", + "stored": { + "bytes": 809, + "path": "reproduction/files/80/80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a/docker-compose.yaml", + "sha256": "80815e55202a57003f8136d3aa5958d0b31c3bcba51c07c50984b08007ddb70a" + } + }, + { + "original_path": "task/tests/grade.py", + "stored": { + "bytes": 6969, + "path": "reproduction/files/68/680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d/grade.py", + "sha256": "680ec12531da9bd47cf394ff743ac53b6496a0bf06aa3d29121545393a61dd7d" + } + }, + { + "original_path": "task/tests/namespace.py", + "stored": { + "bytes": 5071, + "path": "reproduction/files/83/833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e/namespace.py", + "sha256": "833cd96ca014c4695c441d8a4dd9d8211f1c59e1a20578ce3790d3cd888c141e" + } + }, + { + "original_path": "task/tests/replay.py", + "stored": { + "bytes": 2108, + "path": "reproduction/files/12/12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2/replay.py", + "sha256": "12033212bd52ab4a3c31643ee1434fdf4b84489b59feb62322cba2c56c127ff2" + } + }, + { + "original_path": "task/tests/test.sh", + "stored": { + "bytes": 1194, + "path": "reproduction/files/01/01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234/test.sh", + "sha256": "01450c9a5cfd39fb453742feae95510f9d15c90347f44cb55a09d59558d7d234" + } + }, + { + "original_path": "task/tests/test_awf_pair_gate.py", + "stored": { + "bytes": 4815, + "path": "reproduction/files/70/70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595/test_awf_pair_gate.py", + "sha256": "70bb340258c349bcaa5cb43924db70a74232e70629e216adf29ff4dbcee7f595" + } + }, + { + "original_path": "task/tests/test_contract.py", + "stored": { + "bytes": 3181, + "path": "reproduction/files/22/224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43/test_contract.py", + "sha256": "224957d662239021e18f16650cebeefedd5515b8b94454d64fc3064e98bb1a43" + } + }, + { + "original_path": "task/tests/test_delivery.py", + "stored": { + "bytes": 5380, + "path": "reproduction/files/48/48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de/test_delivery.py", + "sha256": "48680fdc223e5a049057180496756341037ba180eb3c09a6e73c141788d838de" + } + }, + { + "original_path": "task/tests/test_downstream_encoder.py", + "stored": { + "bytes": 2862, + "path": "reproduction/files/dc/dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58/test_downstream_encoder.py", + "sha256": "dcbb09034cd26d31a03a8d9c494b88b8f1837ceb7d8172659baa99fbbba6af58" + } + }, + { + "original_path": "task/tests/test_external_lfmc_metadata.py", + "stored": { + "bytes": 4037, + "path": "reproduction/files/fc/fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329/test_external_lfmc_metadata.py", + "sha256": "fc15353447c19ae663aa77839f924350d4927f3548f143452b1db2dfd8fbe329" + } + }, + { + "original_path": "task/tests/test_external_lfmc_reconcile.py", + "stored": { + "bytes": 4937, + "path": "reproduction/files/5f/5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb/test_external_lfmc_reconcile.py", + "sha256": "5fec35388621da6a2c7289430ac353296e2f1b4c789c3a479dcae190e1aac9bb" + } + }, + { + "original_path": "task/tests/test_external_lfmc_resolved.py", + "stored": { + "bytes": 3919, + "path": "reproduction/files/b9/b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e/test_external_lfmc_resolved.py", + "sha256": "b97b14b644a63c62c3695b114ba2bc24bb707e2b6cade8929a0520475c63b44e" + } + }, + { + "original_path": "task/tests/test_external_lfmc_statistics.py", + "stored": { + "bytes": 4897, + "path": "reproduction/files/2a/2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2/test_external_lfmc_statistics.py", + "sha256": "2a3f0ef1b8b942a6d7cf4845d3fff2f0299706297d40f867c203ea1b2172cdd2" + } + }, + { + "original_path": "task/tests/test_full_recomputation.py", + "stored": { + "bytes": 10070, + "path": "reproduction/files/bc/bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998/test_full_recomputation.py", + "sha256": "bcd8f778e892786296ec7c39599aaeef7e737cd0fc2cafc3eeb5aa58c3843998" + } + }, + { + "original_path": "task/tests/test_heldout_confirmation.py", + "stored": { + "bytes": 10049, + "path": "reproduction/files/25/25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d/test_heldout_confirmation.py", + "sha256": "25821b034a3b87b31eb7bd03c266decee1a2de037c3680796119f04c0740c63d" + } + }, + { + "original_path": "task/tests/test_inference.py", + "stored": { + "bytes": 2211, + "path": "reproduction/files/05/0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5/test_inference.py", + "sha256": "0554f498d0368ecd36ac232c40d7bcd0b9dc20ed1a901d72e300b13d501ae4d5" + } + }, + { + "original_path": "task/tests/test_large_launcher.py", + "stored": { + "bytes": 9133, + "path": "reproduction/files/d9/d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087/test_large_launcher.py", + "sha256": "d9d67e424ff9fd66980b53646eeb148e2f80aab59d7b811f0ec1d79c3a2e8087" + } + }, + { + "original_path": "task/tests/test_lfmc_batch.py", + "stored": { + "bytes": 1197, + "path": "reproduction/files/ae/aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb/test_lfmc_batch.py", + "sha256": "aef2321cce2e82f6c36a3fbd1a2db5cc0bd6eee8802e1af97df1a3fb7fcf30bb" + } + }, + { + "original_path": "task/tests/test_lfmc_microbatch.py", + "stored": { + "bytes": 3730, + "path": "reproduction/files/9e/9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20/test_lfmc_microbatch.py", + "sha256": "9e87503585e9da663f0297c14552fd74b6bac405b8f04aaea1e85bb24359cc20" + } + }, + { + "original_path": "task/tests/test_lfmc_official_head.py", + "stored": { + "bytes": 2846, + "path": "reproduction/files/6b/6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6/test_lfmc_official_head.py", + "sha256": "6b0adba5a784d981d6728a3986511bf5d96f4d9a70f4f893ec2234e8f494bec6" + } + }, + { + "original_path": "task/tests/test_lfmc_window.py", + "stored": { + "bytes": 2936, + "path": "reproduction/files/bb/bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1/test_lfmc_window.py", + "sha256": "bb4a136ec03099b66e8ce268f7ff4a5ad04ff560e826115cfa75a2aa8be384a1" + } + }, + { + "original_path": "task/tests/test_masked_spatial.py", + "stored": { + "bytes": 2532, + "path": "reproduction/files/e8/e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5/test_masked_spatial.py", + "sha256": "e810f013249155d331377c7e3c78ef313997a34b2c0011a54b90d877d3ec75e5" + } + }, + { + "original_path": "task/tests/test_prepare_hf.py", + "stored": { + "bytes": 7705, + "path": "reproduction/files/11/110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f/test_prepare_hf.py", + "sha256": "110a51b699d57fd0239157173866513fab41f5d1ceeb6208bc2466bfa942486f" + } + }, + { + "original_path": "task/tests/test_recomputation.py", + "stored": { + "bytes": 2739, + "path": "reproduction/files/6b/6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3/test_recomputation.py", + "sha256": "6b2e2d15ea19a89fd239cc1c54320796e18574a39de200038664eaf838d622f3" + } + }, + { + "original_path": "task/tests/test_resume_lfmc_extraction.py", + "stored": { + "bytes": 3612, + "path": "reproduction/files/e9/e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac/test_resume_lfmc_extraction.py", + "sha256": "e957f38971356883aa8b1fb2975a9e0250d5285f0a4b3c571db7d780296b8dac" + } + }, + { + "original_path": "task/tests/test_schedule_prefix.py", + "stored": { + "bytes": 1965, + "path": "reproduction/files/7a/7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c/test_schedule_prefix.py", + "sha256": "7a3fd8c2af32e0c14c2e5d7de43a5af27055599d524e7a1d16ebd0d36425e23c" + } + }, + { + "original_path": "task/tests/test_screening.py", + "stored": { + "bytes": 9612, + "path": "reproduction/files/2e/2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352/test_screening.py", + "sha256": "2eca9186f691576067f33dda6fec9f7c53201dfc29654f1fe6b24c0b63faf352" + } + }, + { + "original_path": "task/tests/test_seed_comparison.py", + "stored": { + "bytes": 6739, + "path": "reproduction/files/54/54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01/test_seed_comparison.py", + "sha256": "54658d9fd2ef7414257e513ce23e7573b89ce6b6ad2689dde2c6142594309a01" + } + }, + { + "original_path": "task/tests/test_selection.py", + "stored": { + "bytes": 3883, + "path": "reproduction/files/ec/ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4/test_selection.py", + "sha256": "ec22408d51ff09693be835db56a0fee19276c749066eaf6d958f783f6e9f5fd4" + } + }, + { + "original_path": "task/tests/test_sharded_launcher.py", + "stored": { + "bytes": 3509, + "path": "reproduction/files/83/83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8/test_sharded_launcher.py", + "sha256": "83eb47a2732b13efe1042a44a3eb4b2fa58e7da8be2fd6ba72ced591572b25f8" + } + }, + { + "original_path": "task/tests/test_sharding.py", + "stored": { + "bytes": 4230, + "path": "reproduction/files/06/06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62/test_sharding.py", + "sha256": "06574a519731708f2dbb71ebeb491fbdf3114f4d7af8b9eb121da35fd30c1b62" + } + }, + { + "original_path": "task/tests/test_staged_verifier.py", + "stored": { + "bytes": 7458, + "path": "reproduction/files/fc/fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4/test_staged_verifier.py", + "sha256": "fc3df6723f3a24a00c4cb2ba9e1b3c3c5f79e8244122b1f11d918382ba99b4b4" + } + }, + { + "original_path": "task/tests/test_trainval_extract.py", + "stored": { + "bytes": 2270, + "path": "reproduction/files/7d/7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa/test_trainval_extract.py", + "sha256": "7dca5604e270c52dd2687b3cac0f42ac41bc73a6bf2ae845936dfcdf391c6bfa" + } + } + ] + } + }, + "finalization": { + "files": [ + { + "bytes": 21703, + "original_sha256": "65976236d69a201afc6ae3e7b91718db44e96d7ea5a2427690cdc1e1e98f8878", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/trajectory.jsonl", + "redactions": 0, + "sha256": "65976236d69a201afc6ae3e7b91718db44e96d7ea5a2427690cdc1e1e98f8878" + }, + { + "bytes": 83, + "original_sha256": "23a5fbd0010bef7317f724b0515a608484ff37939929d8e7b3a8e344e821f014", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/codex.stderr", + "redactions": 0, + "sha256": "23a5fbd0010bef7317f724b0515a608484ff37939929d8e7b3a8e344e821f014" + }, + { + "bytes": 3161, + "original_sha256": "e5ab2edb505e1a10645a7191b625c535a782e71e8a7b32ee9c1dfd7f0d178a4e", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/publication-review.json", + "redactions": 0, + "sha256": "e5ab2edb505e1a10645a7191b625c535a782e71e8a7b32ee9c1dfd7f0d178a4e" + }, + { + "bytes": 880, + "original_sha256": "d33e172bf4eb94509c4ed3e471045742926dff1575bc36f0a5a1bddd83f04d61", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/status.json", + "redactions": 0, + "sha256": "d33e172bf4eb94509c4ed3e471045742926dff1575bc36f0a5a1bddd83f04d61" + }, + { + "bytes": 1066, + "original_sha256": "342831a2ba581515a963e4b88ab9f53ec1d65698eb6378183197e568b4e34446", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/prompt.txt", + "redactions": 0, + "sha256": "342831a2ba581515a963e4b88ab9f53ec1d65698eb6378183197e568b4e34446" + } + ], + "label": "48h-plus-5m-submission-only", + "package": { + "checkpoint": "GRACE_FINAL", + "destination": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "LICENSE-OlmoEarth", + "stored": { + "bytes": 7091, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/LICENSE-OlmoEarth", + "sha256": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + } + }, + { + "kind": "file", + "mode": 420, + "name": "config.json", + "stored": { + "bytes": 1019, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/config.json", + "sha256": "14ca568126832cf80a45bbe4e18b523111f015bdc4b52711101ba42c20f2cbf7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "encoder.pt", + "stored": { + "bytes": 1260716723, + "path": "shared/package-files/53/53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d/encoder.pt", + "sha256": "53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d" + } + }, + { + "kind": "file", + "mode": 420, + "name": "infer.py", + "stored": { + "bytes": 7602, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/infer.py", + "sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "provenance.json", + "stored": { + "bytes": 5585, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/finalization/submission/provenance.json", + "sha256": "f65c65d09e202a3ad0bd35e10607a706a7a80a5444814b99a52d0138dabe00a6" + } + } + ], + "fingerprint": "fc39dd7e9cbcda09fcb986beaeb0c1d09f8f1de723619e7e31f4661e2d4fcf21", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "publication_seconds": 22.896973808994517, + "same_inference_candidate_as": "S005" + }, + "images": [ + { + "beaker": "01M5BEX9XW54JTE6REJ2CVY2T9" + } + ], + "launch": { + "astra_trial_with_same_setup": "earth-astra-xhigh-48h-20261020a", + "data_mounts": [ + "/task-data/19837", + "/task-data/eval" + ], + "operator_sha256": { + "cacert.pem": "ecd9dc38bc3efb7dbd6431f57e29d2f8d6a0f0d211e1464b3fef2cbfe266fcd2", + "claude": "dabafec82ca1319fa43d8be36a10fc61b1d11821cb98ad5df04ad95e199b8eed", + "claude_bootstrap.py": "7126f035d2ee3f43e00d28cd019120b689ec37c412a1b0814ec9466f3739e932", + "claude_proxy.py": "cb524da8680a33ea723517d215ce65fe00e4da74a9f8d6b54218a9e83a7fb36b", + "claude_sandbox.py": "04ce0750d01367d8e8ac19aa574666a188d749238c9e6fa7636ca8e0af19a6f9", + "protein_design_bootstrap.py": "953e8b4e9f978929e86ec3e04b6bbcc0e79ccbe71bb559d560bdf7cf73660089", + "rerun_helpers.py": "df3ceaf0117a55daccdbbd0bbdfc6801bc57a9cd80a5e607e6564eca9e5c75e1", + "weather_bootstrap.py": "444864a7b4006fcb7cb8318a84f8a692319bcab63815ebf1bdfaa1347dd9a6f1" + } + }, + "logs": [ + { + "bytes": 24329152, + "original_sha256": "142f8628dfb063dc2ba34f2c8024f35abcae558c372c8212f5905c24cf58c56b", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/trajectory.jsonl", + "redactions": 0, + "sha256": "142f8628dfb063dc2ba34f2c8024f35abcae558c372c8212f5905c24cf58c56b" + }, + { + "bytes": 415, + "original_sha256": "76280110d176363f5ed0ecb93b908e9d25186758ea080361bdc12415b1c1b844", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/codex.stderr", + "redactions": 0, + "sha256": "76280110d176363f5ed0ecb93b908e9d25186758ea080361bdc12415b1c1b844" + }, + { + "bytes": 13092, + "original_sha256": "be093c5a0764014cce6a1a1e6610795bc733312a9968f3d47818264782471dfd", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/preflight.jsonl", + "redactions": 0, + "sha256": "be093c5a0764014cce6a1a1e6610795bc733312a9968f3d47818264782471dfd" + }, + { + "bytes": 83, + "original_sha256": "23a5fbd0010bef7317f724b0515a608484ff37939929d8e7b3a8e344e821f014", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/preflight.stderr", + "redactions": 0, + "sha256": "23a5fbd0010bef7317f724b0515a608484ff37939929d8e7b3a8e344e821f014" + }, + { + "bytes": 31523134, + "original_sha256": "6b0ceaf362212155032ebaf6ebb65f7feeb003ac4d69373ff5cd805f63a6753c", + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/sessions/-workspace/8ed4bd89-09a1-4482-ac6e-eec82bef878b.jsonl", + "redactions": 0, + "sha256": "6b0ceaf362212155032ebaf6ebb65f7feeb003ac4d69373ff5cd805f63a6753c" + } + ], + "model": "claude-fable-5-2", + "model_requested": "claude-fable-5-2", + "packages": { + "S001": { + "checkpoint": "S001", + "destination": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "LICENSE-OlmoEarth", + "stored": { + "bytes": 7091, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/LICENSE-OlmoEarth", + "sha256": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + } + }, + { + "kind": "file", + "mode": 420, + "name": "config.json", + "stored": { + "bytes": 1019, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/config.json", + "sha256": "b3ed41322df55fcc2314a868bd160ec6e98b451caf2851e36f788d3b00966ddd" + } + }, + { + "kind": "file", + "mode": 420, + "name": "encoder.pt", + "stored": { + "bytes": 1231234419, + "path": "shared/package-files/0a/0a2a0774238edad52f218f4878bb6b557c97c6b02b70aa81cf10144c845e0a44/encoder.pt", + "sha256": "0a2a0774238edad52f218f4878bb6b557c97c6b02b70aa81cf10144c845e0a44" + } + }, + { + "kind": "file", + "mode": 420, + "name": "infer.py", + "stored": { + "bytes": 7602, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/infer.py", + "sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "provenance.json", + "stored": { + "bytes": 577, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/provenance.json", + "sha256": "8141a3713cba2ece45d49c32ec17cccc841f153d3802dfae67655ab46c2ccb02" + } + } + ], + "fingerprint": "dbe0c217aee3a9beae0ad4ab9be6f2f56579920b020559867b9d971896ec9a1a", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S002": { + "checkpoint": "S002", + "destination": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "LICENSE-OlmoEarth", + "stored": { + "bytes": 7091, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/LICENSE-OlmoEarth", + "sha256": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + } + }, + { + "kind": "file", + "mode": 420, + "name": "config.json", + "stored": { + "bytes": 1019, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/config.json", + "sha256": "59cb8deb04380941babfc46a0202319557779ebc98f78407dcfb38fab483ddbc" + } + }, + { + "kind": "file", + "mode": 420, + "name": "encoder.pt", + "stored": { + "bytes": 355884723, + "path": "shared/package-files/c1/c11119660a7ded1e02651bbac9a7b6803bbdbbeef4e0af5649b1d37ba34f2987/encoder.pt", + "sha256": "c11119660a7ded1e02651bbac9a7b6803bbdbbeef4e0af5649b1d37ba34f2987" + } + }, + { + "kind": "file", + "mode": 420, + "name": "infer.py", + "stored": { + "bytes": 7602, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/infer.py", + "sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "provenance.json", + "stored": { + "bytes": 3103, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/provenance.json", + "sha256": "6e9726aa4eb31cead1e395ef55f4c9192887fe57e6c3f4d7834d173127ca0106" + } + } + ], + "fingerprint": "7a71a4f7bfc4c0d49e4174c2b6e18fea4c0c8a0a68421ab054063181a4bf3627", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S003": { + "checkpoint": "S003", + "destination": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "LICENSE-OlmoEarth", + "stored": { + "bytes": 7091, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/LICENSE-OlmoEarth", + "sha256": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + } + }, + { + "kind": "file", + "mode": 420, + "name": "config.json", + "stored": { + "bytes": 1019, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/config.json", + "sha256": "59cb8deb04380941babfc46a0202319557779ebc98f78407dcfb38fab483ddbc" + } + }, + { + "kind": "file", + "mode": 420, + "name": "encoder.pt", + "stored": { + "bytes": 355884723, + "path": "shared/package-files/28/28fb2ee96ba6d432a29103db18f9669418d6fddf4148dd1448525fb2588fb2ab/encoder.pt", + "sha256": "28fb2ee96ba6d432a29103db18f9669418d6fddf4148dd1448525fb2588fb2ab" + } + }, + { + "kind": "file", + "mode": 420, + "name": "infer.py", + "stored": { + "bytes": 7602, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/infer.py", + "sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "provenance.json", + "stored": { + "bytes": 3105, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/provenance.json", + "sha256": "876e706cbf5eb4a9d3564ec109b3874c5ed9386d2cbf32ad141acd1279e6b000" + } + } + ], + "fingerprint": "ae4ba11a70da048d6fc2d80aa87286aa9a9436204b23d72272be7936164cc290", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S004": { + "checkpoint": "S004", + "destination": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "LICENSE-OlmoEarth", + "stored": { + "bytes": 7091, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/LICENSE-OlmoEarth", + "sha256": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + } + }, + { + "kind": "file", + "mode": 420, + "name": "config.json", + "stored": { + "bytes": 1019, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/config.json", + "sha256": "14ca568126832cf80a45bbe4e18b523111f015bdc4b52711101ba42c20f2cbf7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "encoder.pt", + "stored": { + "bytes": 1260716723, + "path": "shared/package-files/bc/bc3e19e0ca03d5b19044b3293cfa986da4d91ca439ee352275da1a02d704d14d/encoder.pt", + "sha256": "bc3e19e0ca03d5b19044b3293cfa986da4d91ca439ee352275da1a02d704d14d" + } + }, + { + "kind": "file", + "mode": 420, + "name": "infer.py", + "stored": { + "bytes": 7602, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/infer.py", + "sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "provenance.json", + "stored": { + "bytes": 3740, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/provenance.json", + "sha256": "e52c0a4bcb372ab3d830eaf3466745851d0c6f8965c3a688c2978a7158a3e461" + } + } + ], + "fingerprint": "832b629aff1f3d5408cd3097af318c0d3b6b48b437f51f13cc3994a986c3c7af", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S005": { + "checkpoint": "S005", + "destination": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "LICENSE-OlmoEarth", + "stored": { + "bytes": 7091, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/LICENSE-OlmoEarth", + "sha256": "8836c30b00c12e5a4e9a4b681f85cc37a6e2cb150fd1d9795ef9f2767d945077" + } + }, + { + "kind": "file", + "mode": 420, + "name": "config.json", + "stored": { + "bytes": 1019, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/config.json", + "sha256": "14ca568126832cf80a45bbe4e18b523111f015bdc4b52711101ba42c20f2cbf7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "encoder.pt", + "stored": { + "bytes": 1260716723, + "path": "shared/package-files/53/53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d/encoder.pt", + "sha256": "53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d" + } + }, + { + "kind": "file", + "mode": 420, + "name": "infer.py", + "stored": { + "bytes": 7602, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/infer.py", + "sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "provenance.json", + "stored": { + "bytes": 5585, + "path": "tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/provenance.json", + "sha256": "f65c65d09e202a3ad0bd35e10607a706a7a80a5444814b99a52d0138dabe00a6" + } + } + ], + "fingerprint": "fc39dd7e9cbcda09fcb986beaeb0c1d09f8f1de723619e7e31f4661e2d4fcf21", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + } + }, + "reasoning": "xhigh", + "research_budget_seconds": 172800, + "research_resources_requested": [ + { + "cpuCount": 64, + "gpuCount": 1, + "memory": "128GiB", + "sharedMemory": "8GiB" + } + ], + "research_seconds": 172800, + "run": "earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b", + "schema": "science-speedrun-results/v1", + "scoring_hardware": { + "clusters": [ + "ai2/ceres" + ], + "decided_utc": "2026-11-11T21:13:34.757555+00:00", + "gpu_type": "h100", + "gpus_per_job": "upstream verifier count", + "one_gpu_basis": null, + "rule": "one GPU type for every scoring job of a task (user ruling 2026-11-11)", + "task": "earth-observation-pretraining-transfer" + }, + "snapshots": [ + { + "evaluation": "S001", + "evaluation_key": "full:dbe0c217aee3a9beae0ad4ab9be6f2f56579920b020559867b9d971896ec9a1a", + "original_package_fingerprint": "dbe0c217aee3a9beae0ad4ab9be6f2f56579920b020559867b9d971896ec9a1a", + "package": "S001", + "recorded_snapshot_seconds": 245, + "research_seconds": 245, + "score_origin": "measured", + "snapshot": "S001" + }, + { + "evaluation": "S002", + "evaluation_key": "full:7a71a4f7bfc4c0d49e4174c2b6e18fea4c0c8a0a68421ab054063181a4bf3627", + "original_package_fingerprint": "7a71a4f7bfc4c0d49e4174c2b6e18fea4c0c8a0a68421ab054063181a4bf3627", + "package": "S002", + "recorded_snapshot_seconds": 4515, + "research_seconds": 4515, + "score_origin": "measured", + "snapshot": "S002" + }, + { + "evaluation": "S003", + "evaluation_key": "full:ae4ba11a70da048d6fc2d80aa87286aa9a9436204b23d72272be7936164cc290", + "original_package_fingerprint": "ae4ba11a70da048d6fc2d80aa87286aa9a9436204b23d72272be7936164cc290", + "package": "S003", + "recorded_snapshot_seconds": 8179, + "research_seconds": 8179, + "score_origin": "measured", + "snapshot": "S003" + }, + { + "evaluation": "S004", + "evaluation_key": "full:832b629aff1f3d5408cd3097af318c0d3b6b48b437f51f13cc3994a986c3c7af", + "original_package_fingerprint": "832b629aff1f3d5408cd3097af318c0d3b6b48b437f51f13cc3994a986c3c7af", + "package": "S004", + "recorded_snapshot_seconds": 28176, + "research_seconds": 28176, + "score_origin": "measured", + "snapshot": "S004" + }, + { + "evaluation": "S005", + "evaluation_key": "full:fc39dd7e9cbcda09fcb986beaeb0c1d09f8f1de723619e7e31f4661e2d4fcf21", + "original_package_fingerprint": "fc39dd7e9cbcda09fcb986beaeb0c1d09f8f1de723619e7e31f4661e2d4fcf21", + "package": "S005", + "recorded_snapshot_seconds": 59959, + "research_seconds": 59959, + "score_origin": "measured", + "snapshot": "S005" + } + ], + "source_commit": null, + "task": "earth-observation-pretraining-transfer" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/codex.stderr b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/codex.stderr new file mode 100644 index 0000000000000000000000000000000000000000..087a1f488db18d4908cf1ecc88e2bddec2c11cc1 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/codex.stderr @@ -0,0 +1,5 @@ +[claude-code:unrecognized_model] {"model":"claude-fable-5-2","query_source":"sdk"} +[claude-code:unrecognized_model] {"model":"claude-fable-5-2","query_source":"sdk"} +[claude-code:unrecognized_model] {"model":"claude-fable-5-2","query_source":"sdk"} +[claude-code:unrecognized_model] {"model":"claude-fable-5-2","query_source":"sdk"} +[claude-code:unrecognized_model] {"model":"claude-fable-5-2","query_source":"sdk"} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/preflight.jsonl b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/preflight.jsonl new file mode 100644 index 0000000000000000000000000000000000000000..b9216c96e69a9f04e1d54ad9a6d041f21d80637b --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/preflight.jsonl @@ -0,0 +1,10 @@ +{"type":"system","subtype":"init","cwd":"/workspace","session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1","tools":["Task","Bash","CronCreate","CronDelete","CronList","Edit","EnterWorktree","ExitWorktree","ListAgents","Monitor","NotebookEdit","Read","ReportFindings","ScheduleWakeup","SendMessage","Skill","TaskStop","ToolSearch","Workflow","Write"],"mcp_servers":[],"model":"claude-fable-5-2","permissionMode":"bypassPermissions","slash_commands":["deep-research","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","claude-api","workflow-authoring","run","run-skill-generator","plugin-authoring","agents","auto-mode-setup","autocompact","clear","color","compact","config","output-style","context","effort","fast","focus","heapdump","init","mcp","model","__remote-workflow","workflow-launch-exec","reload-plugins","reload-skills","rename","security-review","usage","insights","recap","goal","list-agents","team-onboarding"],"terminal_slash_commands":["doctor","color","focus","reload-plugins"],"apiKeySource":"ANTHROPIC_API_KEY","claude_code_version":"2.1.319","output_style":"default","agents":["claude","Explore","general-purpose","Plan","statusline-setup"],"skills":["deep-research","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","claude-api","workflow-authoring","run","run-skill-generator","plugin-authoring"],"plugins":[{"name":"cc-plugin-sec-default","path":"builtin","source":"cc-plugin-sec-default@builtin"},{"name":"cc-plugin-agents-md","path":"builtin","source":"cc-plugin-agents-md@builtin"},{"name":"cc-plugin-privacy","path":"builtin","source":"cc-plugin-privacy@builtin"},{"name":"cc-plugin-plugin-authoring","path":"builtin","source":"cc-plugin-plugin-authoring@builtin"}],"capabilities":["interrupt_receipt_v1","interrupt_cancel_queued_v1","interrupt_send_now_v1","interrupt_requeue_taken_v1","msg_lifecycle_v1","request_marker_lists_v1","ask_user_question_unanswered_v1","lifecycle_wakeup_source_v1","sdk_mcp_tools_list_changed","sdk_mcp_manifests","mcp_read_resource_v1","mcp_tool_ui_meta_v1","ui_surface_v1","mcp_call_result_not_for_model_v1","mcp_call_check_permissions_v1"],"analytics_disabled":true,"product_feedback_disabled":true,"uuid":"522d7e7b-3f03-4505-b6c3-1f1ecf5efcbe","memory_paths":{"auto":"/run-state/agent/claude/projects/-workspace/memory/"},"original_cwd":"/workspace","additional_directories":[],"messaging_socket_path":"/tmp/cc-socks/17.sock","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","per_turn_effort_active":false,"ultrathink_available":false,"ultrathink_typed_raises":false,"view_mode":"default"} +{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011CgxCYTp11Y79DrQG2uGnb","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01KCXCy4GjVKUfHPT1ke5bmZ","name":"Bash","input":{"command":"python /opt/speedrun/probe.py","description":"Run the environment preflight probe script"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":3942,"cache_read_input_tokens":12899,"cache_creation":{"ephemeral_5m_input_tokens":3942,"ephemeral_1h_input_tokens":0},"output_tokens":16,"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1","uuid":"a4acdf27-767b-4b57-879f-03db1771904d","timestamp":"2026-11-12T01:53:58.684Z","request_id":"req_011CgxCYTc6JbixzGZztPmgG"} +{"type":"system","subtype":"task_started","task_id":"br18396ph","run_id":"0mwcw9r4o-ea156ef6","tool_use_id":"toolu_01KCXCy4GjVKUfHPT1ke5bmZ","description":"Run the environment preflight probe script","is_backgrounded":false,"task_type":"local_bash","uuid":"3096799e-045d-449a-ba79-5fbec50a192f","session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1"} +{"type":"system","subtype":"task_notification","task_id":"br18396ph","run_id":"0mwcw9r4o-ea156ef6","tool_use_id":"toolu_01KCXCy4GjVKUfHPT1ke5bmZ","status":"completed","output_file":"","summary":"Run the environment preflight probe script","uuid":"037e892e-23ef-4774-b396-418da31309dd","session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1"} +{"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01KCXCy4GjVKUfHPT1ke5bmZ","type":"tool_result","content":"{\"gpu_name\": \"NVIDIA H100 80GB HBM3\", \"visible_gpus\": 1, \"cuda_ok\": true, \"imports_ok\": true, \"network_blocked\": true, \"ipv4_blocked\": true, \"ipv6_blocked\": true, \"unix_ipc_ok\": true, \"network_error\": \"[Errno 1] Operation not permitted\", \"task\": \"earth-observation-pretraining-transfer\", \"atomic_exchange_ok\": true, \"development_data_ok\": true, \"pretrain_samples\": 19837, \"development_rows\": {\"awf\": {\"train\": 1115, \"val\": 344}, \"lfmc\": {\"train\": 31175, \"val\": 8262}}, \"test_rows\": 0, \"data_readonly\": true, \"gpu_device_access_isolated\": true, \"denied_gpu_device_count\": 2, \"extra_gpu_cuda_override_rejected\": true}","is_error":false}]},"parent_tool_use_id":null,"session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1","uuid":"ce5e72c3-45eb-4e70-9d63-edbcc11d4cdb","timestamp":"2026-11-12T01:54:09.090Z","tool_use_result":{"stdout":"{\"gpu_name\": \"NVIDIA H100 80GB HBM3\", \"visible_gpus\": 1, \"cuda_ok\": true, \"imports_ok\": true, \"network_blocked\": true, \"ipv4_blocked\": true, \"ipv6_blocked\": true, \"unix_ipc_ok\": true, \"network_error\": \"[Errno 1] Operation not permitted\", \"task\": \"earth-observation-pretraining-transfer\", \"atomic_exchange_ok\": true, \"development_data_ok\": true, \"pretrain_samples\": 19837, \"development_rows\": {\"awf\": {\"train\": 1115, \"val\": 344}, \"lfmc\": {\"train\": 31175, \"val\": 8262}}, \"test_rows\": 0, \"data_readonly\": true, \"gpu_device_access_isolated\": true, \"denied_gpu_device_count\": 2, \"extra_gpu_cuda_override_rejected\": true}","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_01KCXCy4GjVKUfHPT1ke5bmZ","permission_decision":{"decision":"accept","source":"config","reason_type":"mode"}}]} +{"type":"system","subtype":"thinking_tokens","estimated_tokens":50,"estimated_tokens_delta":50,"session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1","uuid":"2e32aa24-ef6d-4425-93ff-20138bc39781"} +{"type":"system","subtype":"thinking_tokens","estimated_tokens":270,"estimated_tokens_delta":220,"session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1","uuid":"5f185505-d892-4e14-839f-0abb3b8afded"} +{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011CgxCZUAMj4WKCMcc73oo9","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"","signature":"CAQSrAgKEAgTGAI4AUIIdGhpbmtpbmcSDGpU6ML9egAbSQKe0BoMho+5jwj0PSVang4JIjDhZp4KODYPaytLJTH4kbC7cCTKcG/7bHWGHgNwr1wH1icKsENplxCuADOkx18ptWYqyQfSkfrHMrlUauCdIbB815y7qSDDUJaFNIcRGQJx8tmXZDiKlyA5F8ncuL3lVAYKfT8ieO1PwJ+wMqOyKLzu2JoN4FhRpk/EpewSpR5lycnjZYHqMbYoRtky5jPJuJnwNzVOvYHn2Y/WKwU3LIZPIM2FvDT3TLeWpKioQoovItfYzlR5ki6HJr9/ZYXFlx5Bb2va/2zSb60iiux+FML0Ko3rs2EZYzMr1teWgl2J2HoGXOt6yBMRTih9do9Jz0LhYLTmlh+pgX71VvEeRdh2+2MgE4oKnEhLBnpb+8ij0jXLiBDh3DwWeDg8VOKLmdXHE0p9wAzuTyxzSBss8YWHug45mcxYvm/fUYG2xHcG5agpao5x3322uVBgW4Cvoj2P7z4a42gkw1eV6p58gGmuB0gU50K9dezFdBlBs4QRmpCABGban1jm6NAp/+WFa74403DxIwPPCoHwVal968Ogcic7h0Hsgze+udeMZBZAGPqIx1KTmeLVDIdGMccDeWda0pZFcG/t433dS2b4XBuOe/FKIwrxyF1G4qKKA/6Hoijv4Ak7ImnyBB9j/QzeQn+Cqn6vKmPcse5Yl4b9n4OtSQEYO10X7k0bz4R1WYENsVNOY1UlU20yy7jOkLGhvZ71BsAGHUxb7sQwEoiasTxtaC8PIhvwGOr5V7pOBW+/St8N1dJG8zgaA8ZPsgvKh6TgZ7Hqc/lXSTVzOeCQrpbCUHuFegOfOng0a6sbBC2OeIjWKFKdO3/IJNzszAOmFPT0Hx5QOJFMBeh+0EaBJdkaLrJR8Rt9cGJzA7TOSUf84gr/c4K3s28/LRyHa4XWSgE40NvI+CzuNXcowvN6jwdXlaDe4McWsd+5BlrTYj/2ofAkNWfLyehbWdJqNgwtXhRuNa989L1tLSnWBS+7FMnOTCIx53b9mZMcLIMbEsoombfhCMxlNsF+GovL4ZZaXusRkC8w8QJtQO/EFjXFj4/4mAtpmcLUPXefTXZ9usvS7iIV7Y6FloKsLCMjnyCRgmAZSTIRMVnpHvqBQMln0Tr0MXzB2rO25+ip7g+quzfj83+yZrDQQRhmMgfGiJWkq3g9p+RUgmJ2/4g6Hv9d8MgWdd/MEehXLHy0NQEPywHdGczU0y/EiUHXwo/ViiXqYdK5e08YBsm9NXkkGP3tHpx9Z2yAm3InF/mLymVLtbO2nrPp7QCGhr0AdA1WiaY993OVZVDmhcLeHF2tPWR+FC4o5YzmsYrJBXkU7rDQhQ6g46RN0S+vrpEjcZKMTKq7YplerGD3UtrjL44kkA8YAQ=="}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":392,"cache_read_input_tokens":16841,"cache_creation":{"ephemeral_5m_input_tokens":392,"ephemeral_1h_input_tokens":0},"output_tokens":8,"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1","uuid":"4099ba6b-790b-403c-afda-c3629d015183","timestamp":"2026-11-12T01:54:15.768Z","request_id":"req_011CgxCZTyhWqAopi76qUZXa","thinking_duration_ms":3855,"thinking_display":"updates"} +{"type":"assistant","message":{"model":"claude-fable-5-2","id":"msg_011CgxCZUAMj4WKCMcc73oo9","type":"message","role":"assistant","content":[{"type":"text","text":"PREFLIGHT_OK\n\nThe probe exited cleanly and reported:\n\n- **CUDA:** OK, with one visible GPU (NVIDIA H100 80GB); the two other GPU devices are denied and the override attempt was rejected.\n- **Task imports:** OK for `earth-observation-pretraining-transfer`.\n- **Networking:** blocked on both IPv4 and IPv6 (`Operation not permitted`); Unix IPC still works.\n- **Workspace write:** there is no field named for it; the closest is `atomic_exchange_ok: true`, which I'm reading as that check.\n- **Data:** read-only, with 19,837 pretrain samples, AWF 1,115 train / 344 val rows, LFMC 31,175 train / 8,262 val rows, and 0 test rows."}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":392,"cache_read_input_tokens":16841,"cache_creation":{"ephemeral_5m_input_tokens":392,"ephemeral_1h_input_tokens":0},"output_tokens":8,"service_tier":"standard","inference_geo":"global","speed":"standard"},"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1","uuid":"65b31826-ce88-420c-8601-58ae0cf551cd","timestamp":"2026-11-12T01:54:15.772Z","request_id":"req_011CgxCZTyhWqAopi76qUZXa"} +{"duration_api_ms":9954,"stop_reason":"end_turn","session_id":"d6646fde-c96f-4369-88d5-aa1412779ab1","total_cost_usd":0.038074000000000004,"usage":{"input_tokens":4,"cache_creation_input_tokens":4334,"cache_read_input_tokens":29740,"output_tokens":522,"output_tokens_details":{"thinking_tokens":160},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":0,"ephemeral_5m_input_tokens":4334},"inference_geo":"global","iterations":[],"speed":"standard","fallback_credit":null},"modelUsage":{"claude-fable-5-2":{"inputTokens":4,"outputTokens":522,"cacheReadInputTokens":29740,"cacheCreationInputTokens":4334,"webSearchRequests":0,"costUSD":0.038074000000000004,"contextWindow":200000,"maxOutputTokens":32000,"thinkingTokens":160,"cacheCreationEphemeral5mInputTokens":4334,"cacheCreationEphemeral1hInputTokens":0,"canonicalModel":"claude-fable-5-2","provider":"firstParty","costBasis":"unknown"}},"permission_denials":[],"terminal_reason":"completed","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","subagent_stats":{"spawned":0,"requested":{"background":0,"foreground":0,"unset":0},"started_in_background":0,"max_depth":0,"spawned_by_subagents":0,"completed":0,"failed":0,"killed":{"parent":0,"user":0,"system":0},"refused":{"depth_limit":0,"concurrency_limit":0,"budget":0},"by_type":{}},"safety_stops":0,"is_error":false,"num_turns":2,"subtype":"success","api_error_status":null,"result":"PREFLIGHT_OK\n\nThe probe exited cleanly and reported:\n\n- **CUDA:** OK, with one visible GPU (NVIDIA H100 80GB); the two other GPU devices are denied and the override attempt was rejected.\n- **Task imports:** OK for `earth-observation-pretraining-transfer`.\n- **Networking:** blocked on both IPv4 and IPv6 (`Operation not permitted`); Unix IPC still works.\n- **Workspace write:** there is no field named for it; the closest is `atomic_exchange_ok: true`, which I'm reading as that check.\n- **Data:** read-only, with 19,837 pretrain samples, AWF 1,115 train / 344 val rows, LFMC 31,175 train / 8,262 val rows, and 0 test rows.","ttft_ms":3326,"type":"result","duration_ms":20421,"uuid":"073b5294-5ecf-444a-8ee6-cf80e8dfd66b","ttft_stream_ms":2805,"time_to_request_ms":81,"first_content_frame_ms":2805,"queued_turn_count":0,"result_index":0,"model_usage_since_last_result":{"claude-fable-5-2":{"inputTokens":4,"outputTokens":522,"cacheReadInputTokens":29740,"cacheCreationInputTokens":4334,"webSearchRequests":0,"costUSD":0.038074000000000004,"contextWindow":200000,"maxOutputTokens":32000,"thinkingTokens":160,"cacheCreationEphemeral5mInputTokens":4334,"cacheCreationEphemeral1hInputTokens":0,"canonicalModel":"claude-fable-5-2","provider":"firstParty","costBasis":"unknown"}}} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/preflight.stderr b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/preflight.stderr new file mode 100644 index 0000000000000000000000000000000000000000..bf0334f998f924ebe8de60c292a936a6c8addec7 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/logs/preflight.stderr @@ -0,0 +1 @@ +[claude-code:unrecognized_model] {"model":"claude-fable-5-2","query_source":"sdk"} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/LICENSE-OlmoEarth b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/LICENSE-OlmoEarth new file mode 100644 index 0000000000000000000000000000000000000000..f764333f593fbb8103a98875d9eb17b534614eb0 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/LICENSE-OlmoEarth @@ -0,0 +1,127 @@ +OlmoEarth Artifact License + +By exercising the rights granted to you under this OlmoEarth Artifact License +("Agreement"), you accept and agree to its terms and conditions and enter into this +Agreement with The Allen Institute for Artificial Intelligence ("Ai2"). All references +to "you" herein means both an individual and legal entity that an individual is acting +on behalf of. + +Subject to your compliance with this Agreement, Ai2 grants you permission, free of +charge, to use the machine learning artifacts, materials, and documentation provided by +Ai2 under this Agreement as follows (collectively, "Artifacts"): + +- Model weights, including architecture and parameters ("Model"); +- Associated dataset or collection of data in connection with the Model ("Dataset"); and/or +- Associated software to process and run the Dataset and Model, including code in + source or binary form for training, inference, and evaluation ("Code"). + +1. Use Rights + +Subject to the terms in Section 2 and 3 below, you may: + +(a) Use, reproduce, modify, display and distribute the Artifacts, in whole or in part; +(b) Create any other machine learning models, datasets, and derivative works that are + derived from or based on the Artifacts, including by (i) transfer of patterns of + the weights, parameters, operations, or outputs of the Model, (ii) generating + outputs of the Model to produce synthetic data, and (iii) using Code to prepare any + work of authorship (collectively, "Derivatives"); and +(c) Publish and share Derivatives. + +2. Use Restrictions + +You will not (and will not encourage, permit, or facilitate any others to) use any +portion of the Artifacts or Derivatives for the following purposes: + +(a) Any military and defense-related applications and use cases, including without + limitation, for weapons development, military operations, intelligence gathering, + or human surveillance and policing activities. +(b) Any extractive activities, operations and use cases involving the removal of raw + materials from the earth, including without limitation, to plan or facilitate the + extraction of oil, natural gas and minerals through activities such as drilling, + mining, and deforestation. + +3. Distribution + +In any distribution of the Artifacts or Derivatives: + +(a) You will cite Ai2 as the source of the Artifacts in any distribution of Artifacts + or Derivatives. +(b) If you distribute any portion of the Artifacts, you will either link to or provide + a copy of this Agreement to all third party recipients. +(c) If you distribute any Derivatives, you may add your own intellectual property + notices and apply other licenses and terms of use, provided that you include and + require the use restrictions in Section 2 in all downstream distribution unless Ai2 + provides written approval otherwise. + +4. Termination + +This Agreement will automatically terminate with immediate effect and without notice to +you in the following circumstances: + +(a) Your breach of the use restrictions in Section 2 and any other terms and conditions + herein; or +(b) If you file, maintain, or voluntarily participate in a lawsuit against any person + or entity asserting that the Artifacts or any portion thereof directly or + indirectly infringe any patent, except where a lawsuit is filed in response to a + corresponding lawsuit first brought against you. + +For the avoidance of doubt, Ai2 may also offer the Artifacts under separate terms and +conditions or stop distributing the Artifacts at any time; however, doing so will not +terminate this Agreement. You may continue to use the Artifacts under this Agreement +unless it is terminated in accordance with the circumstances expressly stated herein. + +5. Rights Not Covered + +This Agreement does not cover any patents or trademarks associated with the Artifacts, +including with respect to any individual items of information and materials that are +included or incorporated within a Dataset ("Contents"). Such Contents may be factual +data or independent works such as text, images, audio, and audio visual material. +Contents may be subject to other rights, including copyright, patent, data protection, +privacy, or personality rights, and this Agreement does not cover such rights. The use +rights in Section 1 expressly exclude any and all other rights that may apply to the +Contents of a Dataset. + +6. Disclaimer and Limitation of Liability + +(a) THE ARTIFACTS ARE PROVIDED "AS IS", "AS AVAILABLE", AND "WITH ALL FAULTS", WITHOUT + ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, IMPLIED + WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT, FITNESS FOR A PARTICULAR + PURPOSE, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE + OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. AI2 MAKES NO REPRESENTATIONS OR + WARRANTIES AS TO THE RELIABILITY, COMPLETENESS, QUALITY, PERFORMANCE, + FUNCTIONALITY, OR UTILITY OF ANY ARTIFACTS. ANY USE OF THE ARTIFACTS IS AT YOUR + SOLE RISK AND DISCRETION. YOU ARE SOLELY RESPONSIBLE FOR (1) CLEARING ANY THIRD + PARTY RIGHTS THAT MAY APPLY TO OR BE EMBODIED IN ANY ARTIFACTS, INCLUDING ANY + CONTENTS IN A DATASET; (2) OBTAINING ANY NECESSARY RIGHTS, LICENSES, CONSENTS, OR + PERMISSIONS REQUIRED FOR YOUR USE OF THE ARTIFACTS; AND (3) PERFORMING ANY DUE + DILIGENCE ON THE ARTIFACTS TO VERIFY SUITABILITY FOR YOUR INTENDED USE. + +(b) TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, IN NO EVENT WILL AI2 BE + LIABLE FOR ANY CLAIM, DAMAGES, LOSSES, OR OTHER LIABILITY OF ANY KIND WHATSOEVER, + WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR IN CONNECTION + WITH THE ARTIFACTS OR YOUR USE THEREOF. + +(c) The disclaimers and limitations of liability set forth above will be interpreted in + a manner that, to the greatest extent possible, constitute an absolute disclaimer + and waiver of all liability. + +7. Other Agreements + +If you have entered into a separate written agreement with Ai2 regarding your use of +the specific Artifacts that are subject to this Agreement ("Other Agreement"), the +terms of such Other Agreement will supplement the terms herein. To the extent of any +conflict between the terms of the Other Agreement and this Agreement, the Other +Agreement will take precedence. + +8. Miscellaneous + +If any term or provision of this Agreement is deemed invalid or unenforceable, it will +automatically be reformed to the minimum extent necessary to make it enforceable. To +the extent it cannot be reformed, it will be severed from this Agreement, and the +remaining terms and conditions will remain in full force and effect. Any delay or +failure by Ai2 to take any action or enforce any breach of this Agreement will not be +deemed as a waiver or consent by Ai2. No term or provision of this Agreement will be +waived by Ai2 unless expressly agreed in writing. Nothing in this Agreement constitutes +as a limitation of any privileges, immunities, and rights that apply to you or Ai2 +under applicable laws, including from the legal processes of any jurisdiction or +authority. diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/config.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/config.json new file mode 100644 index 0000000000000000000000000000000000000000..87fa6c0186933943a43354f6264eacafa421bcd6 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/config.json @@ -0,0 +1,40 @@ +{ + "supported_modality_names": [ + "sentinel2_l2a", + "sentinel1", + "landsat", + "worldcover", + "srtm", + "openstreetmap_raster", + "wri_canopy_height_map", + "cdl", + "worldcereal" + ], + "embedding_size": 1024, + "max_patch_size": 8, + "min_patch_size": 1, + "num_heads": 16, + "mlp_ratio": 4.0, + "depth": 24, + "drop_path": 0.1, + "max_sequence_length": 12, + "num_register_tokens": 0, + "learnable_channel_embeddings": true, + "random_channel_embeddings": false, + "num_projection_layers": 1, + "aggregate_then_project": true, + "use_flash_attn": false, + "frozen_patch_embeddings": false, + "qk_norm": false, + "log_token_norm_stats": false, + "use_linear_patch_embed": false, + "band_dropout_rate": 0.0, + "random_band_dropout": false, + "position_encoding": "absolute", + "rope_base": 10000.0, + "rope_coordinate_scale": 1.0, + "rope_mixed_base": 10.0, + "temporal_rope_dim_frac": 0.25, + "rope_temporal_coordinate_scale": 1.0, + "_CLASS_": "olmoearth_pretrain.nn.flexi_vit.EncoderConfig" +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/infer.py b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/infer.py new file mode 100644 index 0000000000000000000000000000000000000000..89e755d822b1da92ac2d76c59ccf79feef9d198e --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/infer.py @@ -0,0 +1,196 @@ +"""Portable frozen OlmoEarth encoder. Input HDF5 has pixels and IDs only.""" + +import argparse +import json +import os +from pathlib import Path +from types import MethodType +import h5py +import numpy as np +import torch +from olmoearth_pretrain.data.constants import Modality +from olmoearth_pretrain.data.normalize import Normalizer, Strategy +from olmoearth_pretrain.datatypes import MaskedOlmoEarthSample +from olmoearth_pretrain.nn.flexi_vit import EncoderConfig +from olmoearth_pretrain.nn.pooling import pool_unmasked_tokens, PoolingType + + +def inference_attention_mask(self, new_mask, fast_pass): + # Upstream v1 discards this padding mask in eval mode, although missing + # observations produce variable sequence lengths. Preserve the training + # attention-mask semantics without enabling dropout or changing weights. + return None if fast_pass else new_mask + + +def configure_inference(model): + model.eval() + model._maybe_get_attn_mask = MethodType(inference_attention_mask, model) + return model + + +def normalized_pixels(h, start, end): + normalizer = Normalizer(Strategy.COMPUTED) + out = {} + for name in ["sentinel2_l2a", "sentinel1"]: + if name not in h: + continue + arr = h[name][start:end].astype(np.float32) + if name == "sentinel1": + arr = 10 * np.log10(np.maximum(arr, 1e-6)) + out[name] = normalizer.normalize(Modality.get(name), arr).astype(np.float32) + return out + + +def embed( + model, pixels, device, patch_size=4, center=False, valid=None, bilinear_point=False +): + batch = len(next(iter(pixels.values()))) + observed = np.zeros(batch, dtype=bool) + for name in pixels: + observed |= ( + valid[name].reshape(batch, -1).any(axis=1) + if valid is not None and name in valid + else True + ) + if not observed.all(): + # No source observations: an explicit no-information vector. Keep the row + # in evaluation; its downstream prediction is determined by the fitted probe. + result = np.zeros((batch, model.embedding_size), dtype=np.float32) + if observed.any(): + result[observed] = embed( + model, + {k: v[observed] for k, v in pixels.items()}, + device, + patch_size=patch_size, + center=center, + bilinear_point=bilinear_point, + valid={k: v[observed] for k, v in valid.items()} + if valid is not None + else None, + ) + return result + kwargs = {} + for name, arr in pixels.items(): + val = torch.from_numpy(arr).to(device) + kwargs[name] = val + spec = Modality.get(name) + mask = torch.zeros( + (*val.shape[:-1], spec.num_band_sets), dtype=torch.int32, device=device + ) + if valid is not None and name in valid: + missing = torch.from_numpy(~valid[name].astype(bool)).to(device) + if missing.ndim == 2: + missing = missing[:, :, None] + mask.masked_fill_(missing[:, None, None, :, :], 3) + kwargs[name + "_mask"] = mask + b, _, _, t, _ = next(iter(pixels.values())).shape + timestamps = torch.zeros((b, t, 3), dtype=torch.int32, device=device) + timestamps[:, :, 0] = 1 + timestamps[:, :, 1] = torch.arange(t, device=device) + timestamps[:, :, 2] = 2024 + kwargs["timestamps"] = timestamps + with ( + torch.inference_mode(), + torch.autocast( + device_type=device.type, dtype=torch.bfloat16, enabled=device.type == "cuda" + ), + ): + result = model( + MaskedOlmoEarthSample(**kwargs), + patch_size=patch_size, + fast_pass=valid is None or all(np.all(v) for v in valid.values()), + )["tokens_and_masks"] + vec = pool_unmasked_tokens(result, PoolingType.MEAN, spatial_pooling=center) + if center: + if bilinear_point: + # AWF's published head upsamples by four before its pointwise + # linear classifier. Sampling here preserves that interpolation. + vec = torch.nn.functional.interpolate( + vec.permute(0, 3, 1, 2), + scale_factor=patch_size, + mode="bilinear", + align_corners=False, + ).permute(0, 2, 3, 1) + vec = vec[:, vec.shape[1] // 2, vec.shape[2] // 2] + if valid: + present = np.stack( + [ + valid[name].reshape(batch, -1).any(axis=1) + if name in valid + else np.ones(batch, dtype=bool) + for name in pixels + ], + axis=1, + ) + # Upstream averages over modalities present anywhere in the + # batch. Average over each sample's observed modalities instead. + scale = present.any(axis=0).sum() / present.sum(axis=1) + vec = ( + vec + * torch.as_tensor(scale, device=device, dtype=vec.dtype)[:, None] + ) + return vec.float().cpu().numpy() + + +def main(): + p = argparse.ArgumentParser() + p.add_argument("--model", type=Path, required=True) + p.add_argument("--input", type=Path, required=True) + p.add_argument("--output", type=Path, required=True) + p.add_argument("--batch-size", type=int, default=16) + p.add_argument("--device", choices=["cpu", "cuda"], default="cuda") + a = p.parse_args() + if ( + a.device == "cuda" + and os.environ.get("EARTH_SLURM_PARTITION") + and os.environ.get("SLURM_JOB_PARTITION") != os.environ["EARTH_SLURM_PARTITION"] + ): + raise RuntimeError("GPU execution requires Slurm configured-gpu-partition") + config = json.loads((a.model / "config.json").read_text()) + model = EncoderConfig.from_dict(config).build() + model.load_state_dict( + torch.load(a.model / "encoder.pt", map_location="cpu", weights_only=True), + strict=True, + ) + configure_inference(model).to(a.device) + with h5py.File(a.input, "r") as h: + ids = h["ids"].asstr()[:] + if h.attrs["task"] not in ("awf", "lfmc"): + raise ValueError("Unknown evaluation task") + bilinear_point = h.attrs["task"] == "awf" + chunks = [] + for start in range(0, len(ids), a.batch_size): + valid = { + name: h[name + "_valid"][start : start + a.batch_size] + for name in ["sentinel2_l2a", "sentinel1"] + if name + "_valid" in h + } + chunks.append( + embed( + model, + normalized_pixels(h, start, start + a.batch_size), + torch.device(a.device), + center=True, + bilinear_point=bilinear_point, + valid=valid, + ) + ) + if start % (a.batch_size * 50) == 0: + print("embedded", start, len(ids), flush=True) + features = np.concatenate(chunks) + if ( + features.shape != (len(ids), config["embedding_size"]) + or not np.isfinite(features).all() + ): + raise ValueError("Invalid embeddings") + a.output.parent.mkdir(parents=True, exist_ok=True) + np.savez(a.output, ids=np.asarray(ids, dtype=str), features=features) + print( + json.dumps( + {"rows": len(ids), "dimension": features.shape[1], "output": str(a.output)} + ) + ) + + +if __name__ == "__main__": + main() diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/provenance.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..60394611bebd47836b8352645b9ebe024707140b --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S001/provenance.json @@ -0,0 +1,16 @@ +{ + "upstream": "0497dfbb6711ded4e6bf10cf089fc1e4d58c186b", + "origin": "random_initialization", + "variant": "v1/large", + "inference_adapter_version": 3, + "infer_sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "initialization_seed": 12536, + "checkpoint": null, + "parameters": 307770368, + "training_recipe": null, + "planned_training_duration": null, + "training_implementation": null, + "training_validity": "not_flagged_invalid", + "data_seed": null, + "encoder_sha256": "0a2a0774238edad52f218f4878bb6b557c97c6b02b70aa81cf10144c845e0a44" +} \ No newline at end of file diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/LICENSE-OlmoEarth b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/LICENSE-OlmoEarth new file mode 100644 index 0000000000000000000000000000000000000000..f764333f593fbb8103a98875d9eb17b534614eb0 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/LICENSE-OlmoEarth @@ -0,0 +1,127 @@ +OlmoEarth Artifact License + +By exercising the rights granted to you under this OlmoEarth Artifact License +("Agreement"), you accept and agree to its terms and conditions and enter into this +Agreement with The Allen Institute for Artificial Intelligence ("Ai2"). All references +to "you" herein means both an individual and legal entity that an individual is acting +on behalf of. + +Subject to your compliance with this Agreement, Ai2 grants you permission, free of +charge, to use the machine learning artifacts, materials, and documentation provided by +Ai2 under this Agreement as follows (collectively, "Artifacts"): + +- Model weights, including architecture and parameters ("Model"); +- Associated dataset or collection of data in connection with the Model ("Dataset"); and/or +- Associated software to process and run the Dataset and Model, including code in + source or binary form for training, inference, and evaluation ("Code"). + +1. Use Rights + +Subject to the terms in Section 2 and 3 below, you may: + +(a) Use, reproduce, modify, display and distribute the Artifacts, in whole or in part; +(b) Create any other machine learning models, datasets, and derivative works that are + derived from or based on the Artifacts, including by (i) transfer of patterns of + the weights, parameters, operations, or outputs of the Model, (ii) generating + outputs of the Model to produce synthetic data, and (iii) using Code to prepare any + work of authorship (collectively, "Derivatives"); and +(c) Publish and share Derivatives. + +2. Use Restrictions + +You will not (and will not encourage, permit, or facilitate any others to) use any +portion of the Artifacts or Derivatives for the following purposes: + +(a) Any military and defense-related applications and use cases, including without + limitation, for weapons development, military operations, intelligence gathering, + or human surveillance and policing activities. +(b) Any extractive activities, operations and use cases involving the removal of raw + materials from the earth, including without limitation, to plan or facilitate the + extraction of oil, natural gas and minerals through activities such as drilling, + mining, and deforestation. + +3. Distribution + +In any distribution of the Artifacts or Derivatives: + +(a) You will cite Ai2 as the source of the Artifacts in any distribution of Artifacts + or Derivatives. +(b) If you distribute any portion of the Artifacts, you will either link to or provide + a copy of this Agreement to all third party recipients. +(c) If you distribute any Derivatives, you may add your own intellectual property + notices and apply other licenses and terms of use, provided that you include and + require the use restrictions in Section 2 in all downstream distribution unless Ai2 + provides written approval otherwise. + +4. Termination + +This Agreement will automatically terminate with immediate effect and without notice to +you in the following circumstances: + +(a) Your breach of the use restrictions in Section 2 and any other terms and conditions + herein; or +(b) If you file, maintain, or voluntarily participate in a lawsuit against any person + or entity asserting that the Artifacts or any portion thereof directly or + indirectly infringe any patent, except where a lawsuit is filed in response to a + corresponding lawsuit first brought against you. + +For the avoidance of doubt, Ai2 may also offer the Artifacts under separate terms and +conditions or stop distributing the Artifacts at any time; however, doing so will not +terminate this Agreement. You may continue to use the Artifacts under this Agreement +unless it is terminated in accordance with the circumstances expressly stated herein. + +5. Rights Not Covered + +This Agreement does not cover any patents or trademarks associated with the Artifacts, +including with respect to any individual items of information and materials that are +included or incorporated within a Dataset ("Contents"). Such Contents may be factual +data or independent works such as text, images, audio, and audio visual material. +Contents may be subject to other rights, including copyright, patent, data protection, +privacy, or personality rights, and this Agreement does not cover such rights. The use +rights in Section 1 expressly exclude any and all other rights that may apply to the +Contents of a Dataset. + +6. Disclaimer and Limitation of Liability + +(a) THE ARTIFACTS ARE PROVIDED "AS IS", "AS AVAILABLE", AND "WITH ALL FAULTS", WITHOUT + ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, IMPLIED + WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT, FITNESS FOR A PARTICULAR + PURPOSE, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE + OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. AI2 MAKES NO REPRESENTATIONS OR + WARRANTIES AS TO THE RELIABILITY, COMPLETENESS, QUALITY, PERFORMANCE, + FUNCTIONALITY, OR UTILITY OF ANY ARTIFACTS. ANY USE OF THE ARTIFACTS IS AT YOUR + SOLE RISK AND DISCRETION. YOU ARE SOLELY RESPONSIBLE FOR (1) CLEARING ANY THIRD + PARTY RIGHTS THAT MAY APPLY TO OR BE EMBODIED IN ANY ARTIFACTS, INCLUDING ANY + CONTENTS IN A DATASET; (2) OBTAINING ANY NECESSARY RIGHTS, LICENSES, CONSENTS, OR + PERMISSIONS REQUIRED FOR YOUR USE OF THE ARTIFACTS; AND (3) PERFORMING ANY DUE + DILIGENCE ON THE ARTIFACTS TO VERIFY SUITABILITY FOR YOUR INTENDED USE. + +(b) TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, IN NO EVENT WILL AI2 BE + LIABLE FOR ANY CLAIM, DAMAGES, LOSSES, OR OTHER LIABILITY OF ANY KIND WHATSOEVER, + WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR IN CONNECTION + WITH THE ARTIFACTS OR YOUR USE THEREOF. + +(c) The disclaimers and limitations of liability set forth above will be interpreted in + a manner that, to the greatest extent possible, constitute an absolute disclaimer + and waiver of all liability. + +7. Other Agreements + +If you have entered into a separate written agreement with Ai2 regarding your use of +the specific Artifacts that are subject to this Agreement ("Other Agreement"), the +terms of such Other Agreement will supplement the terms herein. To the extent of any +conflict between the terms of the Other Agreement and this Agreement, the Other +Agreement will take precedence. + +8. Miscellaneous + +If any term or provision of this Agreement is deemed invalid or unenforceable, it will +automatically be reformed to the minimum extent necessary to make it enforceable. To +the extent it cannot be reformed, it will be severed from this Agreement, and the +remaining terms and conditions will remain in full force and effect. Any delay or +failure by Ai2 to take any action or enforce any breach of this Agreement will not be +deemed as a waiver or consent by Ai2. No term or provision of this Agreement will be +waived by Ai2 unless expressly agreed in writing. Nothing in this Agreement constitutes +as a limitation of any privileges, immunities, and rights that apply to you or Ai2 +under applicable laws, including from the legal processes of any jurisdiction or +authority. diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/config.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/config.json new file mode 100644 index 0000000000000000000000000000000000000000..1fd5af8c6875b60ce12bf58b9c3b349eb5f18891 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/config.json @@ -0,0 +1,40 @@ +{ + "supported_modality_names": [ + "sentinel2_l2a", + "sentinel1", + "landsat", + "worldcover", + "srtm", + "openstreetmap_raster", + "wri_canopy_height_map", + "cdl", + "worldcereal" + ], + "embedding_size": 768, + "max_patch_size": 8, + "min_patch_size": 1, + "num_heads": 12, + "mlp_ratio": 4.0, + "depth": 12, + "drop_path": 0.1, + "max_sequence_length": 12, + "num_register_tokens": 0, + "learnable_channel_embeddings": true, + "random_channel_embeddings": false, + "num_projection_layers": 1, + "aggregate_then_project": true, + "use_flash_attn": false, + "frozen_patch_embeddings": false, + "qk_norm": false, + "log_token_norm_stats": false, + "use_linear_patch_embed": false, + "band_dropout_rate": 0.0, + "random_band_dropout": false, + "position_encoding": "absolute", + "rope_base": 10000.0, + "rope_coordinate_scale": 1.0, + "rope_mixed_base": 10.0, + "temporal_rope_dim_frac": 0.25, + "rope_temporal_coordinate_scale": 1.0, + "_CLASS_": "olmoearth_pretrain.nn.flexi_vit.EncoderConfig" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/infer.py b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/infer.py new file mode 100644 index 0000000000000000000000000000000000000000..89e755d822b1da92ac2d76c59ccf79feef9d198e --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/infer.py @@ -0,0 +1,196 @@ +"""Portable frozen OlmoEarth encoder. Input HDF5 has pixels and IDs only.""" + +import argparse +import json +import os +from pathlib import Path +from types import MethodType +import h5py +import numpy as np +import torch +from olmoearth_pretrain.data.constants import Modality +from olmoearth_pretrain.data.normalize import Normalizer, Strategy +from olmoearth_pretrain.datatypes import MaskedOlmoEarthSample +from olmoearth_pretrain.nn.flexi_vit import EncoderConfig +from olmoearth_pretrain.nn.pooling import pool_unmasked_tokens, PoolingType + + +def inference_attention_mask(self, new_mask, fast_pass): + # Upstream v1 discards this padding mask in eval mode, although missing + # observations produce variable sequence lengths. Preserve the training + # attention-mask semantics without enabling dropout or changing weights. + return None if fast_pass else new_mask + + +def configure_inference(model): + model.eval() + model._maybe_get_attn_mask = MethodType(inference_attention_mask, model) + return model + + +def normalized_pixels(h, start, end): + normalizer = Normalizer(Strategy.COMPUTED) + out = {} + for name in ["sentinel2_l2a", "sentinel1"]: + if name not in h: + continue + arr = h[name][start:end].astype(np.float32) + if name == "sentinel1": + arr = 10 * np.log10(np.maximum(arr, 1e-6)) + out[name] = normalizer.normalize(Modality.get(name), arr).astype(np.float32) + return out + + +def embed( + model, pixels, device, patch_size=4, center=False, valid=None, bilinear_point=False +): + batch = len(next(iter(pixels.values()))) + observed = np.zeros(batch, dtype=bool) + for name in pixels: + observed |= ( + valid[name].reshape(batch, -1).any(axis=1) + if valid is not None and name in valid + else True + ) + if not observed.all(): + # No source observations: an explicit no-information vector. Keep the row + # in evaluation; its downstream prediction is determined by the fitted probe. + result = np.zeros((batch, model.embedding_size), dtype=np.float32) + if observed.any(): + result[observed] = embed( + model, + {k: v[observed] for k, v in pixels.items()}, + device, + patch_size=patch_size, + center=center, + bilinear_point=bilinear_point, + valid={k: v[observed] for k, v in valid.items()} + if valid is not None + else None, + ) + return result + kwargs = {} + for name, arr in pixels.items(): + val = torch.from_numpy(arr).to(device) + kwargs[name] = val + spec = Modality.get(name) + mask = torch.zeros( + (*val.shape[:-1], spec.num_band_sets), dtype=torch.int32, device=device + ) + if valid is not None and name in valid: + missing = torch.from_numpy(~valid[name].astype(bool)).to(device) + if missing.ndim == 2: + missing = missing[:, :, None] + mask.masked_fill_(missing[:, None, None, :, :], 3) + kwargs[name + "_mask"] = mask + b, _, _, t, _ = next(iter(pixels.values())).shape + timestamps = torch.zeros((b, t, 3), dtype=torch.int32, device=device) + timestamps[:, :, 0] = 1 + timestamps[:, :, 1] = torch.arange(t, device=device) + timestamps[:, :, 2] = 2024 + kwargs["timestamps"] = timestamps + with ( + torch.inference_mode(), + torch.autocast( + device_type=device.type, dtype=torch.bfloat16, enabled=device.type == "cuda" + ), + ): + result = model( + MaskedOlmoEarthSample(**kwargs), + patch_size=patch_size, + fast_pass=valid is None or all(np.all(v) for v in valid.values()), + )["tokens_and_masks"] + vec = pool_unmasked_tokens(result, PoolingType.MEAN, spatial_pooling=center) + if center: + if bilinear_point: + # AWF's published head upsamples by four before its pointwise + # linear classifier. Sampling here preserves that interpolation. + vec = torch.nn.functional.interpolate( + vec.permute(0, 3, 1, 2), + scale_factor=patch_size, + mode="bilinear", + align_corners=False, + ).permute(0, 2, 3, 1) + vec = vec[:, vec.shape[1] // 2, vec.shape[2] // 2] + if valid: + present = np.stack( + [ + valid[name].reshape(batch, -1).any(axis=1) + if name in valid + else np.ones(batch, dtype=bool) + for name in pixels + ], + axis=1, + ) + # Upstream averages over modalities present anywhere in the + # batch. Average over each sample's observed modalities instead. + scale = present.any(axis=0).sum() / present.sum(axis=1) + vec = ( + vec + * torch.as_tensor(scale, device=device, dtype=vec.dtype)[:, None] + ) + return vec.float().cpu().numpy() + + +def main(): + p = argparse.ArgumentParser() + p.add_argument("--model", type=Path, required=True) + p.add_argument("--input", type=Path, required=True) + p.add_argument("--output", type=Path, required=True) + p.add_argument("--batch-size", type=int, default=16) + p.add_argument("--device", choices=["cpu", "cuda"], default="cuda") + a = p.parse_args() + if ( + a.device == "cuda" + and os.environ.get("EARTH_SLURM_PARTITION") + and os.environ.get("SLURM_JOB_PARTITION") != os.environ["EARTH_SLURM_PARTITION"] + ): + raise RuntimeError("GPU execution requires Slurm configured-gpu-partition") + config = json.loads((a.model / "config.json").read_text()) + model = EncoderConfig.from_dict(config).build() + model.load_state_dict( + torch.load(a.model / "encoder.pt", map_location="cpu", weights_only=True), + strict=True, + ) + configure_inference(model).to(a.device) + with h5py.File(a.input, "r") as h: + ids = h["ids"].asstr()[:] + if h.attrs["task"] not in ("awf", "lfmc"): + raise ValueError("Unknown evaluation task") + bilinear_point = h.attrs["task"] == "awf" + chunks = [] + for start in range(0, len(ids), a.batch_size): + valid = { + name: h[name + "_valid"][start : start + a.batch_size] + for name in ["sentinel2_l2a", "sentinel1"] + if name + "_valid" in h + } + chunks.append( + embed( + model, + normalized_pixels(h, start, start + a.batch_size), + torch.device(a.device), + center=True, + bilinear_point=bilinear_point, + valid=valid, + ) + ) + if start % (a.batch_size * 50) == 0: + print("embedded", start, len(ids), flush=True) + features = np.concatenate(chunks) + if ( + features.shape != (len(ids), config["embedding_size"]) + or not np.isfinite(features).all() + ): + raise ValueError("Invalid embeddings") + a.output.parent.mkdir(parents=True, exist_ok=True) + np.savez(a.output, ids=np.asarray(ids, dtype=str), features=features) + print( + json.dumps( + {"rows": len(ids), "dimension": features.shape[1], "output": str(a.output)} + ) + ) + + +if __name__ == "__main__": + main() diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/provenance.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..24fd17d1bdc3e608f95b9b13785e9f3ccb826473 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S002/provenance.json @@ -0,0 +1,92 @@ +{ + "upstream": "0497dfbb6711ded4e6bf10cf089fc1e4d58c186b", + "origin": "own_from_scratch_training", + "variant": "v1-flexivit/w768-d12-h12", + "inference_adapter_version": 3, + "infer_sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "initialization_seed": 12536, + "data_seed": 3622, + "checkpoint": "/run-state/workspace/research/runs/b1/ckpt/step003000.pt", + "parameters": 88953600, + "training_recipe": { + "recipe_complete": true, + "hyperparameters": { + "width": 768, + "depth": 12, + "heads": 12, + "drop_path": 0.1, + "steps": 10000, + "warmup": 500, + "lr": 0.0002, + "head_lr": 0.001, + "wd": 0.02, + "clip": 1.0, + "final_lr_ratio": 0.05, + "b16": 128, + "b32": 32, + "w_wc": 1.0, + "w_traj": 1.0, + "w_summ": 0.5, + "w_time": 0.5, + "w_loc": 0.5, + "p_roll": 0.5, + "p_zero_slot": 0.03, + "ema": 0.999 + }, + "checkpoint_step": 3000, + "weights": "raw", + "objective": "linear heads on contract-pooled patch features: WorldCover soft CE; smooth-L1 on clean S2/S1 per-slot trajectories; NDVI/NDMI/NBR min/max/std; MSE on month-of-slot-0 and lat/lon unit vector", + "supervision_sources": [ + "worldcover", + "sentinel2_l2a", + "sentinel1", + "timestamps", + "latlon" + ], + "downstream_labels_used": false, + "pretrained_weights_used": false, + "initialization": "random (torch.manual_seed(initialization_seed) then EncoderConfig.build())", + "data": { + "source": "/task-data/19837", + "source_provenance_sha256": "417005224be7469547343ae743a06c913e9ed428841dbd53c5b095c2c0b51621", + "exclusion": "AWF bbox lon32..43 lat-6..6; LFMC Euclidean lonlat radius0.1deg, all labels", + "samples": 19837, + "layers_copied": [ + "sentinel2_l2a (raw uint16 DN)", + "sentinel1 (dB, float16, NaN=missing)", + "worldcover", + "timestamps", + "latlon" + ], + "layers_not_copied": [ + "gse", + "landsat", + "srtm", + "openstreetmap_raster", + "worldcereal", + "wri_canopy_height_map", + "cdl", + "worldpop" + ], + "source_sha256_digest_of_digests": "1cc6107a4ecc336b7f4f5cd020ba01a4956ee70c87281168ac807d04d500c6bf" + }, + "lineage": null + }, + "training_implementation": { + "name": "research/code/train.py", + "source_hashes": { + "train.py": "3cae1a1e4987272ec41bee94023c9f024df849125b18f6fd4e395bfb3d2fad7e", + "geolib.py": "44af8ae43ef93ba351d6916a4ceb8a8df3203241a5f05a10b8d519d657d0687e", + "build_cache.py": "a9099b722a73bdff79da137a3d0051d3b5bab342a5cca0b53d4ac9ef8ffdfbc8" + } + }, + "training_validity": "not_flagged_invalid", + "planned_training_duration": { + "steps": 10000 + }, + "checkpoint_sha256": "ae459bee12c9751aec84b741d66c9a4d03b36546b8b5770d374aa171a3409117", + "checkpoint_step": 3000, + "weights": "raw", + "training_recipe_source": "/run-state/workspace/research/runs/b1/ckpt/step003000.pt", + "encoder_sha256": "c11119660a7ded1e02651bbac9a7b6803bbdbbeef4e0af5649b1d37ba34f2987" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/LICENSE-OlmoEarth b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/LICENSE-OlmoEarth new file mode 100644 index 0000000000000000000000000000000000000000..f764333f593fbb8103a98875d9eb17b534614eb0 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/LICENSE-OlmoEarth @@ -0,0 +1,127 @@ +OlmoEarth Artifact License + +By exercising the rights granted to you under this OlmoEarth Artifact License +("Agreement"), you accept and agree to its terms and conditions and enter into this +Agreement with The Allen Institute for Artificial Intelligence ("Ai2"). All references +to "you" herein means both an individual and legal entity that an individual is acting +on behalf of. + +Subject to your compliance with this Agreement, Ai2 grants you permission, free of +charge, to use the machine learning artifacts, materials, and documentation provided by +Ai2 under this Agreement as follows (collectively, "Artifacts"): + +- Model weights, including architecture and parameters ("Model"); +- Associated dataset or collection of data in connection with the Model ("Dataset"); and/or +- Associated software to process and run the Dataset and Model, including code in + source or binary form for training, inference, and evaluation ("Code"). + +1. Use Rights + +Subject to the terms in Section 2 and 3 below, you may: + +(a) Use, reproduce, modify, display and distribute the Artifacts, in whole or in part; +(b) Create any other machine learning models, datasets, and derivative works that are + derived from or based on the Artifacts, including by (i) transfer of patterns of + the weights, parameters, operations, or outputs of the Model, (ii) generating + outputs of the Model to produce synthetic data, and (iii) using Code to prepare any + work of authorship (collectively, "Derivatives"); and +(c) Publish and share Derivatives. + +2. Use Restrictions + +You will not (and will not encourage, permit, or facilitate any others to) use any +portion of the Artifacts or Derivatives for the following purposes: + +(a) Any military and defense-related applications and use cases, including without + limitation, for weapons development, military operations, intelligence gathering, + or human surveillance and policing activities. +(b) Any extractive activities, operations and use cases involving the removal of raw + materials from the earth, including without limitation, to plan or facilitate the + extraction of oil, natural gas and minerals through activities such as drilling, + mining, and deforestation. + +3. Distribution + +In any distribution of the Artifacts or Derivatives: + +(a) You will cite Ai2 as the source of the Artifacts in any distribution of Artifacts + or Derivatives. +(b) If you distribute any portion of the Artifacts, you will either link to or provide + a copy of this Agreement to all third party recipients. +(c) If you distribute any Derivatives, you may add your own intellectual property + notices and apply other licenses and terms of use, provided that you include and + require the use restrictions in Section 2 in all downstream distribution unless Ai2 + provides written approval otherwise. + +4. Termination + +This Agreement will automatically terminate with immediate effect and without notice to +you in the following circumstances: + +(a) Your breach of the use restrictions in Section 2 and any other terms and conditions + herein; or +(b) If you file, maintain, or voluntarily participate in a lawsuit against any person + or entity asserting that the Artifacts or any portion thereof directly or + indirectly infringe any patent, except where a lawsuit is filed in response to a + corresponding lawsuit first brought against you. + +For the avoidance of doubt, Ai2 may also offer the Artifacts under separate terms and +conditions or stop distributing the Artifacts at any time; however, doing so will not +terminate this Agreement. You may continue to use the Artifacts under this Agreement +unless it is terminated in accordance with the circumstances expressly stated herein. + +5. Rights Not Covered + +This Agreement does not cover any patents or trademarks associated with the Artifacts, +including with respect to any individual items of information and materials that are +included or incorporated within a Dataset ("Contents"). Such Contents may be factual +data or independent works such as text, images, audio, and audio visual material. +Contents may be subject to other rights, including copyright, patent, data protection, +privacy, or personality rights, and this Agreement does not cover such rights. The use +rights in Section 1 expressly exclude any and all other rights that may apply to the +Contents of a Dataset. + +6. Disclaimer and Limitation of Liability + +(a) THE ARTIFACTS ARE PROVIDED "AS IS", "AS AVAILABLE", AND "WITH ALL FAULTS", WITHOUT + ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, IMPLIED + WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT, FITNESS FOR A PARTICULAR + PURPOSE, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE + OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. AI2 MAKES NO REPRESENTATIONS OR + WARRANTIES AS TO THE RELIABILITY, COMPLETENESS, QUALITY, PERFORMANCE, + FUNCTIONALITY, OR UTILITY OF ANY ARTIFACTS. ANY USE OF THE ARTIFACTS IS AT YOUR + SOLE RISK AND DISCRETION. YOU ARE SOLELY RESPONSIBLE FOR (1) CLEARING ANY THIRD + PARTY RIGHTS THAT MAY APPLY TO OR BE EMBODIED IN ANY ARTIFACTS, INCLUDING ANY + CONTENTS IN A DATASET; (2) OBTAINING ANY NECESSARY RIGHTS, LICENSES, CONSENTS, OR + PERMISSIONS REQUIRED FOR YOUR USE OF THE ARTIFACTS; AND (3) PERFORMING ANY DUE + DILIGENCE ON THE ARTIFACTS TO VERIFY SUITABILITY FOR YOUR INTENDED USE. + +(b) TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, IN NO EVENT WILL AI2 BE + LIABLE FOR ANY CLAIM, DAMAGES, LOSSES, OR OTHER LIABILITY OF ANY KIND WHATSOEVER, + WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR IN CONNECTION + WITH THE ARTIFACTS OR YOUR USE THEREOF. + +(c) The disclaimers and limitations of liability set forth above will be interpreted in + a manner that, to the greatest extent possible, constitute an absolute disclaimer + and waiver of all liability. + +7. Other Agreements + +If you have entered into a separate written agreement with Ai2 regarding your use of +the specific Artifacts that are subject to this Agreement ("Other Agreement"), the +terms of such Other Agreement will supplement the terms herein. To the extent of any +conflict between the terms of the Other Agreement and this Agreement, the Other +Agreement will take precedence. + +8. Miscellaneous + +If any term or provision of this Agreement is deemed invalid or unenforceable, it will +automatically be reformed to the minimum extent necessary to make it enforceable. To +the extent it cannot be reformed, it will be severed from this Agreement, and the +remaining terms and conditions will remain in full force and effect. Any delay or +failure by Ai2 to take any action or enforce any breach of this Agreement will not be +deemed as a waiver or consent by Ai2. No term or provision of this Agreement will be +waived by Ai2 unless expressly agreed in writing. Nothing in this Agreement constitutes +as a limitation of any privileges, immunities, and rights that apply to you or Ai2 +under applicable laws, including from the legal processes of any jurisdiction or +authority. diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/config.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/config.json new file mode 100644 index 0000000000000000000000000000000000000000..1fd5af8c6875b60ce12bf58b9c3b349eb5f18891 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/config.json @@ -0,0 +1,40 @@ +{ + "supported_modality_names": [ + "sentinel2_l2a", + "sentinel1", + "landsat", + "worldcover", + "srtm", + "openstreetmap_raster", + "wri_canopy_height_map", + "cdl", + "worldcereal" + ], + "embedding_size": 768, + "max_patch_size": 8, + "min_patch_size": 1, + "num_heads": 12, + "mlp_ratio": 4.0, + "depth": 12, + "drop_path": 0.1, + "max_sequence_length": 12, + "num_register_tokens": 0, + "learnable_channel_embeddings": true, + "random_channel_embeddings": false, + "num_projection_layers": 1, + "aggregate_then_project": true, + "use_flash_attn": false, + "frozen_patch_embeddings": false, + "qk_norm": false, + "log_token_norm_stats": false, + "use_linear_patch_embed": false, + "band_dropout_rate": 0.0, + "random_band_dropout": false, + "position_encoding": "absolute", + "rope_base": 10000.0, + "rope_coordinate_scale": 1.0, + "rope_mixed_base": 10.0, + "temporal_rope_dim_frac": 0.25, + "rope_temporal_coordinate_scale": 1.0, + "_CLASS_": "olmoearth_pretrain.nn.flexi_vit.EncoderConfig" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/infer.py b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/infer.py new file mode 100644 index 0000000000000000000000000000000000000000..89e755d822b1da92ac2d76c59ccf79feef9d198e --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/infer.py @@ -0,0 +1,196 @@ +"""Portable frozen OlmoEarth encoder. Input HDF5 has pixels and IDs only.""" + +import argparse +import json +import os +from pathlib import Path +from types import MethodType +import h5py +import numpy as np +import torch +from olmoearth_pretrain.data.constants import Modality +from olmoearth_pretrain.data.normalize import Normalizer, Strategy +from olmoearth_pretrain.datatypes import MaskedOlmoEarthSample +from olmoearth_pretrain.nn.flexi_vit import EncoderConfig +from olmoearth_pretrain.nn.pooling import pool_unmasked_tokens, PoolingType + + +def inference_attention_mask(self, new_mask, fast_pass): + # Upstream v1 discards this padding mask in eval mode, although missing + # observations produce variable sequence lengths. Preserve the training + # attention-mask semantics without enabling dropout or changing weights. + return None if fast_pass else new_mask + + +def configure_inference(model): + model.eval() + model._maybe_get_attn_mask = MethodType(inference_attention_mask, model) + return model + + +def normalized_pixels(h, start, end): + normalizer = Normalizer(Strategy.COMPUTED) + out = {} + for name in ["sentinel2_l2a", "sentinel1"]: + if name not in h: + continue + arr = h[name][start:end].astype(np.float32) + if name == "sentinel1": + arr = 10 * np.log10(np.maximum(arr, 1e-6)) + out[name] = normalizer.normalize(Modality.get(name), arr).astype(np.float32) + return out + + +def embed( + model, pixels, device, patch_size=4, center=False, valid=None, bilinear_point=False +): + batch = len(next(iter(pixels.values()))) + observed = np.zeros(batch, dtype=bool) + for name in pixels: + observed |= ( + valid[name].reshape(batch, -1).any(axis=1) + if valid is not None and name in valid + else True + ) + if not observed.all(): + # No source observations: an explicit no-information vector. Keep the row + # in evaluation; its downstream prediction is determined by the fitted probe. + result = np.zeros((batch, model.embedding_size), dtype=np.float32) + if observed.any(): + result[observed] = embed( + model, + {k: v[observed] for k, v in pixels.items()}, + device, + patch_size=patch_size, + center=center, + bilinear_point=bilinear_point, + valid={k: v[observed] for k, v in valid.items()} + if valid is not None + else None, + ) + return result + kwargs = {} + for name, arr in pixels.items(): + val = torch.from_numpy(arr).to(device) + kwargs[name] = val + spec = Modality.get(name) + mask = torch.zeros( + (*val.shape[:-1], spec.num_band_sets), dtype=torch.int32, device=device + ) + if valid is not None and name in valid: + missing = torch.from_numpy(~valid[name].astype(bool)).to(device) + if missing.ndim == 2: + missing = missing[:, :, None] + mask.masked_fill_(missing[:, None, None, :, :], 3) + kwargs[name + "_mask"] = mask + b, _, _, t, _ = next(iter(pixels.values())).shape + timestamps = torch.zeros((b, t, 3), dtype=torch.int32, device=device) + timestamps[:, :, 0] = 1 + timestamps[:, :, 1] = torch.arange(t, device=device) + timestamps[:, :, 2] = 2024 + kwargs["timestamps"] = timestamps + with ( + torch.inference_mode(), + torch.autocast( + device_type=device.type, dtype=torch.bfloat16, enabled=device.type == "cuda" + ), + ): + result = model( + MaskedOlmoEarthSample(**kwargs), + patch_size=patch_size, + fast_pass=valid is None or all(np.all(v) for v in valid.values()), + )["tokens_and_masks"] + vec = pool_unmasked_tokens(result, PoolingType.MEAN, spatial_pooling=center) + if center: + if bilinear_point: + # AWF's published head upsamples by four before its pointwise + # linear classifier. Sampling here preserves that interpolation. + vec = torch.nn.functional.interpolate( + vec.permute(0, 3, 1, 2), + scale_factor=patch_size, + mode="bilinear", + align_corners=False, + ).permute(0, 2, 3, 1) + vec = vec[:, vec.shape[1] // 2, vec.shape[2] // 2] + if valid: + present = np.stack( + [ + valid[name].reshape(batch, -1).any(axis=1) + if name in valid + else np.ones(batch, dtype=bool) + for name in pixels + ], + axis=1, + ) + # Upstream averages over modalities present anywhere in the + # batch. Average over each sample's observed modalities instead. + scale = present.any(axis=0).sum() / present.sum(axis=1) + vec = ( + vec + * torch.as_tensor(scale, device=device, dtype=vec.dtype)[:, None] + ) + return vec.float().cpu().numpy() + + +def main(): + p = argparse.ArgumentParser() + p.add_argument("--model", type=Path, required=True) + p.add_argument("--input", type=Path, required=True) + p.add_argument("--output", type=Path, required=True) + p.add_argument("--batch-size", type=int, default=16) + p.add_argument("--device", choices=["cpu", "cuda"], default="cuda") + a = p.parse_args() + if ( + a.device == "cuda" + and os.environ.get("EARTH_SLURM_PARTITION") + and os.environ.get("SLURM_JOB_PARTITION") != os.environ["EARTH_SLURM_PARTITION"] + ): + raise RuntimeError("GPU execution requires Slurm configured-gpu-partition") + config = json.loads((a.model / "config.json").read_text()) + model = EncoderConfig.from_dict(config).build() + model.load_state_dict( + torch.load(a.model / "encoder.pt", map_location="cpu", weights_only=True), + strict=True, + ) + configure_inference(model).to(a.device) + with h5py.File(a.input, "r") as h: + ids = h["ids"].asstr()[:] + if h.attrs["task"] not in ("awf", "lfmc"): + raise ValueError("Unknown evaluation task") + bilinear_point = h.attrs["task"] == "awf" + chunks = [] + for start in range(0, len(ids), a.batch_size): + valid = { + name: h[name + "_valid"][start : start + a.batch_size] + for name in ["sentinel2_l2a", "sentinel1"] + if name + "_valid" in h + } + chunks.append( + embed( + model, + normalized_pixels(h, start, start + a.batch_size), + torch.device(a.device), + center=True, + bilinear_point=bilinear_point, + valid=valid, + ) + ) + if start % (a.batch_size * 50) == 0: + print("embedded", start, len(ids), flush=True) + features = np.concatenate(chunks) + if ( + features.shape != (len(ids), config["embedding_size"]) + or not np.isfinite(features).all() + ): + raise ValueError("Invalid embeddings") + a.output.parent.mkdir(parents=True, exist_ok=True) + np.savez(a.output, ids=np.asarray(ids, dtype=str), features=features) + print( + json.dumps( + {"rows": len(ids), "dimension": features.shape[1], "output": str(a.output)} + ) + ) + + +if __name__ == "__main__": + main() diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/provenance.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..d8323f4192301ff4b904a3e4014ad431cbca78ef --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S003/provenance.json @@ -0,0 +1,92 @@ +{ + "upstream": "0497dfbb6711ded4e6bf10cf089fc1e4d58c186b", + "origin": "own_from_scratch_training", + "variant": "v1-flexivit/w768-d12-h12", + "inference_adapter_version": 3, + "infer_sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "initialization_seed": 12536, + "data_seed": 3622, + "checkpoint": "/run-state/workspace/research/runs/b1/ckpt/step010000.pt", + "parameters": 88953600, + "training_recipe": { + "recipe_complete": true, + "hyperparameters": { + "width": 768, + "depth": 12, + "heads": 12, + "drop_path": 0.1, + "steps": 10000, + "warmup": 500, + "lr": 0.0002, + "head_lr": 0.001, + "wd": 0.02, + "clip": 1.0, + "final_lr_ratio": 0.05, + "b16": 128, + "b32": 32, + "w_wc": 1.0, + "w_traj": 1.0, + "w_summ": 0.5, + "w_time": 0.5, + "w_loc": 0.5, + "p_roll": 0.5, + "p_zero_slot": 0.03, + "ema": 0.999 + }, + "checkpoint_step": 10000, + "weights": "ema", + "objective": "linear heads on contract-pooled patch features: WorldCover soft CE; smooth-L1 on clean S2/S1 per-slot trajectories; NDVI/NDMI/NBR min/max/std; MSE on month-of-slot-0 and lat/lon unit vector", + "supervision_sources": [ + "worldcover", + "sentinel2_l2a", + "sentinel1", + "timestamps", + "latlon" + ], + "downstream_labels_used": false, + "pretrained_weights_used": false, + "initialization": "random (torch.manual_seed(initialization_seed) then EncoderConfig.build())", + "data": { + "source": "/task-data/19837", + "source_provenance_sha256": "417005224be7469547343ae743a06c913e9ed428841dbd53c5b095c2c0b51621", + "exclusion": "AWF bbox lon32..43 lat-6..6; LFMC Euclidean lonlat radius0.1deg, all labels", + "samples": 19837, + "layers_copied": [ + "sentinel2_l2a (raw uint16 DN)", + "sentinel1 (dB, float16, NaN=missing)", + "worldcover", + "timestamps", + "latlon" + ], + "layers_not_copied": [ + "gse", + "landsat", + "srtm", + "openstreetmap_raster", + "worldcereal", + "wri_canopy_height_map", + "cdl", + "worldpop" + ], + "source_sha256_digest_of_digests": "1cc6107a4ecc336b7f4f5cd020ba01a4956ee70c87281168ac807d04d500c6bf" + }, + "lineage": null + }, + "training_implementation": { + "name": "research/code/train.py", + "source_hashes": { + "train.py": "3cae1a1e4987272ec41bee94023c9f024df849125b18f6fd4e395bfb3d2fad7e", + "geolib.py": "44af8ae43ef93ba351d6916a4ceb8a8df3203241a5f05a10b8d519d657d0687e", + "build_cache.py": "a9099b722a73bdff79da137a3d0051d3b5bab342a5cca0b53d4ac9ef8ffdfbc8" + } + }, + "training_validity": "not_flagged_invalid", + "planned_training_duration": { + "steps": 10000 + }, + "checkpoint_sha256": "ab251e5a8ac8238d1bb0dc4aeb941ec80e72bf6e9017ac5a4a9ffe3ba649337d", + "checkpoint_step": 10000, + "weights": "ema", + "training_recipe_source": "/run-state/workspace/research/runs/b1/ckpt/step010000.pt", + "encoder_sha256": "28fb2ee96ba6d432a29103db18f9669418d6fddf4148dd1448525fb2588fb2ab" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/LICENSE-OlmoEarth b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/LICENSE-OlmoEarth new file mode 100644 index 0000000000000000000000000000000000000000..f764333f593fbb8103a98875d9eb17b534614eb0 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/LICENSE-OlmoEarth @@ -0,0 +1,127 @@ +OlmoEarth Artifact License + +By exercising the rights granted to you under this OlmoEarth Artifact License +("Agreement"), you accept and agree to its terms and conditions and enter into this +Agreement with The Allen Institute for Artificial Intelligence ("Ai2"). All references +to "you" herein means both an individual and legal entity that an individual is acting +on behalf of. + +Subject to your compliance with this Agreement, Ai2 grants you permission, free of +charge, to use the machine learning artifacts, materials, and documentation provided by +Ai2 under this Agreement as follows (collectively, "Artifacts"): + +- Model weights, including architecture and parameters ("Model"); +- Associated dataset or collection of data in connection with the Model ("Dataset"); and/or +- Associated software to process and run the Dataset and Model, including code in + source or binary form for training, inference, and evaluation ("Code"). + +1. Use Rights + +Subject to the terms in Section 2 and 3 below, you may: + +(a) Use, reproduce, modify, display and distribute the Artifacts, in whole or in part; +(b) Create any other machine learning models, datasets, and derivative works that are + derived from or based on the Artifacts, including by (i) transfer of patterns of + the weights, parameters, operations, or outputs of the Model, (ii) generating + outputs of the Model to produce synthetic data, and (iii) using Code to prepare any + work of authorship (collectively, "Derivatives"); and +(c) Publish and share Derivatives. + +2. Use Restrictions + +You will not (and will not encourage, permit, or facilitate any others to) use any +portion of the Artifacts or Derivatives for the following purposes: + +(a) Any military and defense-related applications and use cases, including without + limitation, for weapons development, military operations, intelligence gathering, + or human surveillance and policing activities. +(b) Any extractive activities, operations and use cases involving the removal of raw + materials from the earth, including without limitation, to plan or facilitate the + extraction of oil, natural gas and minerals through activities such as drilling, + mining, and deforestation. + +3. Distribution + +In any distribution of the Artifacts or Derivatives: + +(a) You will cite Ai2 as the source of the Artifacts in any distribution of Artifacts + or Derivatives. +(b) If you distribute any portion of the Artifacts, you will either link to or provide + a copy of this Agreement to all third party recipients. +(c) If you distribute any Derivatives, you may add your own intellectual property + notices and apply other licenses and terms of use, provided that you include and + require the use restrictions in Section 2 in all downstream distribution unless Ai2 + provides written approval otherwise. + +4. Termination + +This Agreement will automatically terminate with immediate effect and without notice to +you in the following circumstances: + +(a) Your breach of the use restrictions in Section 2 and any other terms and conditions + herein; or +(b) If you file, maintain, or voluntarily participate in a lawsuit against any person + or entity asserting that the Artifacts or any portion thereof directly or + indirectly infringe any patent, except where a lawsuit is filed in response to a + corresponding lawsuit first brought against you. + +For the avoidance of doubt, Ai2 may also offer the Artifacts under separate terms and +conditions or stop distributing the Artifacts at any time; however, doing so will not +terminate this Agreement. You may continue to use the Artifacts under this Agreement +unless it is terminated in accordance with the circumstances expressly stated herein. + +5. Rights Not Covered + +This Agreement does not cover any patents or trademarks associated with the Artifacts, +including with respect to any individual items of information and materials that are +included or incorporated within a Dataset ("Contents"). Such Contents may be factual +data or independent works such as text, images, audio, and audio visual material. +Contents may be subject to other rights, including copyright, patent, data protection, +privacy, or personality rights, and this Agreement does not cover such rights. The use +rights in Section 1 expressly exclude any and all other rights that may apply to the +Contents of a Dataset. + +6. Disclaimer and Limitation of Liability + +(a) THE ARTIFACTS ARE PROVIDED "AS IS", "AS AVAILABLE", AND "WITH ALL FAULTS", WITHOUT + ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, IMPLIED + WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT, FITNESS FOR A PARTICULAR + PURPOSE, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE + OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. AI2 MAKES NO REPRESENTATIONS OR + WARRANTIES AS TO THE RELIABILITY, COMPLETENESS, QUALITY, PERFORMANCE, + FUNCTIONALITY, OR UTILITY OF ANY ARTIFACTS. ANY USE OF THE ARTIFACTS IS AT YOUR + SOLE RISK AND DISCRETION. YOU ARE SOLELY RESPONSIBLE FOR (1) CLEARING ANY THIRD + PARTY RIGHTS THAT MAY APPLY TO OR BE EMBODIED IN ANY ARTIFACTS, INCLUDING ANY + CONTENTS IN A DATASET; (2) OBTAINING ANY NECESSARY RIGHTS, LICENSES, CONSENTS, OR + PERMISSIONS REQUIRED FOR YOUR USE OF THE ARTIFACTS; AND (3) PERFORMING ANY DUE + DILIGENCE ON THE ARTIFACTS TO VERIFY SUITABILITY FOR YOUR INTENDED USE. + +(b) TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, IN NO EVENT WILL AI2 BE + LIABLE FOR ANY CLAIM, DAMAGES, LOSSES, OR OTHER LIABILITY OF ANY KIND WHATSOEVER, + WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR IN CONNECTION + WITH THE ARTIFACTS OR YOUR USE THEREOF. + +(c) The disclaimers and limitations of liability set forth above will be interpreted in + a manner that, to the greatest extent possible, constitute an absolute disclaimer + and waiver of all liability. + +7. Other Agreements + +If you have entered into a separate written agreement with Ai2 regarding your use of +the specific Artifacts that are subject to this Agreement ("Other Agreement"), the +terms of such Other Agreement will supplement the terms herein. To the extent of any +conflict between the terms of the Other Agreement and this Agreement, the Other +Agreement will take precedence. + +8. Miscellaneous + +If any term or provision of this Agreement is deemed invalid or unenforceable, it will +automatically be reformed to the minimum extent necessary to make it enforceable. To +the extent it cannot be reformed, it will be severed from this Agreement, and the +remaining terms and conditions will remain in full force and effect. Any delay or +failure by Ai2 to take any action or enforce any breach of this Agreement will not be +deemed as a waiver or consent by Ai2. No term or provision of this Agreement will be +waived by Ai2 unless expressly agreed in writing. Nothing in this Agreement constitutes +as a limitation of any privileges, immunities, and rights that apply to you or Ai2 +under applicable laws, including from the legal processes of any jurisdiction or +authority. diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/config.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/config.json new file mode 100644 index 0000000000000000000000000000000000000000..aab9a674cc198978a2091ea8961b9a639ebe3031 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/config.json @@ -0,0 +1,40 @@ +{ + "supported_modality_names": [ + "sentinel2_l2a", + "sentinel1", + "landsat", + "worldcover", + "srtm", + "openstreetmap_raster", + "wri_canopy_height_map", + "cdl", + "worldcereal" + ], + "embedding_size": 2048, + "max_patch_size": 8, + "min_patch_size": 1, + "num_heads": 32, + "mlp_ratio": 4.0, + "depth": 6, + "drop_path": 0.1, + "max_sequence_length": 12, + "num_register_tokens": 0, + "learnable_channel_embeddings": true, + "random_channel_embeddings": false, + "num_projection_layers": 1, + "aggregate_then_project": true, + "use_flash_attn": false, + "frozen_patch_embeddings": false, + "qk_norm": false, + "log_token_norm_stats": false, + "use_linear_patch_embed": false, + "band_dropout_rate": 0.0, + "random_band_dropout": false, + "position_encoding": "absolute", + "rope_base": 10000.0, + "rope_coordinate_scale": 1.0, + "rope_mixed_base": 10.0, + "temporal_rope_dim_frac": 0.25, + "rope_temporal_coordinate_scale": 1.0, + "_CLASS_": "olmoearth_pretrain.nn.flexi_vit.EncoderConfig" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/infer.py b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/infer.py new file mode 100644 index 0000000000000000000000000000000000000000..89e755d822b1da92ac2d76c59ccf79feef9d198e --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/infer.py @@ -0,0 +1,196 @@ +"""Portable frozen OlmoEarth encoder. Input HDF5 has pixels and IDs only.""" + +import argparse +import json +import os +from pathlib import Path +from types import MethodType +import h5py +import numpy as np +import torch +from olmoearth_pretrain.data.constants import Modality +from olmoearth_pretrain.data.normalize import Normalizer, Strategy +from olmoearth_pretrain.datatypes import MaskedOlmoEarthSample +from olmoearth_pretrain.nn.flexi_vit import EncoderConfig +from olmoearth_pretrain.nn.pooling import pool_unmasked_tokens, PoolingType + + +def inference_attention_mask(self, new_mask, fast_pass): + # Upstream v1 discards this padding mask in eval mode, although missing + # observations produce variable sequence lengths. Preserve the training + # attention-mask semantics without enabling dropout or changing weights. + return None if fast_pass else new_mask + + +def configure_inference(model): + model.eval() + model._maybe_get_attn_mask = MethodType(inference_attention_mask, model) + return model + + +def normalized_pixels(h, start, end): + normalizer = Normalizer(Strategy.COMPUTED) + out = {} + for name in ["sentinel2_l2a", "sentinel1"]: + if name not in h: + continue + arr = h[name][start:end].astype(np.float32) + if name == "sentinel1": + arr = 10 * np.log10(np.maximum(arr, 1e-6)) + out[name] = normalizer.normalize(Modality.get(name), arr).astype(np.float32) + return out + + +def embed( + model, pixels, device, patch_size=4, center=False, valid=None, bilinear_point=False +): + batch = len(next(iter(pixels.values()))) + observed = np.zeros(batch, dtype=bool) + for name in pixels: + observed |= ( + valid[name].reshape(batch, -1).any(axis=1) + if valid is not None and name in valid + else True + ) + if not observed.all(): + # No source observations: an explicit no-information vector. Keep the row + # in evaluation; its downstream prediction is determined by the fitted probe. + result = np.zeros((batch, model.embedding_size), dtype=np.float32) + if observed.any(): + result[observed] = embed( + model, + {k: v[observed] for k, v in pixels.items()}, + device, + patch_size=patch_size, + center=center, + bilinear_point=bilinear_point, + valid={k: v[observed] for k, v in valid.items()} + if valid is not None + else None, + ) + return result + kwargs = {} + for name, arr in pixels.items(): + val = torch.from_numpy(arr).to(device) + kwargs[name] = val + spec = Modality.get(name) + mask = torch.zeros( + (*val.shape[:-1], spec.num_band_sets), dtype=torch.int32, device=device + ) + if valid is not None and name in valid: + missing = torch.from_numpy(~valid[name].astype(bool)).to(device) + if missing.ndim == 2: + missing = missing[:, :, None] + mask.masked_fill_(missing[:, None, None, :, :], 3) + kwargs[name + "_mask"] = mask + b, _, _, t, _ = next(iter(pixels.values())).shape + timestamps = torch.zeros((b, t, 3), dtype=torch.int32, device=device) + timestamps[:, :, 0] = 1 + timestamps[:, :, 1] = torch.arange(t, device=device) + timestamps[:, :, 2] = 2024 + kwargs["timestamps"] = timestamps + with ( + torch.inference_mode(), + torch.autocast( + device_type=device.type, dtype=torch.bfloat16, enabled=device.type == "cuda" + ), + ): + result = model( + MaskedOlmoEarthSample(**kwargs), + patch_size=patch_size, + fast_pass=valid is None or all(np.all(v) for v in valid.values()), + )["tokens_and_masks"] + vec = pool_unmasked_tokens(result, PoolingType.MEAN, spatial_pooling=center) + if center: + if bilinear_point: + # AWF's published head upsamples by four before its pointwise + # linear classifier. Sampling here preserves that interpolation. + vec = torch.nn.functional.interpolate( + vec.permute(0, 3, 1, 2), + scale_factor=patch_size, + mode="bilinear", + align_corners=False, + ).permute(0, 2, 3, 1) + vec = vec[:, vec.shape[1] // 2, vec.shape[2] // 2] + if valid: + present = np.stack( + [ + valid[name].reshape(batch, -1).any(axis=1) + if name in valid + else np.ones(batch, dtype=bool) + for name in pixels + ], + axis=1, + ) + # Upstream averages over modalities present anywhere in the + # batch. Average over each sample's observed modalities instead. + scale = present.any(axis=0).sum() / present.sum(axis=1) + vec = ( + vec + * torch.as_tensor(scale, device=device, dtype=vec.dtype)[:, None] + ) + return vec.float().cpu().numpy() + + +def main(): + p = argparse.ArgumentParser() + p.add_argument("--model", type=Path, required=True) + p.add_argument("--input", type=Path, required=True) + p.add_argument("--output", type=Path, required=True) + p.add_argument("--batch-size", type=int, default=16) + p.add_argument("--device", choices=["cpu", "cuda"], default="cuda") + a = p.parse_args() + if ( + a.device == "cuda" + and os.environ.get("EARTH_SLURM_PARTITION") + and os.environ.get("SLURM_JOB_PARTITION") != os.environ["EARTH_SLURM_PARTITION"] + ): + raise RuntimeError("GPU execution requires Slurm configured-gpu-partition") + config = json.loads((a.model / "config.json").read_text()) + model = EncoderConfig.from_dict(config).build() + model.load_state_dict( + torch.load(a.model / "encoder.pt", map_location="cpu", weights_only=True), + strict=True, + ) + configure_inference(model).to(a.device) + with h5py.File(a.input, "r") as h: + ids = h["ids"].asstr()[:] + if h.attrs["task"] not in ("awf", "lfmc"): + raise ValueError("Unknown evaluation task") + bilinear_point = h.attrs["task"] == "awf" + chunks = [] + for start in range(0, len(ids), a.batch_size): + valid = { + name: h[name + "_valid"][start : start + a.batch_size] + for name in ["sentinel2_l2a", "sentinel1"] + if name + "_valid" in h + } + chunks.append( + embed( + model, + normalized_pixels(h, start, start + a.batch_size), + torch.device(a.device), + center=True, + bilinear_point=bilinear_point, + valid=valid, + ) + ) + if start % (a.batch_size * 50) == 0: + print("embedded", start, len(ids), flush=True) + features = np.concatenate(chunks) + if ( + features.shape != (len(ids), config["embedding_size"]) + or not np.isfinite(features).all() + ): + raise ValueError("Invalid embeddings") + a.output.parent.mkdir(parents=True, exist_ok=True) + np.savez(a.output, ids=np.asarray(ids, dtype=str), features=features) + print( + json.dumps( + {"rows": len(ids), "dimension": features.shape[1], "output": str(a.output)} + ) + ) + + +if __name__ == "__main__": + main() diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/provenance.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..7bbeedd13fa2d2415cc7978b08d946dc84f5eea8 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S004/provenance.json @@ -0,0 +1,106 @@ +{ + "upstream": "0497dfbb6711ded4e6bf10cf089fc1e4d58c186b", + "origin": "own_from_scratch_training", + "variant": "v1-flexivit/w2048-d6-h32", + "block_structure": null, + "inference_adapter_version": 3, + "infer_sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "initialization_seed": 12536, + "data_seed": 3622, + "checkpoint": "/run-state/workspace/research/runs/E3/ckpt/step002500.pt", + "parameters": 315168768, + "training_recipe": { + "recipe_complete": true, + "hyperparameters": { + "width": 2048, + "depth": 6, + "heads": 32, + "drop_path": 0.1, + "towers": 1, + "steps": 2500, + "warmup": 250, + "lr": 0.0002, + "head_lr": 0.001, + "wd": 0.02, + "clip": 1.0, + "final_lr_ratio": 0.05, + "b16": 128, + "b32": 32, + "w_wc": 1.0, + "w_traj": 1.0, + "w_summ": 0.5, + "w_time": 0.5, + "w_loc": 0.5, + "p_roll": 0.5, + "p_zero_slot": 0.03, + "p_tf": 0.0, + "w_geo": 0.0, + "w_wcpx": 0.0, + "w_cycle": 0.0, + "w_pct": 0.0, + "focus16": 0.0, + "focus32": 0.0, + "jitter": 0.0, + "ema": 0.0, + "tail_steps": 0, + "tail_lr_ratio": 0.25 + }, + "checkpoint_step": 2500, + "weights": "raw", + "objective": "linear heads on contract-pooled patch features: WorldCover soft CE (patch fractions) and pixel CE on bilinearly upsampled features; smooth-L1 on clean S2/S1 per-slot trajectories; NDVI/NDMI/NBR min/max/std; temporal quantiles of clean bands/indices with tile context; annual-cycle completion of NDVI/NDMI/NBR/S1; MSE on month-of-slot-0, lat/lon unit vector and their random-Fourier/interaction expansions (terms with zero weight in args are inactive)", + "supervision_sources": [ + "worldcover", + "sentinel2_l2a", + "sentinel1", + "timestamps", + "latlon" + ], + "downstream_labels_used": false, + "pretrained_weights_used": false, + "initialization": "random (torch.manual_seed(initialization_seed) then EncoderConfig.build())", + "data": { + "source": "/task-data/19837", + "source_provenance_sha256": "417005224be7469547343ae743a06c913e9ed428841dbd53c5b095c2c0b51621", + "exclusion": "AWF bbox lon32..43 lat-6..6; LFMC Euclidean lonlat radius0.1deg, all labels", + "samples": 19837, + "layers_copied": [ + "sentinel2_l2a (raw uint16 DN)", + "sentinel1 (dB, float16, NaN=missing)", + "worldcover", + "timestamps", + "latlon" + ], + "layers_not_copied": [ + "gse", + "landsat", + "srtm", + "openstreetmap_raster", + "worldcereal", + "wri_canopy_height_map", + "cdl", + "worldpop" + ], + "source_sha256_digest_of_digests": "1cc6107a4ecc336b7f4f5cd020ba01a4956ee70c87281168ac807d04d500c6bf" + }, + "lineage": null + }, + "training_implementation": { + "name": "research/code/train.py", + "source_hashes": { + "train.py": "4e15da14f8eee223f9d7f13c90ebcb50c0eab0506e2616bfdcd77e1e14ac2cb6", + "geolib.py": "0adf82ec70affee8c5210488afc61348926e007c3043419cd23c1678dfe50573", + "merge_towers.py": "c45bc3920197ddb0ffb65ec39190682dd0335cd1eff9c07c73996808d9cb10c2", + "build_cache.py": "a9099b722a73bdff79da137a3d0051d3b5bab342a5cca0b53d4ac9ef8ffdfbc8" + } + }, + "training_validity": "not_flagged_invalid", + "planned_training_duration": { + "steps": 2500, + "tail_steps": 0 + }, + "checkpoint_sha256": "8942c02bd7eec24056dd7e67a9136eff89b1cd7476d348ff98e6afd88aee97ce", + "checkpoint_step": 2500, + "weights": "raw", + "training_recipe_source": "/run-state/workspace/research/runs/E3/ckpt/step002500.pt", + "encoder_sha256": "bc3e19e0ca03d5b19044b3293cfa986da4d91ca439ee352275da1a02d704d14d" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/LICENSE-OlmoEarth b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/LICENSE-OlmoEarth new file mode 100644 index 0000000000000000000000000000000000000000..f764333f593fbb8103a98875d9eb17b534614eb0 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/LICENSE-OlmoEarth @@ -0,0 +1,127 @@ +OlmoEarth Artifact License + +By exercising the rights granted to you under this OlmoEarth Artifact License +("Agreement"), you accept and agree to its terms and conditions and enter into this +Agreement with The Allen Institute for Artificial Intelligence ("Ai2"). All references +to "you" herein means both an individual and legal entity that an individual is acting +on behalf of. + +Subject to your compliance with this Agreement, Ai2 grants you permission, free of +charge, to use the machine learning artifacts, materials, and documentation provided by +Ai2 under this Agreement as follows (collectively, "Artifacts"): + +- Model weights, including architecture and parameters ("Model"); +- Associated dataset or collection of data in connection with the Model ("Dataset"); and/or +- Associated software to process and run the Dataset and Model, including code in + source or binary form for training, inference, and evaluation ("Code"). + +1. Use Rights + +Subject to the terms in Section 2 and 3 below, you may: + +(a) Use, reproduce, modify, display and distribute the Artifacts, in whole or in part; +(b) Create any other machine learning models, datasets, and derivative works that are + derived from or based on the Artifacts, including by (i) transfer of patterns of + the weights, parameters, operations, or outputs of the Model, (ii) generating + outputs of the Model to produce synthetic data, and (iii) using Code to prepare any + work of authorship (collectively, "Derivatives"); and +(c) Publish and share Derivatives. + +2. Use Restrictions + +You will not (and will not encourage, permit, or facilitate any others to) use any +portion of the Artifacts or Derivatives for the following purposes: + +(a) Any military and defense-related applications and use cases, including without + limitation, for weapons development, military operations, intelligence gathering, + or human surveillance and policing activities. +(b) Any extractive activities, operations and use cases involving the removal of raw + materials from the earth, including without limitation, to plan or facilitate the + extraction of oil, natural gas and minerals through activities such as drilling, + mining, and deforestation. + +3. Distribution + +In any distribution of the Artifacts or Derivatives: + +(a) You will cite Ai2 as the source of the Artifacts in any distribution of Artifacts + or Derivatives. +(b) If you distribute any portion of the Artifacts, you will either link to or provide + a copy of this Agreement to all third party recipients. +(c) If you distribute any Derivatives, you may add your own intellectual property + notices and apply other licenses and terms of use, provided that you include and + require the use restrictions in Section 2 in all downstream distribution unless Ai2 + provides written approval otherwise. + +4. Termination + +This Agreement will automatically terminate with immediate effect and without notice to +you in the following circumstances: + +(a) Your breach of the use restrictions in Section 2 and any other terms and conditions + herein; or +(b) If you file, maintain, or voluntarily participate in a lawsuit against any person + or entity asserting that the Artifacts or any portion thereof directly or + indirectly infringe any patent, except where a lawsuit is filed in response to a + corresponding lawsuit first brought against you. + +For the avoidance of doubt, Ai2 may also offer the Artifacts under separate terms and +conditions or stop distributing the Artifacts at any time; however, doing so will not +terminate this Agreement. You may continue to use the Artifacts under this Agreement +unless it is terminated in accordance with the circumstances expressly stated herein. + +5. Rights Not Covered + +This Agreement does not cover any patents or trademarks associated with the Artifacts, +including with respect to any individual items of information and materials that are +included or incorporated within a Dataset ("Contents"). Such Contents may be factual +data or independent works such as text, images, audio, and audio visual material. +Contents may be subject to other rights, including copyright, patent, data protection, +privacy, or personality rights, and this Agreement does not cover such rights. The use +rights in Section 1 expressly exclude any and all other rights that may apply to the +Contents of a Dataset. + +6. Disclaimer and Limitation of Liability + +(a) THE ARTIFACTS ARE PROVIDED "AS IS", "AS AVAILABLE", AND "WITH ALL FAULTS", WITHOUT + ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION, IMPLIED + WARRANTIES OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT, FITNESS FOR A PARTICULAR + PURPOSE, ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE + OF ERRORS, WHETHER OR NOT KNOWN OR DISCOVERABLE. AI2 MAKES NO REPRESENTATIONS OR + WARRANTIES AS TO THE RELIABILITY, COMPLETENESS, QUALITY, PERFORMANCE, + FUNCTIONALITY, OR UTILITY OF ANY ARTIFACTS. ANY USE OF THE ARTIFACTS IS AT YOUR + SOLE RISK AND DISCRETION. YOU ARE SOLELY RESPONSIBLE FOR (1) CLEARING ANY THIRD + PARTY RIGHTS THAT MAY APPLY TO OR BE EMBODIED IN ANY ARTIFACTS, INCLUDING ANY + CONTENTS IN A DATASET; (2) OBTAINING ANY NECESSARY RIGHTS, LICENSES, CONSENTS, OR + PERMISSIONS REQUIRED FOR YOUR USE OF THE ARTIFACTS; AND (3) PERFORMING ANY DUE + DILIGENCE ON THE ARTIFACTS TO VERIFY SUITABILITY FOR YOUR INTENDED USE. + +(b) TO THE MAXIMUM EXTENT PERMITTED UNDER APPLICABLE LAWS, IN NO EVENT WILL AI2 BE + LIABLE FOR ANY CLAIM, DAMAGES, LOSSES, OR OTHER LIABILITY OF ANY KIND WHATSOEVER, + WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM OR IN CONNECTION + WITH THE ARTIFACTS OR YOUR USE THEREOF. + +(c) The disclaimers and limitations of liability set forth above will be interpreted in + a manner that, to the greatest extent possible, constitute an absolute disclaimer + and waiver of all liability. + +7. Other Agreements + +If you have entered into a separate written agreement with Ai2 regarding your use of +the specific Artifacts that are subject to this Agreement ("Other Agreement"), the +terms of such Other Agreement will supplement the terms herein. To the extent of any +conflict between the terms of the Other Agreement and this Agreement, the Other +Agreement will take precedence. + +8. Miscellaneous + +If any term or provision of this Agreement is deemed invalid or unenforceable, it will +automatically be reformed to the minimum extent necessary to make it enforceable. To +the extent it cannot be reformed, it will be severed from this Agreement, and the +remaining terms and conditions will remain in full force and effect. Any delay or +failure by Ai2 to take any action or enforce any breach of this Agreement will not be +deemed as a waiver or consent by Ai2. No term or provision of this Agreement will be +waived by Ai2 unless expressly agreed in writing. Nothing in this Agreement constitutes +as a limitation of any privileges, immunities, and rights that apply to you or Ai2 +under applicable laws, including from the legal processes of any jurisdiction or +authority. diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/config.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/config.json new file mode 100644 index 0000000000000000000000000000000000000000..aab9a674cc198978a2091ea8961b9a639ebe3031 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/config.json @@ -0,0 +1,40 @@ +{ + "supported_modality_names": [ + "sentinel2_l2a", + "sentinel1", + "landsat", + "worldcover", + "srtm", + "openstreetmap_raster", + "wri_canopy_height_map", + "cdl", + "worldcereal" + ], + "embedding_size": 2048, + "max_patch_size": 8, + "min_patch_size": 1, + "num_heads": 32, + "mlp_ratio": 4.0, + "depth": 6, + "drop_path": 0.1, + "max_sequence_length": 12, + "num_register_tokens": 0, + "learnable_channel_embeddings": true, + "random_channel_embeddings": false, + "num_projection_layers": 1, + "aggregate_then_project": true, + "use_flash_attn": false, + "frozen_patch_embeddings": false, + "qk_norm": false, + "log_token_norm_stats": false, + "use_linear_patch_embed": false, + "band_dropout_rate": 0.0, + "random_band_dropout": false, + "position_encoding": "absolute", + "rope_base": 10000.0, + "rope_coordinate_scale": 1.0, + "rope_mixed_base": 10.0, + "temporal_rope_dim_frac": 0.25, + "rope_temporal_coordinate_scale": 1.0, + "_CLASS_": "olmoearth_pretrain.nn.flexi_vit.EncoderConfig" +} diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/infer.py b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/infer.py new file mode 100644 index 0000000000000000000000000000000000000000..89e755d822b1da92ac2d76c59ccf79feef9d198e --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/infer.py @@ -0,0 +1,196 @@ +"""Portable frozen OlmoEarth encoder. Input HDF5 has pixels and IDs only.""" + +import argparse +import json +import os +from pathlib import Path +from types import MethodType +import h5py +import numpy as np +import torch +from olmoearth_pretrain.data.constants import Modality +from olmoearth_pretrain.data.normalize import Normalizer, Strategy +from olmoearth_pretrain.datatypes import MaskedOlmoEarthSample +from olmoearth_pretrain.nn.flexi_vit import EncoderConfig +from olmoearth_pretrain.nn.pooling import pool_unmasked_tokens, PoolingType + + +def inference_attention_mask(self, new_mask, fast_pass): + # Upstream v1 discards this padding mask in eval mode, although missing + # observations produce variable sequence lengths. Preserve the training + # attention-mask semantics without enabling dropout or changing weights. + return None if fast_pass else new_mask + + +def configure_inference(model): + model.eval() + model._maybe_get_attn_mask = MethodType(inference_attention_mask, model) + return model + + +def normalized_pixels(h, start, end): + normalizer = Normalizer(Strategy.COMPUTED) + out = {} + for name in ["sentinel2_l2a", "sentinel1"]: + if name not in h: + continue + arr = h[name][start:end].astype(np.float32) + if name == "sentinel1": + arr = 10 * np.log10(np.maximum(arr, 1e-6)) + out[name] = normalizer.normalize(Modality.get(name), arr).astype(np.float32) + return out + + +def embed( + model, pixels, device, patch_size=4, center=False, valid=None, bilinear_point=False +): + batch = len(next(iter(pixels.values()))) + observed = np.zeros(batch, dtype=bool) + for name in pixels: + observed |= ( + valid[name].reshape(batch, -1).any(axis=1) + if valid is not None and name in valid + else True + ) + if not observed.all(): + # No source observations: an explicit no-information vector. Keep the row + # in evaluation; its downstream prediction is determined by the fitted probe. + result = np.zeros((batch, model.embedding_size), dtype=np.float32) + if observed.any(): + result[observed] = embed( + model, + {k: v[observed] for k, v in pixels.items()}, + device, + patch_size=patch_size, + center=center, + bilinear_point=bilinear_point, + valid={k: v[observed] for k, v in valid.items()} + if valid is not None + else None, + ) + return result + kwargs = {} + for name, arr in pixels.items(): + val = torch.from_numpy(arr).to(device) + kwargs[name] = val + spec = Modality.get(name) + mask = torch.zeros( + (*val.shape[:-1], spec.num_band_sets), dtype=torch.int32, device=device + ) + if valid is not None and name in valid: + missing = torch.from_numpy(~valid[name].astype(bool)).to(device) + if missing.ndim == 2: + missing = missing[:, :, None] + mask.masked_fill_(missing[:, None, None, :, :], 3) + kwargs[name + "_mask"] = mask + b, _, _, t, _ = next(iter(pixels.values())).shape + timestamps = torch.zeros((b, t, 3), dtype=torch.int32, device=device) + timestamps[:, :, 0] = 1 + timestamps[:, :, 1] = torch.arange(t, device=device) + timestamps[:, :, 2] = 2024 + kwargs["timestamps"] = timestamps + with ( + torch.inference_mode(), + torch.autocast( + device_type=device.type, dtype=torch.bfloat16, enabled=device.type == "cuda" + ), + ): + result = model( + MaskedOlmoEarthSample(**kwargs), + patch_size=patch_size, + fast_pass=valid is None or all(np.all(v) for v in valid.values()), + )["tokens_and_masks"] + vec = pool_unmasked_tokens(result, PoolingType.MEAN, spatial_pooling=center) + if center: + if bilinear_point: + # AWF's published head upsamples by four before its pointwise + # linear classifier. Sampling here preserves that interpolation. + vec = torch.nn.functional.interpolate( + vec.permute(0, 3, 1, 2), + scale_factor=patch_size, + mode="bilinear", + align_corners=False, + ).permute(0, 2, 3, 1) + vec = vec[:, vec.shape[1] // 2, vec.shape[2] // 2] + if valid: + present = np.stack( + [ + valid[name].reshape(batch, -1).any(axis=1) + if name in valid + else np.ones(batch, dtype=bool) + for name in pixels + ], + axis=1, + ) + # Upstream averages over modalities present anywhere in the + # batch. Average over each sample's observed modalities instead. + scale = present.any(axis=0).sum() / present.sum(axis=1) + vec = ( + vec + * torch.as_tensor(scale, device=device, dtype=vec.dtype)[:, None] + ) + return vec.float().cpu().numpy() + + +def main(): + p = argparse.ArgumentParser() + p.add_argument("--model", type=Path, required=True) + p.add_argument("--input", type=Path, required=True) + p.add_argument("--output", type=Path, required=True) + p.add_argument("--batch-size", type=int, default=16) + p.add_argument("--device", choices=["cpu", "cuda"], default="cuda") + a = p.parse_args() + if ( + a.device == "cuda" + and os.environ.get("EARTH_SLURM_PARTITION") + and os.environ.get("SLURM_JOB_PARTITION") != os.environ["EARTH_SLURM_PARTITION"] + ): + raise RuntimeError("GPU execution requires Slurm configured-gpu-partition") + config = json.loads((a.model / "config.json").read_text()) + model = EncoderConfig.from_dict(config).build() + model.load_state_dict( + torch.load(a.model / "encoder.pt", map_location="cpu", weights_only=True), + strict=True, + ) + configure_inference(model).to(a.device) + with h5py.File(a.input, "r") as h: + ids = h["ids"].asstr()[:] + if h.attrs["task"] not in ("awf", "lfmc"): + raise ValueError("Unknown evaluation task") + bilinear_point = h.attrs["task"] == "awf" + chunks = [] + for start in range(0, len(ids), a.batch_size): + valid = { + name: h[name + "_valid"][start : start + a.batch_size] + for name in ["sentinel2_l2a", "sentinel1"] + if name + "_valid" in h + } + chunks.append( + embed( + model, + normalized_pixels(h, start, start + a.batch_size), + torch.device(a.device), + center=True, + bilinear_point=bilinear_point, + valid=valid, + ) + ) + if start % (a.batch_size * 50) == 0: + print("embedded", start, len(ids), flush=True) + features = np.concatenate(chunks) + if ( + features.shape != (len(ids), config["embedding_size"]) + or not np.isfinite(features).all() + ): + raise ValueError("Invalid embeddings") + a.output.parent.mkdir(parents=True, exist_ok=True) + np.savez(a.output, ids=np.asarray(ids, dtype=str), features=features) + print( + json.dumps( + {"rows": len(ids), "dimension": features.shape[1], "output": str(a.output)} + ) + ) + + +if __name__ == "__main__": + main() diff --git a/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/provenance.json b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/provenance.json new file mode 100644 index 0000000000000000000000000000000000000000..d2622a7ea9ba1ac485dc2290a405227d9689aa96 --- /dev/null +++ b/tasks/earth-observation-pretraining-transfer/earth-observation-pretraining-transfer-fable52-xhigh-1h100-48h-20261110b/submissions/S005/provenance.json @@ -0,0 +1,124 @@ +{ + "upstream": "0497dfbb6711ded4e6bf10cf089fc1e4d58c186b", + "origin": "own_from_scratch_training", + "variant": "v1-flexivit/w2048-d6-h32", + "block_structure": null, + "inference_adapter_version": 3, + "infer_sha256": "903862bdf58216106cba9a624a2d1367c04e7c435ad1c91b37852e710805b8e7", + "initialization_seed": 12536, + "data_seed": 3622, + "checkpoint": "/run-state/workspace/research/runs/E6/ckpt/step002500.pt", + "parameters": 315168768, + "training_recipe": { + "recipe_complete": true, + "hyperparameters": { + "width": 2048, + "depth": 6, + "heads": 32, + "drop_path": 0.1, + "stem": "", + "post": "", + "towers": 1, + "steps": 2500, + "warmup": 250, + "lr": 0.0002, + "head_lr": 0.001, + "wd": 0.02, + "clip": 1.0, + "final_lr_ratio": 0.05, + "b16": 128, + "b32": 32, + "w_wc": 1.0, + "w_traj": 1.0, + "w_summ": 0.5, + "w_time": 0.5, + "w_loc": 0.5, + "p_roll": 0.5, + "p_zero_slot": 0.03, + "p_tf": 0.0, + "w_geo": 0.0, + "w_wcpx": 0.0, + "w_cycle": 0.0, + "w_pct": 0.0, + "w_trajpx": 0.0, + "w_therm": 0.0, + "w_clu": 0.0, + "w_tclu": 0.0, + "w_tex": 0.0, + "w_texc": 0.0, + "w_toktex": 0.0, + "w_texd": 4.0, + "texd_dims": 24, + "texd_rep": 2, + "feat_drop": 0.0, + "holdout": 0, + "focus16": 0.0, + "focus16_region": "tropics", + "focus32": 0.0, + "jitter": 0.0, + "ema": 0.0, + "tail_steps": 0, + "tail_lr_ratio": 0.25 + }, + "checkpoint_step": 2500, + "weights": "raw", + "objective": "linear heads on contract-pooled patch features: WorldCover soft CE (patch fractions) and pixel CE on bilinearly upsampled features; smooth-L1 on clean S2/S1 per-slot trajectories (patch level, and pixel-level S2 trajectories read from the bilinearly upsampled features of 16-px crops); NDVI/NDMI/NBR min/max/std; temporal quantiles of clean bands/indices with tile context; annual-cycle completion of NDVI/NDMI/NBR/S1; MSE on month-of-slot-0, lat/lon unit vector and their random-Fourier/interaction expansions; smooth-L1 on Landsat thermal brightness temperature (B10, B10-B11) of the presented slots and its annual mean/max/min; cross-entropy on label-free phenology-codebook classes of each patch (k-means of temporal quantile features of pool imagery) and on the landscape-type class of the surrounding pool tile; smooth-L1 on sub-patch S2 texture summaries (temporal mean/std/quantiles of the within-patch and 8-px-window spatial std and mean absolute neighbour difference of NDVI, NDMI, B08, B04, B11, B03 over clear pixels; and of the within-window spatial correlations between those channels); head-free smooth-L1 that makes the first 24 pooled feature dims equal 0.5 x the temporal mean over clear slots of the standardized per-slot texture values (w_texd; dims 24..47 when w_toktex is also on; texd_dims > 24 adds the temporal std / q10 / q50 / q90 summaries, texd_rep > 1 repeats the block of targets in further dims); head-free token-level smooth-L1 that makes the first 24 dims of every observed S2 band-set token equal 0.5 x the standardized square-rooted mean absolute deviation / neighbour difference of that token's own bands (+ NDVI resp. NDMI) inside its 4-px patch in its own slot (zero in the other band sets' dims and for S1 tokens), so that the contract mean pooling yields their temporal mean (w_toktex) (terms with zero weight in args are inactive)", + "supervision_sources": [ + "worldcover", + "sentinel2_l2a", + "sentinel1", + "timestamps", + "latlon" + ], + "downstream_labels_used": false, + "pretrained_weights_used": false, + "initialization": "random (torch.manual_seed(initialization_seed) then EncoderConfig.build())", + "data": { + "source": "/task-data/19837", + "source_provenance_sha256": "417005224be7469547343ae743a06c913e9ed428841dbd53c5b095c2c0b51621", + "exclusion": "AWF bbox lon32..43 lat-6..6; LFMC Euclidean lonlat radius0.1deg, all labels", + "samples": 19837, + "layers_copied": [ + "sentinel2_l2a (raw uint16 DN)", + "sentinel1 (dB, float16, NaN=missing)", + "worldcover", + "timestamps", + "latlon" + ], + "layers_not_copied": [ + "gse", + "landsat", + "srtm", + "openstreetmap_raster", + "worldcereal", + "wri_canopy_height_map", + "cdl", + "worldpop" + ], + "source_sha256_digest_of_digests": "1cc6107a4ecc336b7f4f5cd020ba01a4956ee70c87281168ac807d04d500c6bf" + }, + "lineage": null, + "phenology_codebook": null, + "texture_pca": null, + "landsat_thermal_cache": null + }, + "training_implementation": { + "name": "research/code/train.py", + "source_hashes": { + "train.py": "29cd9acd0dc213c4bf0c535912ae717cc6020ecb25041cd6912a4414cf5d90b2", + "geolib.py": "2ceb7996e1ae92b4994a3fee5e1da0a866a44b11759f63c4bd2aa494fc6cbd48", + "merge_towers.py": "fa21617dd3c156bfaf2ae3a68c1b3b1e3c640ee6cd2222ee0cdb69ba3ece608e", + "build_cache.py": "a9099b722a73bdff79da137a3d0051d3b5bab342a5cca0b53d4ac9ef8ffdfbc8" + } + }, + "training_validity": "not_flagged_invalid", + "planned_training_duration": { + "steps": 2500, + "tail_steps": 0 + }, + "checkpoint_sha256": "843d09bc68e00a3aad7824f7def421aeed78b0e15b8d154423e00f810b2bb0b5", + "checkpoint_step": 2500, + "weights": "raw", + "training_recipe_source": "/run-state/workspace/research/runs/E6/ckpt/step002500.pt", + "encoder_sha256": "53d6fb877ddad770df19507fccd87b5c79ee756a041137d32c865759a5abfb0d" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/index.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/index.json new file mode 100644 index 0000000000000000000000000000000000000000..1dc69058daa82aef3e96b4596984859b2ad7f4bd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/index.json @@ -0,0 +1,3600 @@ +{ + "agent": "claude-code", + "agent_version": "2.1.319", + "caveats": [ + "Claude Code trial: a fresh session with no prior work reused; same image, data and 48-hour one-H100 budget as the Astra trial of this task.", + "Interrupted/resumed research with preserved charged time; not an uninterrupted trial.", + "Adapted Beaker execution; exact original Docker isolation and memory ceilings are not claimed.", + "Post-budget publication is separate from the original 48-hour history.", + "Model fallback: claude-fable-5-2 was requested; after API safeguard refusals Claude Code fell back to claude-opus-5 for the rest of each session, first within minutes of launch. Recorded research requests: 10 answered by claude-fable-5-2, 876 by claude-opus-5. Read this run as a claude-opus-5 result." + ], + "distinct_candidates": 23, + "evaluations": { + "S001": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 352, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S001/reward.json", + "sha256": "bde71b460adeb1edac06394a033ab7f0b77023b84f6d2b7af1e8757ea4f3ce16" + }, + { + "bytes": 38965, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S001/report.json", + "sha256": "591b654efcaa1aac489eaf8f1afa6d3b62cf8ce54ff743c8cdcce4f410c746d2" + } + ], + "runner_sources": [] + }, + "S002": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 350, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S002/reward.json", + "sha256": "845d489697c93adbfdfd6dd4978e674a4edf9bb726db2f9c2207879b85152ed4" + }, + { + "bytes": 39159, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S002/report.json", + "sha256": "d4d74cf7f8bf2e9568c64c961e4f49f8afc2cda60540a1e85ccf13150bfec355" + } + ], + "runner_sources": [] + }, + "S003": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 348, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S003/reward.json", + "sha256": "e1dff3b5879bd30fc724302d52d3ec60ef8c532b95834d84f5f79bfdd2d2a978" + }, + { + "bytes": 40553, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S003/report.json", + "sha256": "f8fb426399f2acc0164437597e3d57784b878e548eb94dab6fdb2e22b63eee3e" + } + ], + "runner_sources": [] + }, + "S004": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 349, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S004/reward.json", + "sha256": "686125ca8bd1fcd24d90891a55d037bda63c15338cb60039832db5024168aa54" + }, + { + "bytes": 40523, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S004/report.json", + "sha256": "047e4180fead121e22c141a376dd18138e5d0c5064f7c96a24af1fedc878919f" + } + ], + "runner_sources": [] + }, + "S005": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 345, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S005/reward.json", + "sha256": "7e9ad578825745caa9f6d6be6bc1d451d1c339cddf4f47c19fec0d7ede69a391" + }, + { + "bytes": 40463, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S005/report.json", + "sha256": "7c3f2a2502103be19145de5e5a203f53e08840ab56d5ac0934c335d5ff75d567" + } + ], + "runner_sources": [] + }, + "S006": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 349, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S006/reward.json", + "sha256": "8fcb901404bef2ef5a1ed9841f578b0e51035c6ee6e740ea10e2491633cdd5b3" + }, + { + "bytes": 40351, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S006/report.json", + "sha256": "cb7c682bbe06fc01cb3e7f13d823a4a7778c72d73f99d0ca5e647f6b00c22dc8" + } + ], + "runner_sources": [] + }, + "S007": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S007/reward.json", + "sha256": "944f4f433f3c35656030a408cc9d6a8a5880db5b86c8139b2339a8e9bae9d1fa" + }, + { + "bytes": 40455, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S007/report.json", + "sha256": "5b4d19017bab3d1592a83cab3464eb54de4727a09bed8278c150245e0d8ebb16" + } + ], + "runner_sources": [] + }, + "S008": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 347, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S008/reward.json", + "sha256": "ddacdfd01ad6afa2f44f5ce6741103c9cfeee255a451037c7d9c36a60e16e25e" + }, + { + "bytes": 40433, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S008/report.json", + "sha256": "459524704b7a074f090bc012a78e0bee4103b474e5b599f831446fde4439ef87" + } + ], + "runner_sources": [] + }, + "S009": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 342, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S009/reward.json", + "sha256": "ff125a3e10255fa0f9c6f36bec9e996d794a93daf4476ea457f5fec4257ee839" + }, + { + "bytes": 40505, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S009/report.json", + "sha256": "d933a667166ee7c9ab6b74c1497a24bf7169481394c5037dd6e9858aa4bf6a96" + } + ], + "runner_sources": [] + }, + "S010": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 348, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S010/reward.json", + "sha256": "d43cc8f36514e91c3e7380095f92953a1cb39bc34aad2dbd399e1dfc0d4e1c12" + }, + { + "bytes": 40524, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S010/report.json", + "sha256": "24466c1584587d171fe422135419c76f3ef7d00de0916b8951e36e71a2a7c53b" + } + ], + "runner_sources": [] + }, + "S011": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 349, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S011/reward.json", + "sha256": "3dc9361c12d789012f9185104d98a27320790bc0dd4083f562186516eafcddf0" + }, + { + "bytes": 40518, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S011/report.json", + "sha256": "6757a51d148db261879fe868d58374113d95a8c209ef97ef2d96b340049c8808" + } + ], + "runner_sources": [] + }, + "S012": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S012/reward.json", + "sha256": "6e3cace26ff1ef7a183604353568186a4a03d8a2174ba46bb73bf4c73e7fe3e1" + }, + { + "bytes": 40457, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S012/report.json", + "sha256": "8d63a1ae5704fc2bf9bce63be2603691d158bf5b8b1661bfe9e212618a1053f7" + } + ], + "runner_sources": [] + }, + "S013": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S013/reward.json", + "sha256": "6cb5b7b3291dec429fe0bab1a3069b44254d88dd1e472851aa7b48723f09bc57" + }, + { + "bytes": 40508, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S013/report.json", + "sha256": "5cd04cd92e043a7ab3fa5bc59954109b4758719d1781a12a9e37a66c4e7753bd" + } + ], + "runner_sources": [] + }, + "S014": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S014/reward.json", + "sha256": "4e0e7f0b76c8cc731d5153455c12e7ffa7a34615e5c1f1431cc7040a07cba345" + }, + { + "bytes": 40518, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S014/report.json", + "sha256": "666c3aded24735d16af3acd0b927d9082622de91d15f2b74a8dfb877c704385b" + } + ], + "runner_sources": [] + }, + "S015": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 345, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S015/reward.json", + "sha256": "deffee96579989d8edf2f847e21beaee5f729ace31b96df689b75c146a588590" + }, + { + "bytes": 40541, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S015/report.json", + "sha256": "cc023e8aa12b258ea6f6b05ffaaadfc43bbdb16a6b93154bf8a89ac24b09d2f7" + } + ], + "runner_sources": [] + }, + "S016": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 347, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S016/reward.json", + "sha256": "4b3b3ae9c616d6562a869635ea8f97fc8b9f031f750afcf1851fa77850971fd1" + }, + { + "bytes": 40552, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S016/report.json", + "sha256": "016899169652e482768928a529d06efdf2b48310ea6128586ff0ab47e3e3002a" + } + ], + "runner_sources": [] + }, + "S017": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S017/reward.json", + "sha256": "867c255ff0570e6045043bd04b0d7328d9467b0bca841117252f9bef63c3e3d7" + }, + { + "bytes": 40548, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S017/report.json", + "sha256": "469ac2369b1afb764a30101c063d7bb9d31adeeca0d51e00251680eafbbca888" + } + ], + "runner_sources": [] + }, + "S018": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S018/reward.json", + "sha256": "92a4b1bd58db92a789f26db439ebc005c06039c0b50ee64c15955f50e779d94c" + }, + { + "bytes": 40602, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S018/report.json", + "sha256": "57f41e9c5a251a702de7320a66dc6ee6c5d16277f20e3e13578acb97e8c8d290" + } + ], + "runner_sources": [] + }, + "S020": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 348, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S020/reward.json", + "sha256": "62c40823da729722387e4a0e09692a9d111b9b3144c228c30a76512b7d53625f" + }, + { + "bytes": 40609, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S020/report.json", + "sha256": "4d536e5f75793c87cf8f9e7b5d7db78a7007659d259564c7c3c2b6925df22d98" + } + ], + "runner_sources": [] + }, + "S021": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 345, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S021/reward.json", + "sha256": "7d8072a39ea2084fe38d77ffd076a851fc5d2d69eba27fc3184ee4683f015101" + }, + { + "bytes": 40588, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S021/report.json", + "sha256": "cc4d6ce2fa297fb33ad4b6adb1fc2f8b51388a73a10f9fc6bf1f0376b9b362fe" + } + ], + "runner_sources": [] + }, + "S022": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 347, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S022/reward.json", + "sha256": "757ff916036f9d9db37286b1b97b82cdd80cfe6142e59405f619fb3cdcbdb6e6" + }, + { + "bytes": 40549, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S022/report.json", + "sha256": "7bf8868f7beef5aad059ed189b968542a70291369d937e7a3aa5d567b3235a53" + } + ], + "runner_sources": [] + }, + "S023": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 347, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S023/reward.json", + "sha256": "605796ad0f1e3957316e514bef994d7c4058fbb8d1fec678e66de6a53a4625e9" + }, + { + "bytes": 40560, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S023/report.json", + "sha256": "6435fbc7961da8b2ae99c30c498f48834ccb0b58bdd637dd9f33f34281c29ad6" + } + ], + "runner_sources": [] + }, + "S024": { + "execution": { + "deviations": [ + "Beaker container instead of Docker no-network mode; network isolation via an inherited seccomp socket ban" + ], + "image": "01M6ZKCMQSZ0FZCZM5M4ERV32Z", + "label_isolated": true, + "scientific_scorer_modified": false, + "verifier_budget_seconds": 86400 + }, + "files": [ + { + "bytes": 348, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S024/reward.json", + "sha256": "18fb1a41ce88f050d4f431afcf89836e90339cb2253ce172d00c6af8b2b73202" + }, + { + "bytes": 40542, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/evaluations/S024/report.json", + "sha256": "6ccb0e3ec30c7057810e458e7453aa9dc464e32edd8d6c39caecdeb786f53b09" + } + ], + "runner_sources": [] + } + }, + "finalization": { + "files": [ + { + "bytes": 83343, + "original_sha256": "b6751fa6e597b82cd9351dfb5bd43f2a9bef81dd0fc5c563e19bf0365155f61f", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/trajectory.jsonl", + "redactions": 0, + "sha256": "b6751fa6e597b82cd9351dfb5bd43f2a9bef81dd0fc5c563e19bf0365155f61f" + }, + { + "bytes": 83, + "original_sha256": "23a5fbd0010bef7317f724b0515a608484ff37939929d8e7b3a8e344e821f014", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/codex.stderr", + "redactions": 0, + "sha256": "23a5fbd0010bef7317f724b0515a608484ff37939929d8e7b3a8e344e821f014" + }, + { + "bytes": 5405, + "original_sha256": "34800460ae86aa3f54319c182a22d69e30d270ddad52f80f0307a5619fc72265", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/publication-review.json", + "redactions": 0, + "sha256": "34800460ae86aa3f54319c182a22d69e30d270ddad52f80f0307a5619fc72265" + }, + { + "bytes": 869, + "original_sha256": "5697cbbd1b033cc078ed7b2b7498359177dbf1dade3cafea071ecc1cbc7ef152", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/status.json", + "redactions": 0, + "sha256": "5697cbbd1b033cc078ed7b2b7498359177dbf1dade3cafea071ecc1cbc7ef152" + }, + { + "bytes": 1066, + "original_sha256": "342831a2ba581515a963e4b88ab9f53ec1d65698eb6378183197e568b4e34446", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/prompt.txt", + "redactions": 0, + "sha256": "342831a2ba581515a963e4b88ab9f53ec1d65698eb6378183197e568b4e34446" + } + ], + "label": "48h-plus-5m-submission-only", + "package": { + "checkpoint": "GRACE_FINAL", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7627, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/README.md", + "sha256": "623b31cf7a96a348c88306288f314df4b5616f14db9d3e8b65f4c20f65109ffe" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 2689153740, + "path": "shared/package-files/93/93107d85335d0ba30f004cd95fac86f5543240e50920a27224d9bc3d579c1b04/model.pt", + "sha256": "93107d85335d0ba30f004cd95fac86f5543240e50920a27224d9bc3d579c1b04" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 4065, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/model_config.json", + "sha256": "12aebe5059a26933052a4bcab0636693a047e03f3c73b8f18c0c23b0992749ca" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 340, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/model_manifest.json", + "sha256": "74499082cf1ac950fbad0fadb8fce0ce805a76b184d037541515ca9afe76042d" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 22364, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/nmodel.py", + "sha256": "6c81064b3cf021bdbe1d3b0e856ed92a5dc115f3f998fdd4c244e5019395c09f" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 23215, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/predict.py", + "sha256": "1205a8bba17e96da9fe8dbc50df404ff3858db31839fbb9bbfceef98283ca7dc" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 26014, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/finalization/submission/training_summary.json", + "sha256": "2311c258861d9ecbadd0f2e71fd291d8236374d482444b78f1227f5afc135be3" + } + } + ], + "fingerprint": "884cfa6ee351e7a0ed8d0154e84f2eb0a7a13f177e0856576da05e6e3aa0c42f", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "publication_seconds": 219.33292540203547, + "same_inference_candidate_as": "S024" + }, + "images": [ + { + "beaker": "01M6ZKEV81E88AZBXN0MFT0F9Z" + } + ], + "launch": { + "astra_trial_with_same_setup": "target-based-drug-screening-astra-xhigh-1h100-48h-20261109a", + "data_mounts": [ + "/task-data/processed", + "/task-data/splits", + "/task-data/pretrained", + "/task-data/.complete.json" + ], + "operator_sha256": { + "cacert.pem": "ecd9dc38bc3efb7dbd6431f57e29d2f8d6a0f0d211e1464b3fef2cbfe266fcd2", + "claude": "dabafec82ca1319fa43d8be36a10fc61b1d11821cb98ad5df04ad95e199b8eed", + "claude_bootstrap.py": "0feddb168995d96070981a0b60a4541c1fd4211242c936d769ed9d8a61ac1024", + "claude_proxy.py": "cb524da8680a33ea723517d215ce65fe00e4da74a9f8d6b54218a9e83a7fb36b", + "claude_sandbox.py": "04ce0750d01367d8e8ac19aa574666a188d749238c9e6fa7636ca8e0af19a6f9", + "protein_design_bootstrap.py": "953e8b4e9f978929e86ec3e04b6bbcc0e79ccbe71bb559d560bdf7cf73660089", + "rerun_helpers.py": "df3ceaf0117a55daccdbbd0bbdfc6801bc57a9cd80a5e607e6564eca9e5c75e1", + "weather_bootstrap.py": "444864a7b4006fcb7cb8318a84f8a692319bcab63815ebf1bdfaa1347dd9a6f1" + } + }, + "logs": [ + { + "bytes": 17091964, + "original_sha256": "cee2c1daf8426948ee865254bdc69d3d2584a036643fa912f64058f46bc9ab0a", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/logs/trajectory.jsonl", + "redactions": 0, + "sha256": "cee2c1daf8426948ee865254bdc69d3d2584a036643fa912f64058f46bc9ab0a" + }, + { + "bytes": 664, + "original_sha256": "2914e21697787a32c773d5e33ad8177eac2f8feab16c7a0e08d02c21f88ff5df", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/logs/codex.stderr", + "redactions": 0, + "sha256": "2914e21697787a32c773d5e33ad8177eac2f8feab16c7a0e08d02c21f88ff5df" + }, + { + "bytes": 13777, + "original_sha256": "505d6fc81e3cc9ba4f96eda25b209e82a4f2826615f2ed5f749beb21b1742bae", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/logs/preflight.jsonl", + "redactions": 0, + "sha256": "505d6fc81e3cc9ba4f96eda25b209e82a4f2826615f2ed5f749beb21b1742bae" + }, + { + "bytes": 83, + "original_sha256": "23a5fbd0010bef7317f724b0515a608484ff37939929d8e7b3a8e344e821f014", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/logs/preflight.stderr", + "redactions": 0, + "sha256": "23a5fbd0010bef7317f724b0515a608484ff37939929d8e7b3a8e344e821f014" + }, + { + "bytes": 21674878, + "original_sha256": "0d6edf10fbb73552c9ae0280bebe2e6bed2595251f3d45f9e95e9c24eb4edbc9", + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/logs/sessions/-workspace/ce05bd9d-5828-42ed-8f8d-22fcb4c95df4.jsonl", + "redactions": 0, + "sha256": "0d6edf10fbb73552c9ae0280bebe2e6bed2595251f3d45f9e95e9c24eb4edbc9" + } + ], + "model": "claude-opus-5", + "model_fallback": { + "events": { + "refusal:bio->claude-opus-5": 3 + }, + "fallback_model": "claude-opus-5", + "first_fallback_request_utc": "2026-11-10T07:16:15Z", + "hours_after_launch_of_first_fallback_request": 0.0, + "mostly_answered_by": "claude-opus-5", + "refusals": 6, + "requested_model": "claude-fable-5-2", + "requests_by_model": { + "claude-fable-5-2": 10, + "claude-opus-5": 876 + } + }, + "model_requested": "claude-fable-5-2", + "packages": { + "S001": { + "checkpoint": "S001", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 195, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/README.md", + "sha256": "06c8bfd8f715f06f748f878c05508455fdb8c0feb179194ebf3df6b18bb416de" + } + }, + { + "kind": "file", + "mode": 420, + "name": "common.py", + "stored": { + "bytes": 1634, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/common.py", + "sha256": "4b588f948980ac734c8160af614732ea303b2a9e75e0b1568c9f74dd204d1444" + } + }, + { + "kind": "file", + "mode": 420, + "name": "data.py", + "stored": { + "bytes": 13303, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/data.py", + "sha256": "6a6cbdef9888db4b411c6540236ac30ce1f5fd5c890588e93532f6c64f299235" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 279, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/infer.sh", + "sha256": "9e3fce0f055e0843210ea588f966b3a1ead17ccb1a24983be7aeb3e94c308923" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 381379074, + "path": "shared/package-files/d3/d3d7c19700065f97f73d4f0131d88387b0e4766986454864d2044edf20d022ee/model.pt", + "sha256": "d3d7c19700065f97f73d4f0131d88387b0e4766986454864d2044edf20d022ee" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.py", + "stored": { + "bytes": 15643, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/model.py", + "sha256": "fbfe647e392fab1cf53b28b3476547de9be0a5266777c7b5c3c71716b1280600" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 285, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/model_config.json", + "sha256": "f9a31d346d7f813edfc3a170d8a6aa7fc1597b2453a92836c65bc9dbd91c22a3" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 333, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/model_manifest.json", + "sha256": "cb5deca4cea57167c54d2cd45bb656ea0d8ad8384622e5aa9b7446591d183325" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 8018, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/predict.py", + "sha256": "34ec773c8dc82a3ac2c91d226f11e45d35d0254f1b36e1d0a00e474f5571a87a" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 47, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/requirements.txt", + "sha256": "fa45697224bccfe344ab2fd7cb2cc2e1b6b799f5bc7c90dffce5301e65bc43a8" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training.py", + "stored": { + "bytes": 2295, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/training.py", + "sha256": "460bb1d2a5deda6ee76d9e6d608a062a4694153a3c83790434382b1f433ace5a" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 4138, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/training_summary.json", + "sha256": "ffc45cbcdbb96e01bc26fc0f6a6971ef2653321689569f3e773566713579bc67" + } + }, + { + "kind": "file", + "mode": 420, + "name": "unimol_encoder.py", + "stored": { + "bytes": 8494, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/unimol_encoder.py", + "sha256": "b5015a8354fbb2a7f3756fb3b4922ec4b669ddee4f833747dde54e9cc06ccb3e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "validation.py", + "stored": { + "bytes": 2551, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S001/validation.py", + "sha256": "8e8f7acede578794e04c48edaa9b3fb272b8b3878dee5ac0e4e9a5a46b1c52ba" + } + } + ], + "fingerprint": "61e8fdd965a5920148357b87977fc8c83de6b1fdd2eb300e70d0cc3934f2ed1d", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S002": { + "checkpoint": "S002", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 4377, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/README.md", + "sha256": "09b8af8289b5d70b5effdcd5e587997ffb257df7927828bd5e29e2ef1aecbc66" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 381301511, + "path": "shared/package-files/75/755ced67f35b4b3894985cc0411b2d009423a9759213aa05470e0c87a33970d7/model.pt", + "sha256": "755ced67f35b4b3894985cc0411b2d009423a9759213aa05470e0c87a33970d7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 420, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/model_config.json", + "sha256": "9c04a9f3a143a2b80c1cac9a977d69a7232d53a50bc59dd0bf919727d1ed9b93" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 336, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/model_manifest.json", + "sha256": "4f4fd53ddea6e55a2a4cd44ed3c1099c73d2808fed7db58f404a1152f11a5696" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 15703, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/nmodel.py", + "sha256": "cd5eaeeab390a8c42f71a716016cfbf45e569ec6b0fa6c099ed6263ebe6d7a9b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 6409, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/pkgdata.py", + "sha256": "9fce21d7f30babcb88a9d4492e9a1de7188c8b2f24f1dda49ce4c3849d182451" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 10866, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/predict.py", + "sha256": "98396406da0ead7c4462de9799f697e779e4c321e045790c55be5169943a2008" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 2671, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/training_summary.json", + "sha256": "7aeb8506bde4993a6e28268dc9e46c9a90f4bbfc32000de85b635541836896c4" + } + } + ], + "fingerprint": "512c074aefc9cc0f9cebd0fb6434552aed0c307b423a9fb8b90af024c52af5bf", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S003": { + "checkpoint": "S003", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 4210, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/README.md", + "sha256": "adc620e0d44895b2a25c8927875a5d733ddb2fcad380a3248cfa63e6ca5e9d95" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 381301575, + "path": "shared/package-files/52/52c6449a681cfdba73b77c9120557162ed767cd593926f821076f73c4665e4b0/model.pt", + "sha256": "52c6449a681cfdba73b77c9120557162ed767cd593926f821076f73c4665e4b0" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 420, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/model_config.json", + "sha256": "9c04a9f3a143a2b80c1cac9a977d69a7232d53a50bc59dd0bf919727d1ed9b93" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 336, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/model_manifest.json", + "sha256": "fda28e1b8fad07b28989386f7b3c8fd098051877aa3334d1b39cdfd79ddcd8f9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 16064, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/nmodel.py", + "sha256": "19f08ede357fa3254d859d90358179598dd075be462b55c2741a94ca7eeab61a" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 13973, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/predict.py", + "sha256": "b3cbf957d5db4d76be73ba2512342d9ac4c11c31aa3b923ccb4810b8d72cfc55" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 3451, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S003/training_summary.json", + "sha256": "ab1dbb79e92212732817938d609bcac5cdd5cf49fd45ee4c96286464a07f8250" + } + } + ], + "fingerprint": "53045240f1aff55ab5ff214b6949376d0c5ba86ae920271a0ae95c632238209c", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S004": { + "checkpoint": "S004", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 4640, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/README.md", + "sha256": "57a219582f504cf88d955d83de3396abdb2ef599578e2da48c138563150ba62c" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 381301575, + "path": "shared/package-files/52/52c6449a681cfdba73b77c9120557162ed767cd593926f821076f73c4665e4b0/model.pt", + "sha256": "52c6449a681cfdba73b77c9120557162ed767cd593926f821076f73c4665e4b0" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 420, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/model_config.json", + "sha256": "9c04a9f3a143a2b80c1cac9a977d69a7232d53a50bc59dd0bf919727d1ed9b93" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 336, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/model_manifest.json", + "sha256": "fda28e1b8fad07b28989386f7b3c8fd098051877aa3334d1b39cdfd79ddcd8f9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 16064, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/nmodel.py", + "sha256": "19f08ede357fa3254d859d90358179598dd075be462b55c2741a94ca7eeab61a" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 13973, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/predict.py", + "sha256": "b3cbf957d5db4d76be73ba2512342d9ac4c11c31aa3b923ccb4810b8d72cfc55" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 3598, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/training_summary.json", + "sha256": "d5180932458839d0186db74c33f83e97a859e25a6d097df8f7f86e931346b725" + } + } + ], + "fingerprint": "944c9a39cd9a575eea597fd46d5a2738be254f804fd56c8853e7932aa3874c0c", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S005": { + "checkpoint": "S005", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 4676, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/README.md", + "sha256": "cf8882a68b9e98b50abc552d1256aa3a06f505d8899df9c808a350e3799dcf26" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 381301575, + "path": "shared/package-files/af/aff27e17648e552127957e0fbe2b82afc2a2458294256cc7ed595f84f42a30a1/model.pt", + "sha256": "aff27e17648e552127957e0fbe2b82afc2a2458294256cc7ed595f84f42a30a1" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 420, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/model_config.json", + "sha256": "9c04a9f3a143a2b80c1cac9a977d69a7232d53a50bc59dd0bf919727d1ed9b93" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 336, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/model_manifest.json", + "sha256": "55983d0e041682f6aad56be2de3ad0a39c1af511221bc6bbc2816254aa558f34" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 16064, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/nmodel.py", + "sha256": "19f08ede357fa3254d859d90358179598dd075be462b55c2741a94ca7eeab61a" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 13973, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/predict.py", + "sha256": "b3cbf957d5db4d76be73ba2512342d9ac4c11c31aa3b923ccb4810b8d72cfc55" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 3622, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S005/training_summary.json", + "sha256": "899b29572075f4931b31b6b0850f52d7351e9399b57be776238185861a40ab76" + } + } + ], + "fingerprint": "b6ec33dff0c8d30e837c4920ca03d8e5ca657100b3839954c7cdffbd8f082030", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S006": { + "checkpoint": "S006", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 4998, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/README.md", + "sha256": "10f423d333788492c0cf1b6bbe6309612e44db09dc4bdd77d28ed34830a55180" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 762601947, + "path": "shared/package-files/94/94290abae7a5623f9381fa9c323368dc0d0cfa8cf69fbd790994ef88f7d0465e/model.pt", + "sha256": "94290abae7a5623f9381fa9c323368dc0d0cfa8cf69fbd790994ef88f7d0465e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 420, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/model_config.json", + "sha256": "9c04a9f3a143a2b80c1cac9a977d69a7232d53a50bc59dd0bf919727d1ed9b93" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/model_manifest.json", + "sha256": "b50b0b2f671c5ac4a1630ac5f7857a1168287e2e807e812796db6680a2ed9e99" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 16064, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/nmodel.py", + "sha256": "19f08ede357fa3254d859d90358179598dd075be462b55c2741a94ca7eeab61a" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 13973, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/predict.py", + "sha256": "b3cbf957d5db4d76be73ba2512342d9ac4c11c31aa3b923ccb4810b8d72cfc55" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 6402, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/training_summary.json", + "sha256": "8e7c4ce2f1df0e9eec4d702a085a5a65c36fa70b4f29710c81cc0b714259bb88" + } + } + ], + "fingerprint": "ed990f4ebfea3458885692379b1d255263098540f2161ce24f60a879689da87e", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S007": { + "checkpoint": "S007", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 5076, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/README.md", + "sha256": "38a489164898e74b22044e847ed7e570ecc15d9d8836c058a004193f0bbd8e1b" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 762602011, + "path": "shared/package-files/b4/b44bb92bfaa3710573ef556b3b95fdae347a30327dc0a6e4e430794f717bc060/model.pt", + "sha256": "b44bb92bfaa3710573ef556b3b95fdae347a30327dc0a6e4e430794f717bc060" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 469, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/model_config.json", + "sha256": "e809ad47c8a07bc9c769998d214ac4a26680b54248a6f28495097e0ceb9c9201" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/model_manifest.json", + "sha256": "34286537eb82cc35242eafeba31ef6877f8aed2ce4d9b45e7f3dcc59b50e00ff" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 14329, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/predict.py", + "sha256": "3ca36d468fd47380c178dc04808edb432e56812714e6bca18907eb5aeb5f7bfb" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 6928, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/training_summary.json", + "sha256": "fce0b15ff943db06761e595dadf7e828113586d719810257abe0d47a9cdcdb9f" + } + } + ], + "fingerprint": "875f5eadbfc2e59202caaac8a1653a1407cbcb0812ee9575a6bc9c6681829134", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S008": { + "checkpoint": "S008", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 5358, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/README.md", + "sha256": "ab1c704119ca953e63c1955daa1c07ce14bf7ac35fc53ef627897c94b72aa887" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 762602011, + "path": "shared/package-files/b4/b44bb92bfaa3710573ef556b3b95fdae347a30327dc0a6e4e430794f717bc060/model.pt", + "sha256": "b44bb92bfaa3710573ef556b3b95fdae347a30327dc0a6e4e430794f717bc060" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 469, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/model_config.json", + "sha256": "e809ad47c8a07bc9c769998d214ac4a26680b54248a6f28495097e0ceb9c9201" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/model_manifest.json", + "sha256": "34286537eb82cc35242eafeba31ef6877f8aed2ce4d9b45e7f3dcc59b50e00ff" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 14329, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/predict.py", + "sha256": "3ca36d468fd47380c178dc04808edb432e56812714e6bca18907eb5aeb5f7bfb" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 7833, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/training_summary.json", + "sha256": "1146fb6489accf0e499c1db3c5e8fe677a8c65874a64b5efe5fc36696e5d7623" + } + } + ], + "fingerprint": "924b800c4d7c8cbb6654bf64063dd05a9aafaf738bad608016deed45ebf01037", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S009": { + "checkpoint": "S009", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 5860, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/README.md", + "sha256": "e14ba0b1f561dffd6638e8a745745c3aec35d25800160535f0e31dba0f492f88" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 1143921381, + "path": "shared/package-files/af/af00c577c81cc45d9684248bd72c9a1a9378ebc162a2479f2af6e223ca368f72/model.pt", + "sha256": "af00c577c81cc45d9684248bd72c9a1a9378ebc162a2479f2af6e223ca368f72" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 1770, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/model_config.json", + "sha256": "fafa9025627f22e51f7639a4f1c01d7a6d64864c0c190cc53b88025db717b04c" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 343, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/model_manifest.json", + "sha256": "78533b9836c7dda37039932c51c585bb62dba0649495ac59e0db8a693d054a55" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 14919, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/predict.py", + "sha256": "515ce39191c4acae73f93b7c41585ea42e8b629837cbaa5da27cabcf662760b7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 11526, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/training_summary.json", + "sha256": "90f21e47cc268bdf87ab0447ac8c814d0443b6d972014c0396b450e18b5a1019" + } + } + ], + "fingerprint": "b359ccc9cc371740c5384372bcac3145c755503dd97aa38ee8849d687a55abc0", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S010": { + "checkpoint": "S010", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 6353, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/README.md", + "sha256": "f275e58c628d462bf080352b336681246a4b5f7cbf23079bee39aac80c792945" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 1525247748, + "path": "shared/package-files/9e/9e16985dc742ba1458c33dfc24500f25490174db051199c667d73391459a1d2d/model.pt", + "sha256": "9e16985dc742ba1458c33dfc24500f25490174db051199c667d73391459a1d2d" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 2340, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/model_config.json", + "sha256": "eb5e10c7f5a7203f6760a4453d019958069011c74ee63be0ae419775ec8bc6ce" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 343, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/model_manifest.json", + "sha256": "a76ba8aa2cfea0e31d8f3b41e40f5abf9f79b1b16f46776c523edf811f42f92a" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 14919, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/predict.py", + "sha256": "515ce39191c4acae73f93b7c41585ea42e8b629837cbaa5da27cabcf662760b7" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 15222, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/training_summary.json", + "sha256": "0bc9c590216f56b9d92ea33f905fba6c586757ca0fe990dece86b68e6e953704" + } + } + ], + "fingerprint": "21035d122eb7f2d348fb1dd0ceaa07be82ae2d6e0570ea448e9fd44ef4907a3f", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S011": { + "checkpoint": "S011", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 5401, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/README.md", + "sha256": "054778134006bd7cb49310fcdca18b28a659e8a10d11030b104db7e96e63fafe" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 1525247748, + "path": "shared/package-files/9e/9e16985dc742ba1458c33dfc24500f25490174db051199c667d73391459a1d2d/model.pt", + "sha256": "9e16985dc742ba1458c33dfc24500f25490174db051199c667d73391459a1d2d" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 2340, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/model_config.json", + "sha256": "eb5e10c7f5a7203f6760a4453d019958069011c74ee63be0ae419775ec8bc6ce" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 343, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/model_manifest.json", + "sha256": "f01f4236054bf17de94878d13b2321e50a5b65266474f5f0b9a14f636dc25dcf" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 15103, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/predict.py", + "sha256": "f9ec18d516a2348d59be8c6c8c460b4f4b40a5ea57166ddab06df121a62bc04b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 14360, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/training_summary.json", + "sha256": "844071da6f32e9b990f8f13d7757d40e86ebee3aa0d1dce78569caf8d796a364" + } + } + ], + "fingerprint": "fe3bd8ae155499794d8db13c00762de54410e852bd73868b0265059ace7635e7", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S012": { + "checkpoint": "S012", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 6528, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/README.md", + "sha256": "637eec288786925251547879d0c2d83f77b80595f6c7f989c3413f8144c31132" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 2669226721, + "path": "shared/package-files/ee/eeab5face2889f11c363c52a4a7b168373cc71f595824d9c925421159a54028e/model.pt", + "sha256": "eeab5face2889f11c363c52a4a7b168373cc71f595824d9c925421159a54028e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 4050, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/model_config.json", + "sha256": "0d9d753d6d3042bdff7b7e83c39a37cfcb8de627df10964a73212aa2af337dea" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/model_manifest.json", + "sha256": "b04fc6e44059de631de055b4fee3cc2f941839108cdde8a86bb4f2f86884eeca" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 15103, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/predict.py", + "sha256": "f9ec18d516a2348d59be8c6c8c460b4f4b40a5ea57166ddab06df121a62bc04b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 25131, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/training_summary.json", + "sha256": "f9a28ec8568d75a93ca2cd8956bc49484a94c9dc182dcd93b876fa6e7e86afe8" + } + } + ], + "fingerprint": "dc97bb61342f945fa0983e644a5f0c2162a659492498a88bedcf48f83174f6af", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S013": { + "checkpoint": "S013", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7230, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/README.md", + "sha256": "2126ed625aacc54b35d8a5a78d1aa4d92dcd9e93888ce81700d9908700bb4fed" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3434501919, + "path": "shared/package-files/e3/e3f9792a9638d0abab7144cc17a1eae5558829d75150c1b3c86224325a6d48a0/model.pt", + "sha256": "e3f9792a9638d0abab7144cc17a1eae5558829d75150c1b3c86224325a6d48a0" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5195, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/model_config.json", + "sha256": "5dcad702057ce3b22259998e428b9181293ce8b6b4196b2b512c948dd69d823b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 346, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/model_manifest.json", + "sha256": "ac5de58c97c1016a95c7e5d69b0281e5b436ec2f3d78a759d354dc767d86b064" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 15103, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/predict.py", + "sha256": "f9ec18d516a2348d59be8c6c8c460b4f4b40a5ea57166ddab06df121a62bc04b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 32272, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/training_summary.json", + "sha256": "5bcd9ae9905603b53931a7cbcabee7cfe6a72308fd54b3ac2d27e6c93c4c82eb" + } + } + ], + "fingerprint": "34d179df51dc5a7268042aa79bb7a20be576cadd38c6ecbe87d90e22799c9814", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S014": { + "checkpoint": "S014", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7182, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/README.md", + "sha256": "41ce5e7ea4443f1ed251c41dbeb39ff880d4c0c1aad3f0d36a48730f12e24df6" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3434501919, + "path": "shared/package-files/aa/aa72b1b569e7ea00f856566b2089fd5eabe92af0e4c3f9e774485bda7a5d0fbf/model.pt", + "sha256": "aa72b1b569e7ea00f856566b2089fd5eabe92af0e4c3f9e774485bda7a5d0fbf" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5195, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/model_config.json", + "sha256": "5dcad702057ce3b22259998e428b9181293ce8b6b4196b2b512c948dd69d823b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 344, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/model_manifest.json", + "sha256": "f58fc6eb8fbb23cfdace7f3b8a9b987a9a696bcaaced1feff7e8d766c762c9a1" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 17383, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/predict.py", + "sha256": "889fec1f453b2296c1594aada5252a322a77d61475774b90fefb4c65e560b97e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 32225, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/training_summary.json", + "sha256": "06a6aee65ccc09602d88299d83560965bb8130c7dc089bd220bb1a3bc4a6eae4" + } + } + ], + "fingerprint": "1baf08993055238531f57d79dd08383fe821ff96f0d3284cf50047741ca0b6c3", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S015": { + "checkpoint": "S015", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7201, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/README.md", + "sha256": "7945aac0c0ca60542def42f00a86d0536392e038ee409f538da11181b4b656f3" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3448135876, + "path": "shared/package-files/95/95a8785f639fe6a4bb11c88f7620c623a3df85526485649e15a2586e6fadd7df/model.pt", + "sha256": "95a8785f639fe6a4bb11c88f7620c623a3df85526485649e15a2586e6fadd7df" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5195, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/model_config.json", + "sha256": "5dcad702057ce3b22259998e428b9181293ce8b6b4196b2b512c948dd69d823b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 347, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/model_manifest.json", + "sha256": "4e46be8e3c44b0fb64442b543c4cab50a881da2dc51cf7db065319f053148eef" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 17383, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/predict.py", + "sha256": "889fec1f453b2296c1594aada5252a322a77d61475774b90fefb4c65e560b97e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 32244, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/training_summary.json", + "sha256": "bcfdaa99a77e9d7a2f4059b45905301fd28c4a818d59e70418e9667219ba6616" + } + } + ], + "fingerprint": "c1ab3fbf75361590c85944759db1b1f0b5cbaae150f5fb1f93c4e276d12ca2db", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S016": { + "checkpoint": "S016", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7234, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/README.md", + "sha256": "e8d214c632c2cc9f761d30db91a932cfb94dd473cc438c5acd8b53bdcf9009b5" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3448135940, + "path": "shared/package-files/17/1785e6526794c66fd8f8866a44efbd1cefa4e851f5c6897a408d2fa35ebe9ac1/model.pt", + "sha256": "1785e6526794c66fd8f8866a44efbd1cefa4e851f5c6897a408d2fa35ebe9ac1" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5195, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/model_config.json", + "sha256": "5dcad702057ce3b22259998e428b9181293ce8b6b4196b2b512c948dd69d823b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 339, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/model_manifest.json", + "sha256": "3f77820f77a306561a98e2fcf6f73a2eb3f6bc5f41ea2b6611ca7d339dbd9252" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 19074, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/predict.py", + "sha256": "ad134e16322006f28d2cc6405fe88789cd833b6a3cbf774d8b939c51b97785a8" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 32278, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/training_summary.json", + "sha256": "e2dfdcf272a3fd954f13ec651eaf854107f1a295e2ece0ff41f160057376a98d" + } + } + ], + "fingerprint": "a097cc347f69bd7c8c72b960f8b5eee64d7e01f2d33add2b1e57141d4b8d7c87", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S017": { + "checkpoint": "S017", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7234, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/README.md", + "sha256": "4da4438d75449d859a6ccde26019ce766291e99a979207286c013b43833b6c08" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3448135940, + "path": "shared/package-files/49/4949adfb6da7703a3f9ec4ff572d006f7d36c191c23ade21615e8270aeaf0c18/model.pt", + "sha256": "4949adfb6da7703a3f9ec4ff572d006f7d36c191c23ade21615e8270aeaf0c18" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5195, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/model_config.json", + "sha256": "5dcad702057ce3b22259998e428b9181293ce8b6b4196b2b512c948dd69d823b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 339, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/model_manifest.json", + "sha256": "74b1713c89ffce04f0de5e76051e08c21bf9e98226c9662a52ecff6a1ccadb17" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 19074, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/predict.py", + "sha256": "ad134e16322006f28d2cc6405fe88789cd833b6a3cbf774d8b939c51b97785a8" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 32278, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/training_summary.json", + "sha256": "a8d65a2f3309b2c2190303399f118ee49d9b84a5db27e9397b2371c675b95dc0" + } + } + ], + "fingerprint": "74f3d3a93a8a9ca066cc7ded7295d0b56ba3e44ce7ec42a398284017c3ea9351", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S018": { + "checkpoint": "S018", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7579, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/README.md", + "sha256": "383a2d3f6e0bb672c4a9b33673d553bab657bfd78575336b97871061c7820552" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3834182176, + "path": "shared/package-files/aa/aa6503d77ffcb7fd82a4dc82a6a31fff1fddb5541c6af35addeaa3c7e5ca3fdd/model.pt", + "sha256": "aa6503d77ffcb7fd82a4dc82a6a31fff1fddb5541c6af35addeaa3c7e5ca3fdd" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5770, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/model_config.json", + "sha256": "ce2d11d69d6c043ff42e192508897ad1afddefdae972152e2713371f527e7b4b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 341, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/model_manifest.json", + "sha256": "725573c2da26b57b9eb76d730bc3ee960016b586ce2cdb35306deef78d00c8d4" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 21488, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/nmodel.py", + "sha256": "26a46ac03d1859b737c6061fe959ac830fa268e9d7cf5358854992540b4159b6" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 19074, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/predict.py", + "sha256": "ad134e16322006f28d2cc6405fe88789cd833b6a3cbf774d8b939c51b97785a8" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 35842, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/training_summary.json", + "sha256": "e752bd4294b485610d742566753513510740512b581c5f8f6b9614bad2e59650" + } + } + ], + "fingerprint": "75821b005f45dbbc61356250d244f59c9cd2c67135946fc819fd83abb9aaba4f", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S020": { + "checkpoint": "S020", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7940, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/README.md", + "sha256": "1dba4ded0c14f90ab442823ddb8d133a7f68324238a3db7350b15452e3d137d9" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3834182176, + "path": "shared/package-files/3d/3dba4324393ef6903a26c4d47db7e8a60045576cd2c83fcf1305666f716fb504/model.pt", + "sha256": "3dba4324393ef6903a26c4d47db7e8a60045576cd2c83fcf1305666f716fb504" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5770, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/model_config.json", + "sha256": "ce2d11d69d6c043ff42e192508897ad1afddefdae972152e2713371f527e7b4b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 342, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/model_manifest.json", + "sha256": "782a0907a6d84f067a638b679a35ddf56ecd010d1f5e7ebd3241f6c63ae2b0df" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 22364, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/nmodel.py", + "sha256": "6c81064b3cf021bdbe1d3b0e856ed92a5dc115f3f998fdd4c244e5019395c09f" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 19851, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/predict.py", + "sha256": "b968e4cd9fee46766ebf0b79d7db46bc886d2ee1f7a085f024e2463547db4dda" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 35931, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/training_summary.json", + "sha256": "51a1c09982d5dfc11c39b7ed569ee872d8e37d6b45c2e0ee3c2d40dcc9b4c4b2" + } + } + ], + "fingerprint": "34ef530a38e752a0b96f739e7545ce9774213f711411ee189e52fa970dcfbdc8", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S021": { + "checkpoint": "S021", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 8500, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/README.md", + "sha256": "03aef9686212519450a5a8bfb41729e94fc7bcd4d09872c825935d0c49d29f0a" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3834182176, + "path": "shared/package-files/3d/3dba4324393ef6903a26c4d47db7e8a60045576cd2c83fcf1305666f716fb504/model.pt", + "sha256": "3dba4324393ef6903a26c4d47db7e8a60045576cd2c83fcf1305666f716fb504" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5770, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/model_config.json", + "sha256": "ce2d11d69d6c043ff42e192508897ad1afddefdae972152e2713371f527e7b4b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 342, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/model_manifest.json", + "sha256": "782a0907a6d84f067a638b679a35ddf56ecd010d1f5e7ebd3241f6c63ae2b0df" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 22364, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/nmodel.py", + "sha256": "6c81064b3cf021bdbe1d3b0e856ed92a5dc115f3f998fdd4c244e5019395c09f" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 23215, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/predict.py", + "sha256": "1205a8bba17e96da9fe8dbc50df404ff3858db31839fbb9bbfceef98283ca7dc" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 35989, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/training_summary.json", + "sha256": "22904d797c5dbb43f12f4c11f0c408ad72bbd685c6ace61c26c21e138055bde0" + } + } + ], + "fingerprint": "9c03fc4ead3ca4bf0849570d1b644378d71b98d3d92643e20262aacbba905827", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S022": { + "checkpoint": "S022", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 8466, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/README.md", + "sha256": "52afe75a807b36eb54dccb3d4ee491425c3937a909f42f82f205113065ad273b" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 3834182176, + "path": "shared/package-files/8f/8f45ea100f7e40f71aba616b1f13f6b46622f17222849254d910cf86282bc558/model.pt", + "sha256": "8f45ea100f7e40f71aba616b1f13f6b46622f17222849254d910cf86282bc558" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 5770, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/model_config.json", + "sha256": "ce2d11d69d6c043ff42e192508897ad1afddefdae972152e2713371f527e7b4b" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 341, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/model_manifest.json", + "sha256": "641428fcdd91200599223ba4c37bcbf2da1624a028c07f9aef2705daf323db91" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 22364, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/nmodel.py", + "sha256": "6c81064b3cf021bdbe1d3b0e856ed92a5dc115f3f998fdd4c244e5019395c09f" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 23215, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/predict.py", + "sha256": "1205a8bba17e96da9fe8dbc50df404ff3858db31839fbb9bbfceef98283ca7dc" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 36054, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/training_summary.json", + "sha256": "7ca490bef3f6db264effa3787ad02bb257f84fab74834cd90249f549ca552145" + } + } + ], + "fingerprint": "85d2b3bfb977f7ecc2bc68a147c470817879662b27d91649ba9dddaec34572e0", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S023": { + "checkpoint": "S023", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 8818, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/README.md", + "sha256": "54f5359384bbafaf4043289dad2582ccdfc88f3ec2054ee42cb2f1c96a49f021" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 4220228412, + "path": "shared/package-files/0e/0e136f14ef920cf8f0cef384c17b7176d18fa7f4733ec9f90b5c476fbcd018c5/model.pt", + "sha256": "0e136f14ef920cf8f0cef384c17b7176d18fa7f4733ec9f90b5c476fbcd018c5" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 6345, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/model_config.json", + "sha256": "502b63134e80a7510469d0e35c0d5c7f47204ae1a5d1c0cca6b0cb18e5b73794" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 343, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/model_manifest.json", + "sha256": "9dfeb7d5ad7d0320a5987fab6b71f415760e08184e459d6ad7c8573c1180feeb" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 22364, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/nmodel.py", + "sha256": "6c81064b3cf021bdbe1d3b0e856ed92a5dc115f3f998fdd4c244e5019395c09f" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 23215, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/predict.py", + "sha256": "1205a8bba17e96da9fe8dbc50df404ff3858db31839fbb9bbfceef98283ca7dc" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 39628, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/training_summary.json", + "sha256": "1d61d5b381611421aa41b41ed00b08541b1bd9b324890831bf2b16b0fc707978" + } + } + ], + "fingerprint": "839589a43209bb787a2cb3b488ac6848a960c06f9771f327939b45ca89f724ba", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + }, + "S024": { + "checkpoint": "S024", + "destination": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024", + "entries": [ + { + "kind": "file", + "mode": 420, + "name": "README.md", + "stored": { + "bytes": 7627, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/README.md", + "sha256": "623b31cf7a96a348c88306288f314df4b5616f14db9d3e8b65f4c20f65109ffe" + } + }, + { + "kind": "file", + "mode": 493, + "name": "infer.sh", + "stored": { + "bytes": 250, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/infer.sh", + "sha256": "7f3f6083c2482244a0a6f172bcdbbd2fcfffe79e6726c85b22bf7cba8af1f42e" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model.pt", + "stored": { + "bytes": 2689153740, + "path": "shared/package-files/93/93107d85335d0ba30f004cd95fac86f5543240e50920a27224d9bc3d579c1b04/model.pt", + "sha256": "93107d85335d0ba30f004cd95fac86f5543240e50920a27224d9bc3d579c1b04" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_config.json", + "stored": { + "bytes": 4065, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/model_config.json", + "sha256": "12aebe5059a26933052a4bcab0636693a047e03f3c73b8f18c0c23b0992749ca" + } + }, + { + "kind": "file", + "mode": 420, + "name": "model_manifest.json", + "stored": { + "bytes": 340, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/model_manifest.json", + "sha256": "74499082cf1ac950fbad0fadb8fce0ce805a76b184d037541515ca9afe76042d" + } + }, + { + "kind": "file", + "mode": 420, + "name": "nmodel.py", + "stored": { + "bytes": 22364, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/nmodel.py", + "sha256": "6c81064b3cf021bdbe1d3b0e856ed92a5dc115f3f998fdd4c244e5019395c09f" + } + }, + { + "kind": "file", + "mode": 420, + "name": "pkgdata.py", + "stored": { + "bytes": 7134, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/pkgdata.py", + "sha256": "d72e01e74cdd3f7eba437dd9ceb143bfd8c1c6072f0847b897b7e75c25df4fc9" + } + }, + { + "kind": "file", + "mode": 420, + "name": "predict.py", + "stored": { + "bytes": 23215, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/predict.py", + "sha256": "1205a8bba17e96da9fe8dbc50df404ff3858db31839fbb9bbfceef98283ca7dc" + } + }, + { + "kind": "file", + "mode": 420, + "name": "requirements.txt", + "stored": { + "bytes": 33, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/requirements.txt", + "sha256": "4dfb855171572405a08e52ae2d00fc50b1e402157f6988738afb34ef32993f62" + } + }, + { + "kind": "file", + "mode": 420, + "name": "training_summary.json", + "stored": { + "bytes": 26014, + "path": "tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/training_summary.json", + "sha256": "2311c258861d9ecbadd0f2e71fd291d8236374d482444b78f1227f5afc135be3" + } + } + ], + "fingerprint": "884cfa6ee351e7a0ed8d0154e84f2eb0a7a13f177e0856576da05e6e3aa0c42f", + "fingerprint_algorithm": "runner/runtime.py names-modes-contents SHA256" + } + }, + "reasoning": "xhigh", + "research_budget_seconds": 172800, + "research_resources_requested": [ + { + "cpuCount": 22, + "gpuCount": 1, + "memory": "224GiB", + "sharedMemory": "32GiB" + } + ], + "research_seconds": 172800, + "run": "target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a", + "schema": "science-speedrun-results/v1", + "scoring_hardware": { + "clusters": [ + "ai2/ceres" + ], + "decided_utc": "2026-11-11T08:06:47.194196+00:00", + "gpu_type": "h100", + "history": [ + { + "clusters": [ + "ai2/prometheus", + "ai2/saturn" + ], + "decided_utc": "2026-11-11T07:26:00.717843+00:00", + "gpu_type": "a100", + "reason": "user ruled \"move to ceres\" before any A100 job had started; upstream task.toml declares H100 for this verifier; no A100 result exists", + "rule": "one GPU type for every scoring job of a task (user ruling 2026-11-11)", + "task": "target-based-drug-screening", + "withdrawn_utc": "2026-11-11T08:06:47.194215+00:00" + } + ], + "rule": "one GPU type for every scoring job of a task (user ruling 2026-11-11)", + "task": "target-based-drug-screening" + }, + "snapshots": [ + { + "evaluation": "S001", + "evaluation_key": "reviewed-inference-v1:f8442549135884fe6a9fad42c7c60d68cd585b8a3738819fe77989eb4c805a72", + "original_package_fingerprint": "61e8fdd965a5920148357b87977fc8c83de6b1fdd2eb300e70d0cc3934f2ed1d", + "package": "S001", + "recorded_snapshot_seconds": 482, + "research_seconds": 482, + "score_origin": "measured", + "snapshot": "S001" + }, + { + "evaluation": "S002", + "evaluation_key": "reviewed-inference-v1:66f572dac05f2dcb5d7cac674667371a0f83a0f7dbf022c014a6be1ffe26dbaa", + "original_package_fingerprint": "512c074aefc9cc0f9cebd0fb6434552aed0c307b423a9fb8b90af024c52af5bf", + "package": "S002", + "recorded_snapshot_seconds": 5350, + "research_seconds": 5350, + "score_origin": "measured", + "snapshot": "S002" + }, + { + "evaluation": "S003", + "evaluation_key": "reviewed-inference-v1:c26e2e17690bc67d5fdfa19b95bf552fefe606136550ed3f707ffb39ff6b5d79", + "original_package_fingerprint": "53045240f1aff55ab5ff214b6949376d0c5ba86ae920271a0ae95c632238209c", + "package": "S003", + "recorded_snapshot_seconds": 16343, + "research_seconds": 16343, + "score_origin": "measured", + "snapshot": "S003" + }, + { + "evaluation": "S004", + "evaluation_key": "reviewed-inference-v1:1df7ddd2292cb9c8a91e468730ce5c97563b52c27b336ceb7b5d5b16e2066014", + "original_package_fingerprint": "944c9a39cd9a575eea597fd46d5a2738be254f804fd56c8853e7932aa3874c0c", + "package": "S004", + "recorded_snapshot_seconds": 16403, + "research_seconds": 16403, + "score_origin": "measured", + "snapshot": "S004" + }, + { + "evaluation": "S005", + "evaluation_key": "reviewed-inference-v1:0dc7cb2e49ca4f0bf88748a8bfedaa30c3dcd1ffaff588f32b0e60c34e512262", + "original_package_fingerprint": "b6ec33dff0c8d30e837c4920ca03d8e5ca657100b3839954c7cdffbd8f082030", + "package": "S005", + "recorded_snapshot_seconds": 21267, + "research_seconds": 21267, + "score_origin": "measured", + "snapshot": "S005" + }, + { + "evaluation": "S006", + "evaluation_key": "reviewed-inference-v1:a0e726d321910f20df9095d182a1360ba5487a8df67721d130d57b863202bcd5", + "original_package_fingerprint": "ed990f4ebfea3458885692379b1d255263098540f2161ce24f60a879689da87e", + "package": "S006", + "recorded_snapshot_seconds": 28415, + "research_seconds": 28415, + "score_origin": "measured", + "snapshot": "S006" + }, + { + "evaluation": "S007", + "evaluation_key": "reviewed-inference-v1:7473431c06daa586464b7c0411aaffb266bcda472c3e503e116f44c906104b29", + "original_package_fingerprint": "875f5eadbfc2e59202caaac8a1653a1407cbcb0812ee9575a6bc9c6681829134", + "package": "S007", + "recorded_snapshot_seconds": 33870, + "research_seconds": 33870, + "score_origin": "measured", + "snapshot": "S007" + }, + { + "evaluation": "S008", + "evaluation_key": "reviewed-inference-v1:e4547c50ca295da4c2de92da51fcd625db93fd278164440a89e2f5ed4c65b886", + "original_package_fingerprint": "924b800c4d7c8cbb6654bf64063dd05a9aafaf738bad608016deed45ebf01037", + "package": "S008", + "recorded_snapshot_seconds": 33990, + "research_seconds": 33990, + "score_origin": "measured", + "snapshot": "S008" + }, + { + "evaluation": "S009", + "evaluation_key": "reviewed-inference-v1:83c33cb53231af71da3f7674704301fffa3fa8923fa20ae842036dd1319592b0", + "original_package_fingerprint": "b359ccc9cc371740c5384372bcac3145c755503dd97aa38ee8849d687a55abc0", + "package": "S009", + "recorded_snapshot_seconds": 42697, + "research_seconds": 42697, + "score_origin": "measured", + "snapshot": "S009" + }, + { + "evaluation": "S010", + "evaluation_key": "reviewed-inference-v1:be6c05993b79679aea09f1ee0433a467fd54dbf06d3551facdcb00e4da370993", + "original_package_fingerprint": "21035d122eb7f2d348fb1dd0ceaa07be82ae2d6e0570ea448e9fd44ef4907a3f", + "package": "S010", + "recorded_snapshot_seconds": 59876, + "research_seconds": 59876, + "score_origin": "measured", + "snapshot": "S010" + }, + { + "evaluation": "S011", + "evaluation_key": "reviewed-inference-v1:0a288efa9c9696a80d1ab8b0bccf48e5daa1f2d24a9bc81ad9ce4f02ada484c4", + "original_package_fingerprint": "fe3bd8ae155499794d8db13c00762de54410e852bd73868b0265059ace7635e7", + "package": "S011", + "recorded_snapshot_seconds": 62971, + "research_seconds": 62971, + "score_origin": "measured", + "snapshot": "S011" + }, + { + "evaluation": "S012", + "evaluation_key": "reviewed-inference-v1:9999b62d703728b5fc1c668de8361f7fd43030dfceb17b76c303a49492bff7f5", + "original_package_fingerprint": "dc97bb61342f945fa0983e644a5f0c2162a659492498a88bedcf48f83174f6af", + "package": "S012", + "recorded_snapshot_seconds": 97496, + "research_seconds": 97496, + "score_origin": "measured", + "snapshot": "S012" + }, + { + "evaluation": "S013", + "evaluation_key": "reviewed-inference-v1:12025a7e4306d09066bb8e8242ca1a48b16be003e1e2a305190cbb659b22377a", + "original_package_fingerprint": "34d179df51dc5a7268042aa79bb7a20be576cadd38c6ecbe87d90e22799c9814", + "package": "S013", + "recorded_snapshot_seconds": 123923, + "research_seconds": 123923, + "score_origin": "measured", + "snapshot": "S013" + }, + { + "evaluation": "S014", + "evaluation_key": "reviewed-inference-v1:13c29cd44340ca6dbf1d913d06c7787b5164ff54a1e66761348f1d5e8696076e", + "original_package_fingerprint": "1baf08993055238531f57d79dd08383fe821ff96f0d3284cf50047741ca0b6c3", + "package": "S014", + "recorded_snapshot_seconds": 128016, + "research_seconds": 128016, + "score_origin": "measured", + "snapshot": "S014" + }, + { + "evaluation": "S015", + "evaluation_key": "reviewed-inference-v1:fbc2de9c771dd7793d292f4d925e4598e5cd3be681dc51d15931a55a75ea5d06", + "original_package_fingerprint": "c1ab3fbf75361590c85944759db1b1f0b5cbaae150f5fb1f93c4e276d12ca2db", + "package": "S015", + "recorded_snapshot_seconds": 132453, + "research_seconds": 132453, + "score_origin": "measured", + "snapshot": "S015" + }, + { + "evaluation": "S016", + "evaluation_key": "reviewed-inference-v1:fc4a1a4757a649cc6427834cdf8ded9ed49d1dd8e16f3fb10d10dd9dd7d59df4", + "original_package_fingerprint": "a097cc347f69bd7c8c72b960f8b5eee64d7e01f2d33add2b1e57141d4b8d7c87", + "package": "S016", + "recorded_snapshot_seconds": 135458, + "research_seconds": 135458, + "score_origin": "measured", + "snapshot": "S016" + }, + { + "evaluation": "S017", + "evaluation_key": "reviewed-inference-v1:7fa6230a08550ba01596e7cdb4bc5a8a71c9fbdc24b1579508a562c64bb943c4", + "original_package_fingerprint": "74f3d3a93a8a9ca066cc7ded7295d0b56ba3e44ce7ec42a398284017c3ea9351", + "package": "S017", + "recorded_snapshot_seconds": 136121, + "research_seconds": 136121, + "score_origin": "measured", + "snapshot": "S017" + }, + { + "evaluation": "S018", + "evaluation_key": "reviewed-inference-v1:db863afd160515875bd51b863dc7ef2151b24c4cb5d7511b75661fdfa0d61cb2", + "original_package_fingerprint": "75821b005f45dbbc61356250d244f59c9cd2c67135946fc819fd83abb9aaba4f", + "package": "S018", + "recorded_snapshot_seconds": 140924, + "research_seconds": 140924, + "score_origin": "measured", + "snapshot": "S018" + }, + { + "evaluation": "S018", + "evaluation_key": "reviewed-inference-v1:db863afd160515875bd51b863dc7ef2151b24c4cb5d7511b75661fdfa0d61cb2", + "original_package_fingerprint": "9343f850d6a85029457aef0d57107cf680ca3ea59f3b1c7a36196db4ad53c6a6", + "package": "S018", + "recorded_snapshot_seconds": 141167, + "research_seconds": 141167, + "score_origin": "reused", + "snapshot": "S019" + }, + { + "evaluation": "S020", + "evaluation_key": "reviewed-inference-v1:8d9e98655dc77765569950da255560c76e7568ad8e152fd19ec5edcc68cc535d", + "original_package_fingerprint": "34ef530a38e752a0b96f739e7545ce9774213f711411ee189e52fa970dcfbdc8", + "package": "S020", + "recorded_snapshot_seconds": 156918, + "research_seconds": 156918, + "score_origin": "measured", + "snapshot": "S020" + }, + { + "evaluation": "S021", + "evaluation_key": "reviewed-inference-v1:9a0769aa9e76378064904cf5f81ea80817ead2148d7766baf2af42fe5a40b22f", + "original_package_fingerprint": "9c03fc4ead3ca4bf0849570d1b644378d71b98d3d92643e20262aacbba905827", + "package": "S021", + "recorded_snapshot_seconds": 164481, + "research_seconds": 164481, + "score_origin": "measured", + "snapshot": "S021" + }, + { + "evaluation": "S022", + "evaluation_key": "reviewed-inference-v1:672b5f19b827b26bd2e997cb5e606a669a5d375082e62b4636cc65a084a474d8", + "original_package_fingerprint": "85d2b3bfb977f7ecc2bc68a147c470817879662b27d91649ba9dddaec34572e0", + "package": "S022", + "recorded_snapshot_seconds": 165322, + "research_seconds": 165322, + "score_origin": "measured", + "snapshot": "S022" + }, + { + "evaluation": "S023", + "evaluation_key": "reviewed-inference-v1:9ef9a8847c6c22a5dc9d548f9343ca228c89443b2711e45b4709c0c48548b822", + "original_package_fingerprint": "839589a43209bb787a2cb3b488ac6848a960c06f9771f327939b45ca89f724ba", + "package": "S023", + "recorded_snapshot_seconds": 171329, + "research_seconds": 171329, + "score_origin": "measured", + "snapshot": "S023" + }, + { + "evaluation": "S024", + "evaluation_key": "reviewed-inference-v1:e9b9b538e3569dd4bc01d5017635411215b19fd58a91e706e24429c5292c4c7b", + "original_package_fingerprint": "884cfa6ee351e7a0ed8d0154e84f2eb0a7a13f177e0856576da05e6e3aa0c42f", + "package": "S024", + "recorded_snapshot_seconds": 172402, + "research_seconds": 172402, + "score_origin": "measured", + "snapshot": "S024" + } + ], + "source_commit": null, + "task": "target-based-drug-screening" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cceb1ec132cf0547e865a94a9eef3ab2add48390 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/README.md @@ -0,0 +1,85 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-largeneg`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **95299226** +- ensemble members: 1 (95299226 parameters each; all members share one + architecture and are shipped as one fixed parameter set used for every + target in both benchmarks) +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 1: multi_bedroc_max=0.0279, multi_bedroc_znorm=0.0384, pm_bedroc=0.0247, pm_mrr=0.0132, pm_top1pct=0.0233, pool_bedroc=0.0658, pool_mrr=0.0046, pool_top1pct=0.0573 + +## Inference + +- ligand conformers averaged per molecule: 1 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `znorm_max` +- hubness correction weight: 0.0 over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Insurance candidate: ProFSA stage only (1 epoch, pocket tower remapped from the generic Uni-Mol checkpoint). Superseded as soon as the BioLiP stage finishes. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..9bbfd65eccaf7c0b13e8b0dc27a254f43d2a3f25 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/model_config.json @@ -0,0 +1,22 @@ +{ + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_vocab": 10, + "proj_hidden": 512, + "proj_layers": 2, + "width": 512 +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..33d86a733a5cd2e21aed36f5b07c992e806ca869 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "755ced67f35b4b3894985cc0411b2d009423a9759213aa05470e0c87a33970d7" + }, + "method": "dual-unimol-largeneg", + "model_config": "model_config.json", + "parameter_count": 95299226, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..3146ab5b753347ffe90f9932639bee46931e9e39 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/nmodel.py @@ -0,0 +1,355 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + size = max(1, self.pair_chunk) + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + config.width, config.embedding_dim, config.proj_hidden, config.proj_layers) + self.pocket_projection = ProjectionHead( + config.width, config.embedding_dim, config.proj_hidden, config.proj_layers) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.molecule_encoder(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pocket_encoder(tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..e59bb5089c8ea429f8ebac2df6ae39a7f819db20 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/pkgdata.py @@ -0,0 +1,175 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per (molecule, conformer slot); slots are spread over the list.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + + def __len__(self) -> int: + return len(self.reader) * self.n_conformers + + def __getitem__(self, j: int): + index, slot = divmod(int(j), self.n_conformers) + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + xyz = _conformers(record["coordinates"]) + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + tokens = np.array([UNK], dtype=np.int64) + coords = np.zeros((1, 3), dtype=np.float32) + else: + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + conformer = xyz[slot % xyz.shape[0]] + if conformer.shape[0] != len(atoms): + conformer = conformer[:len(atoms)] if conformer.shape[0] > len(atoms) else \ + np.pad(conformer, ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + return featurize(tokens, coords, self.max_atoms), index, slot + + +def collate_molecules(batch): + tok, xyz = pad_batch([b[0] for b in batch]) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor([b[1] for b in batch], dtype=torch.long), + "slot": torch.tensor([b[2] for b in batch], dtype=torch.long)} + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + record = reader[i] + names = list(record["pocket_atoms"]) + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..4dada7f2936d8ee4ce4e94218024bfd04e9b4f12 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/predict.py @@ -0,0 +1,235 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import ScreenConfig, ScreenModel, parameter_count # noqa: E402 +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + for state in states: + model = ScreenModel(ScreenConfig(**declared)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, max_atoms: int, device, dtype): + items = read_pockets(path, max_atoms) + out = [] + for model in models: + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append(model.encode_pocket(tok.to(device), xyz.to(device)).float()) + out.append(torch.cat(chunks)) + return out + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + if mode == "znorm_softmax": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=256) + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--background-weight", type=float) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, max_pocket_atoms, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers) + count = len(dataset.reader) + if args.max_ligands: + count = min(count, args.max_ligands) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers) + dataset.reader.n = count + loader = DataLoader(dataset, batch_size=args.batch_size, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + width = models[0].config.embedding_dim + emb_sum = [torch.zeros((count, width), dtype=torch.float32, device=device) + for _ in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + emb = model.encode_molecule(tok, xyz).float() + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = (pocket_embeddings[k] @ mean.T) + if bg_weight and background is not None: + sims = sims - bg_weight * (background[k] @ mean.T).mean( + dim=0, keepdim=True) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..bff245e51676ffef8a1a1d553408f3227b40ca89 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S002/training_summary.json @@ -0,0 +1,86 @@ +{ + "background_rows": 0, + "ensemble_size": 1, + "inference": { + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 1, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "pocket_pooling": "znorm_max" + }, + "members": [ + { + "checkpoint": "/workspace/research/exp/ab_remap/best.pt", + "dev_metrics": { + "multi_bedroc_max": 0.02790846119969282, + "multi_bedroc_znorm": 0.038433803632562685, + "multi_targets": 300, + "pm_bedroc": 0.024737584955372937, + "pm_mrr": 0.013211945719657104, + "pm_top1pct": 0.023333333333333334, + "pool_bedroc": 0.06581573687923624, + "pool_mrr": 0.004640490106080178, + "pool_top1pct": 0.05733333333333333, + "queries": 1500 + }, + "epoch": 1, + "train_args": { + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "256", + "clip_norm": "1.0", + "data": "profsa_pretrain_500k", + "dev_data": "biolip_dev", + "dropout": "0.1", + "embedding_dim": "128", + "epochs": "2", + "eval_every": "1", + "eval_queries": "1500", + "freeze_mol": "True", + "grad_ckpt": "True", + "init": "None", + "init_mol_official": "True", + "init_pkt_official": "True", + "learn_scale": "False", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0003", + "max_hours": "None", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "0", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.1", + "mol_noise": "0.0", + "neg": "65536", + "neighbour_mask": "None", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_noise": "0.0", + "resume": "False", + "seed": "1", + "select": "sum", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/ab_remap", + "workers": "18" + } + } + ], + "method": "dual-unimol-largeneg", + "notes": "Insurance candidate: ProFSA stage only (1 epoch, pocket tower remapped from the generic Uni-Mol checkpoint). Superseded as soon as the BioLiP stage finishes.", + "parameter_count": 95299226, + "parameters_per_member": 95299226, + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f928bb34d6b7ce38de1a4456712e20d24fb222ef --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/README.md @@ -0,0 +1,85 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-largeneg`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **95299226** +- ensemble members: 1 (95299226 parameters each; all members share one + architecture and are shipped as one fixed parameter set used for every + target in both benchmarks) +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 2: dl_pm_bedroc=0.1378, dl_pool_bedroc=0.2416, multi_bedroc_max=0.2935, multi_bedroc_znorm=0.2733, ndl_pm_bedroc=0.1148, ndl_pool_bedroc=0.2204, novel_pm_bedroc=0.2209, novel_pool_bedroc=0.3245, pm_bedroc=0.2847, pm_mrr=0.2010, pm_top1pct=0.2886, pool_bedroc=0.3771, pool_mrr=0.0878, pool_top1pct=0.4004 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +m1 fine-tuning epoch 2 of 18 (EMA weights). Stage 1: ProFSA 8 epochs with the ligand tower frozen and the pocket tower initialised from the remapped generic Uni-Mol checkpoint. Stage 2: BioLiP with both towers trainable. Published mid-run as an improved interim candidate. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..9bbfd65eccaf7c0b13e8b0dc27a254f43d2a3f25 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/model_config.json @@ -0,0 +1,22 @@ +{ + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_vocab": 10, + "proj_hidden": 512, + "proj_layers": 2, + "width": 512 +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..e137deda7e570ebce8d0e3e1b5f8210a781c232b --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "52c6449a681cfdba73b77c9120557162ed767cd593926f821076f73c4665e4b0" + }, + "method": "dual-unimol-largeneg", + "model_config": "model_config.json", + "parameter_count": 95299226, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..7d28a372c408076ceb6f2a3c25352e4fd3b09543 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/nmodel.py @@ -0,0 +1,360 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + config.width, config.embedding_dim, config.proj_hidden, config.proj_layers) + self.pocket_projection = ProjectionHead( + config.width, config.embedding_dim, config.proj_hidden, config.proj_layers) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.molecule_encoder(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pocket_encoder(tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..fea90083ce544c7770b0c69c8d9436b6f34a53b0 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/predict.py @@ -0,0 +1,302 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import ScreenConfig, ScreenModel, parameter_count # noqa: E402 +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + for state in states: + model = ScreenModel(ScreenConfig(**declared)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 32768): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket similarity; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + """ + if mode == "mean": + return sims - weight * (reference.mean(dim=0) @ ligands.T).unsqueeze(0) + if mode != "zscore": + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + block = reference @ ligands[start:start + chunk].T + mu = block.mean(dim=0) + sd = block.std(dim=0) + 1e-6 + window = sims[:, start:start + chunk] + out[:, start:start + chunk] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + width = models[0].config.embedding_dim + emb_sum = [torch.zeros((count, width), dtype=torch.float32, device=device) + for _ in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = (pocket_embeddings[k] @ mean.T) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..51c46a019af4b2139ca9b96c31f7df48c16e7a4d --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S004/training_summary.json @@ -0,0 +1,106 @@ +{ + "background_rows": 0, + "ensemble_size": 1, + "inference": { + "background_mode": "mean", + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "members": [ + { + "checkpoint": "/workspace/research/snap_ep2.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1378289210357818, + "dl_pool_bedroc": 0.24163508663988487, + "dl_queries": 5559, + "multi_bedroc_max": 0.2934936444492691, + "multi_bedroc_znorm": 0.2733424847903766, + "multi_targets": 202, + "ndl_pm_bedroc": 0.1148358920642296, + "ndl_pool_bedroc": 0.22039899289087997, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.22090316096963578, + "novel_pool_bedroc": 0.3244982456347875, + "novel_queries": 8926, + "pm_bedroc": 0.28468582132185366, + "pm_mrr": 0.20097660620466173, + "pm_top1pct": 0.28858333333333336, + "pool_bedroc": 0.37710666418097033, + "pool_mrr": 0.08781383846917025, + "pool_top1pct": 0.40041666666666664, + "queries": 12000 + }, + "epoch": 2, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-largeneg", + "notes": "m1 fine-tuning epoch 2 of 18 (EMA weights). Stage 1: ProFSA 8 epochs with the ligand tower frozen and the pocket tower initialised from the remapped generic Uni-Mol checkpoint. Stage 2: BioLiP with both towers trainable. Published mid-run as an improved interim candidate.", + "parameter_count": 95299226, + "parameters_per_member": 95299226, + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4f4b79a295f48014250ea92e765a8471f2669b5a --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/README.md @@ -0,0 +1,86 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-largeneg-ensemble`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **190598452** +- ensemble members: 2 (95299226 parameters each; all members share one + architecture and are shipped as one fixed parameter set used for every + target in both benchmarks) +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 3: dl_pm_bedroc=0.1460, dl_pool_bedroc=0.2495, multi_bedroc_max=0.2851, multi_bedroc_znorm=0.2556, ndl_pm_bedroc=0.1231, ndl_pool_bedroc=0.2289, novel_pm_bedroc=0.2290, novel_pool_bedroc=0.3195, pm_bedroc=0.2927, pm_mrr=0.2171, pm_top1pct=0.2950, pool_bedroc=0.3740, pool_mrr=0.0914, pool_top1pct=0.3977 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Two-member ensemble, rank-averaged within each target: m1 BioLiP epoch 5 (18-epoch schedule, seed 1) and ctl BioLiP epoch 3 (6-epoch schedule, seed 2), both EMA weights, both from the same ProFSA stage. Dev proxies: ensemble pm 0.3152 / pool 0.3969 / multi 0.2993 versus best member 0.3106 / 0.3900 / 0.2835. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..9bbfd65eccaf7c0b13e8b0dc27a254f43d2a3f25 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/model_config.json @@ -0,0 +1,22 @@ +{ + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_vocab": 10, + "proj_hidden": 512, + "proj_layers": 2, + "width": 512 +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..b174b6a005d2b97c627847d9c76d16cbcb57795c --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "94290abae7a5623f9381fa9c323368dc0d0cfa8cf69fbd790994ef88f7d0465e" + }, + "method": "dual-unimol-largeneg-ensemble", + "model_config": "model_config.json", + "parameter_count": 190598452, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..7d28a372c408076ceb6f2a3c25352e4fd3b09543 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/nmodel.py @@ -0,0 +1,360 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + config.width, config.embedding_dim, config.proj_hidden, config.proj_layers) + self.pocket_projection = ProjectionHead( + config.width, config.embedding_dim, config.proj_hidden, config.proj_layers) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.molecule_encoder(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pocket_encoder(tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..fea90083ce544c7770b0c69c8d9436b6f34a53b0 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/predict.py @@ -0,0 +1,302 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import ScreenConfig, ScreenModel, parameter_count # noqa: E402 +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + for state in states: + model = ScreenModel(ScreenConfig(**declared)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 32768): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket similarity; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + """ + if mode == "mean": + return sims - weight * (reference.mean(dim=0) @ ligands.T).unsqueeze(0) + if mode != "zscore": + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + block = reference @ ligands[start:start + chunk].T + mu = block.mean(dim=0) + sd = block.std(dim=0) + 1e-6 + window = sims[:, start:start + chunk] + out[:, start:start + chunk] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + width = models[0].config.embedding_dim + emb_sum = [torch.zeros((count, width), dtype=torch.float32, device=device) + for _ in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = (pocket_embeddings[k] @ mean.T) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..188c9bc35c25ae61b576a0c618442494ea751f5d --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S006/training_summary.json @@ -0,0 +1,188 @@ +{ + "background_rows": 0, + "ensemble_size": 2, + "inference": { + "background_mode": "mean", + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "members": [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_ctl.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1460137843661376, + "dl_pool_bedroc": 0.2495366477160516, + "dl_queries": 5559, + "multi_bedroc_max": 0.2851170214468887, + "multi_bedroc_znorm": 0.25560322706588867, + "multi_targets": 202, + "ndl_pm_bedroc": 0.12307180061054614, + "ndl_pool_bedroc": 0.22893389555363877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.22898944291394138, + "novel_pool_bedroc": 0.3195295407859072, + "novel_queries": 8926, + "pm_bedroc": 0.2926543869360366, + "pm_mrr": 0.21706177591622622, + "pm_top1pct": 0.295, + "pool_bedroc": 0.37402115809102393, + "pool_mrr": 0.09136730085942933, + "pool_top1pct": 0.39775, + "queries": 12000 + }, + "epoch": 3, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "6", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.0", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "2", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/ctl_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-largeneg-ensemble", + "notes": "Two-member ensemble, rank-averaged within each target: m1 BioLiP epoch 5 (18-epoch schedule, seed 1) and ctl BioLiP epoch 3 (6-epoch schedule, seed 2), both EMA weights, both from the same ProFSA stage. Dev proxies: ensemble pm 0.3152 / pool 0.3969 / multi 0.2993 versus best member 0.3106 / 0.3900 / 0.2835.", + "parameter_count": 190598452, + "parameters_per_member": 95299226, + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b8a196ef609b0f88ffbcbee8ff34fc6f6504c4f7 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/README.md @@ -0,0 +1,82 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-druglike-balanced`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **190598452** +- ensemble members: 2 (95299226 parameters each; all members share one + architecture and are shipped as one fixed parameter set used for every + target in both benchmarks) +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower starts from random weights. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Rank-averaged pair of dual-tower Uni-Mol screens sharing one ProFSA-pretrained initialisation. Member 1 (dlx, epoch 8) fine-tunes on a BioLiP positive distribution rebalanced toward drug-like ligands: every drug-like pair plus an equal number of randomly drawn non-drug-like pairs, 156,124 of 356,420 pairs per epoch, with the full 71,952-ligand negative bank unchanged. Member 2 (m1, epoch 5) uses the unmodified distribution; the two differ in what they were asked to rank, which is what makes the rank average worth more than either alone. Selected on held-out BioLiP development records by BEDROC(80.5) over novel drug-like queries against property-matched decoys. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..c3f65790c241ad646493f5d1a11af2ccd28662e1 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/model_config.json @@ -0,0 +1,25 @@ +{ + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..79f5d00bf12fb631d625d7f0559f799d7bc84785 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "b44bb92bfaa3710573ef556b3b95fdae347a30327dc0a6e4e430794f717bc060" + }, + "method": "dual-unimol-druglike-balanced", + "model_config": "model_config.json", + "parameter_count": 190598452, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..a81a53583331251bed6595b3d0419f0bcafbbfae --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/predict.py @@ -0,0 +1,310 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + for state in states: + model = ScreenModel(ScreenConfig(**declared)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + width = models[0].config.embedding_dim + emb_sum = [torch.zeros((count, width), dtype=torch.float32, device=device) + for _ in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..69dbf6e9101c5eb40538073ffdb81f81335fe9dd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S007/training_summary.json @@ -0,0 +1,191 @@ +{ + "background_rows": 0, + "ensemble_size": 2, + "inference": { + "background_mode": "mean", + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-druglike-balanced", + "notes": "Rank-averaged pair of dual-tower Uni-Mol screens sharing one ProFSA-pretrained initialisation. Member 1 (dlx, epoch 8) fine-tunes on a BioLiP positive distribution rebalanced toward drug-like ligands: every drug-like pair plus an equal number of randomly drawn non-drug-like pairs, 156,124 of 356,420 pairs per epoch, with the full 71,952-ligand negative bank unchanged. Member 2 (m1, epoch 5) uses the unmodified distribution; the two differ in what they were asked to rank, which is what makes the rank average worth more than either alone. Selected on held-out BioLiP development records by BEDROC(80.5) over novel drug-like queries against property-matched decoys.", + "parameter_count": 190598452, + "parameters_per_member": 95299226, + "pocket_init_remapped": false, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9e57f0990a5c5e7d8f7358d3571d32e910489431 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/README.md @@ -0,0 +1,86 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-druglike-balanced`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **190598452** +- ensemble members: 2 (95299226 parameters each; all members share one + architecture and are shipped as one fixed parameter set used for every + target in both benchmarks) +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Rank-averaged pair of dual-tower Uni-Mol screens sharing one ProFSA-pretrained initialisation. Member 1 (dlx, epoch 8) fine-tunes on a BioLiP positive distribution rebalanced toward drug-like ligands: every drug-like pair plus an equal number of randomly drawn non-drug-like pairs, 156,124 of 356,420 pairs per epoch, with the full 71,952-ligand negative bank unchanged. Member 2 (m1, epoch 5) uses the unmodified distribution; the two differ in what they were asked to rank, which is what makes the rank average worth more than either alone. Selected on held-out BioLiP development records by BEDROC(80.5) over novel drug-like queries against property-matched decoys. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..c3f65790c241ad646493f5d1a11af2ccd28662e1 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/model_config.json @@ -0,0 +1,25 @@ +{ + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..79f5d00bf12fb631d625d7f0559f799d7bc84785 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "b44bb92bfaa3710573ef556b3b95fdae347a30327dc0a6e4e430794f717bc060" + }, + "method": "dual-unimol-druglike-balanced", + "model_config": "model_config.json", + "parameter_count": 190598452, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..a81a53583331251bed6595b3d0419f0bcafbbfae --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/predict.py @@ -0,0 +1,310 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + for state in states: + model = ScreenModel(ScreenConfig(**declared)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + width = models[0].config.embedding_dim + emb_sum = [torch.zeros((count, width), dtype=torch.float32, device=device) + for _ in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..e733c2cc946ffd720e2afe345516413dca482b0d --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S008/training_summary.json @@ -0,0 +1,226 @@ +{ + "background_rows": 0, + "ensemble_size": 2, + "inference": { + "background_mode": "mean", + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-druglike-balanced", + "molecule_init_official": true, + "notes": "Rank-averaged pair of dual-tower Uni-Mol screens sharing one ProFSA-pretrained initialisation. Member 1 (dlx, epoch 8) fine-tunes on a BioLiP positive distribution rebalanced toward drug-like ligands: every drug-like pair plus an equal number of randomly drawn non-drug-like pairs, 156,124 of 356,420 pairs per epoch, with the full 71,952-ligand negative bank unchanged. Member 2 (m1, epoch 5) uses the unmodified distribution; the two differ in what they were asked to rank, which is what makes the rank average worth more than either alone. Selected on held-out BioLiP development records by BEDROC(80.5) over novel drug-like queries against property-matched decoys.", + "parameter_count": 190598452, + "parameters_per_member": 95299226, + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/README.md new file mode 100644 index 0000000000000000000000000000000000000000..adf6220631ff42886dee2be0efe1595aa6a64067 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/README.md @@ -0,0 +1,87 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-druglike-mixed`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **285897678** +- ensemble members: 3 (95299226 parameters each; all members share one + architecture and are shipped as one fixed parameter set used for every + target in both benchmarks) +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Rank-averaged ensemble of three dual-tower Uni-Mol screens from one shared ProFSA-pretrained initialisation, combined after per-target pocket pooling. Members 1 and 2 fine-tune on a BioLiP positive distribution rebalanced toward drug-like ligands (every drug-like pair plus an equal number of randomly drawn others, 156,124 of 356,420 per epoch) against the full 71,952-ligand negative bank; member 2 additionally represents each pocket by four vectors and scores a pair by the best match over them. Member 3 uses the unmodified positive distribution and is kept because it is stronger on the non-drug-like half of the development set, which hedges the assumption that the benchmark libraries are entirely drug-like. Selected on held-out BioLiP development records by BEDROC(80.5) over novel drug-like queries against property-matched decoys. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..2fb96ec8e89dc9781c79d131a4944ee99e87777e --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/model_config.json @@ -0,0 +1,80 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..a9afd8a9af45b02633d73b13be9f63a7512cfd76 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "af00c577c81cc45d9684248bd72c9a1a9378ebc162a2479f2af6e223ca368f72" + }, + "method": "dual-unimol-druglike-mixed", + "model_config": "model_config.json", + "parameter_count": 285897678, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..b0aa9db973e78b8fd5dda007af5a8baaee0436e9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/predict.py @@ -0,0 +1,320 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + width = models[0].config.embedding_dim + emb_sum = [torch.zeros((count, width), dtype=torch.float32, device=device) + for _ in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..e96f9f95b5b6f91c9c56758abcf82d0c572646c8 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S009/training_summary.json @@ -0,0 +1,332 @@ +{ + "background_rows": 0, + "ensemble_size": 3, + "inference": { + "background_mode": "mean", + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-druglike-mixed", + "molecule_init_official": true, + "notes": "Rank-averaged ensemble of three dual-tower Uni-Mol screens from one shared ProFSA-pretrained initialisation, combined after per-target pocket pooling. Members 1 and 2 fine-tune on a BioLiP positive distribution rebalanced toward drug-like ligands (every drug-like pair plus an equal number of randomly drawn others, 156,124 of 356,420 per epoch) against the full 71,952-ligand negative bank; member 2 additionally represents each pocket by four vectors and scores a pair by the best match over them. Member 3 uses the unmodified positive distribution and is kept because it is stronger on the non-drug-like half of the development set, which hedges the assumption that the benchmark libraries are entirely drug-like. Selected on held-out BioLiP development records by BEDROC(80.5) over novel drug-like queries against property-matched decoys.", + "parameter_count": 285897678, + "parameters_per_member": 95299226, + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7762170b4b9f724da1ba3df84bd5a95a46ad292c --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/README.md @@ -0,0 +1,88 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-druglike-mixed`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **381196904** +- ensemble members: 4 (95299226 parameters each; all members share one + architecture and are shipped as one fixed parameter set used for every + target in both benchmarks) +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Rank-averaged ensemble of four dual-tower Uni-Mol screens from one shared ProFSA-pretrained initialisation, combined after per-target pocket pooling. Three members fine-tune on a BioLiP positive distribution rebalanced toward drug-like ligands (every drug-like pair plus an equal number of randomly drawn others, 156,124 of 356,420 per epoch) against the full 71,952-ligand negative bank: one baseline, one that represents each pocket by four vectors and scores a pair by the best match over them, and one trained without pocket-crop augmentation. The fourth uses the unmodified positive distribution and is kept because it is stronger on the non-drug-like half of the development set, which hedges the assumption that the benchmark libraries are entirely drug-like. Selected on held-out BioLiP development records by BEDROC(80.5) over novel drug-like queries against property-matched decoys; the ensemble was chosen by a paired bootstrap over all two-, three- and four-member subsets of six candidates. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..b84e133b1cd392034f6fba92ae0862b5d1d3cecb --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/model_config.json @@ -0,0 +1,105 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..6ac6ddfcac8beff45617565cc2928b2f6e4857f3 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "9e16985dc742ba1458c33dfc24500f25490174db051199c667d73391459a1d2d" + }, + "method": "dual-unimol-druglike-mixed", + "model_config": "model_config.json", + "parameter_count": 381196904, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..b0aa9db973e78b8fd5dda007af5a8baaee0436e9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/predict.py @@ -0,0 +1,320 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + width = models[0].config.embedding_dim + emb_sum = [torch.zeros((count, width), dtype=torch.float32, device=device) + for _ in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S010/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..07bfdc60bfdddf8b4852ad7682081ddca9eb1606 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/predict.py @@ -0,0 +1,323 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S011/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/README.md new file mode 100644 index 0000000000000000000000000000000000000000..29e6b3f1c65fc058e03af6fea5dabbd26f063a19 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/README.md @@ -0,0 +1,91 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-druglike-diverse7`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **667096118** +- ensemble members: 7 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +7-member rank-averaged ensemble; +0.0142 ndl_pm over published 4-member (paired CI [+0.0099,+0.0183]) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..4c7ba07ff9a78f2d16b2b2ff247163f35fc7a3b7 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "eeab5face2889f11c363c52a4a7b168373cc71f595824d9c925421159a54028e" + }, + "method": "dual-unimol-druglike-diverse7", + "model_config": "model_config.json", + "parameter_count": 667096118, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..462214c9ff39cb001d536bbb971cd5e81f7a9211 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S012/training_summary.json @@ -0,0 +1,773 @@ +{ + "background_rows": 0, + "ensemble_size": 7, + "inference": { + "background_mode": "mean", + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-druglike-diverse7", + "molecule_init_official": true, + "notes": "7-member rank-averaged ensemble; +0.0142 ndl_pm over published 4-member (paired CI [+0.0099,+0.0183])", + "parameter_count": 667096118, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d932d690686fdc4e866f830e6bc3ec8c8b7eb30f --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/README.md @@ -0,0 +1,93 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-druglike-diverse9`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **858350186** +- ensemble members: 9 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +9-member rank-averaged ensemble; +0.0040 ndl_pm and +0.0116 multi over the published 7-member (paired CIs exclude zero) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..84a6b22655d6717777ca6535f3e8f10540b0c315 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/model_config.json @@ -0,0 +1,230 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..b228c9991cf95de7ac0a05bb546118ccdcb15a9d --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "e3f9792a9638d0abab7144cc17a1eae5558829d75150c1b3c86224325a6d48a0" + }, + "method": "dual-unimol-druglike-diverse9", + "model_config": "model_config.json", + "parameter_count": 858350186, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..07bfdc60bfdddf8b4852ad7682081ddca9eb1606 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/predict.py @@ -0,0 +1,323 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = sum(p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..53f5efb16bbec962108c793570dd6bc0850fc459 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S013/training_summary.json @@ -0,0 +1,989 @@ +{ + "background_rows": 0, + "ensemble_size": 9, + "inference": { + "background_mode": "mean", + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-druglike-diverse9", + "molecule_init_official": true, + "notes": "9-member rank-averaged ensemble; +0.0040 ndl_pm and +0.0116 multi over the published 7-member (paired CIs exclude zero)", + "parameter_count": 858350186, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8e5a89a4c8275efbd125c466b6024e6d5bbcf352 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/README.md @@ -0,0 +1,94 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-druglike-top7c2`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **858350186** +- ensemble members: 9 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 + +## Inference + +- ligand conformers averaged per molecule: 2 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `top7` +- hubness correction: mode `mean`, weight 0.0, over 0 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +9 members, top7 rank reduction, 2 conformers diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..84a6b22655d6717777ca6535f3e8f10540b0c315 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/model_config.json @@ -0,0 +1,230 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..d910c0d8fc3e5df275c5e4bb8e756092f53a3a07 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "aa72b1b569e7ea00f856566b2089fd5eabe92af0e4c3f9e774485bda7a5d0fbf" + }, + "method": "dual-unimol-druglike-top7c2", + "model_config": "model_config.json", + "parameter_count": 858350186, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..82b6415db53d714a80f378a5507241c437929536 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/predict.py @@ -0,0 +1,368 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def combine_members(per_model: list, mode: str) -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..51eb95461463ac82d895e272662581d32e554fcc --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S014/training_summary.json @@ -0,0 +1,990 @@ +{ + "background_rows": 0, + "ensemble_size": 9, + "inference": { + "background_mode": "mean", + "background_weight": 0.0, + "conformer_pooling": "mean", + "conformers": 2, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "member_combine": "top7", + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-druglike-top7c2", + "molecule_init_official": true, + "notes": "9 members, top7 rank reduction, 2 conformers", + "parameter_count": 858350186, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dd262ade815d255935578724e605eae81ecfc27a --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/README.md @@ -0,0 +1,94 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-druglike-top7c2hub`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **858350186** +- ensemble members: 9 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 + +## Inference + +- ligand conformers averaged per molecule: 2 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `top7` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +9 members, top7 reduction, 2 conformers, hubness mean@0.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..84a6b22655d6717777ca6535f3e8f10540b0c315 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/model_config.json @@ -0,0 +1,230 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..ca748bf27b86deb9d8de918b5909d5e5a1ccb276 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "95a8785f639fe6a4bb11c88f7620c623a3df85526485649e15a2586e6fadd7df" + }, + "method": "dual-unimol-druglike-top7c2hub", + "model_config": "model_config.json", + "parameter_count": 858350186, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..82b6415db53d714a80f378a5507241c437929536 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/predict.py @@ -0,0 +1,368 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def combine_members(per_model: list, mode: str) -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([p.argsort().argsort().astype(np.float64) + / max(1, len(p) - 1) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..70f909cbd3517f3d71ce95962542b7376bebb8cb --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S015/training_summary.json @@ -0,0 +1,990 @@ +{ + "background_rows": 2048, + "ensemble_size": 9, + "inference": { + "background_mode": "mean", + "background_weight": 0.5, + "conformer_pooling": "mean", + "conformers": 2, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "member_combine": "top7", + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-druglike-top7c2hub", + "molecule_init_official": true, + "notes": "9 members, top7 reduction, 2 conformers, hubness mean@0.5", + "parameter_count": 858350186, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cecc8e93e75b0c7e8c74b70892a95c739ba5a5d1 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/README.md @@ -0,0 +1,95 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-ztop7c2hub`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **858350186** +- ensemble members: 9 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 + +## Inference + +- ligand conformers averaged per molecule: 2 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `top7` +- member normalisation: `z` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +9 members, z-normalised top7 reduction, 2 conformers, hubness mean@0.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..84a6b22655d6717777ca6535f3e8f10540b0c315 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/model_config.json @@ -0,0 +1,230 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..fe50d27fd5f73b22e917b84570eb620dc712a3e7 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "1785e6526794c66fd8f8866a44efbd1cefa4e851f5c6897a408d2fa35ebe9ac1" + }, + "method": "dual-unimol-ztop7c2hub", + "model_config": "model_config.json", + "parameter_count": 858350186, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..448e53151b6e0b5149ae4f68d2e4968bcb53520b --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/predict.py @@ -0,0 +1,401 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def normalise_member(x: np.ndarray, how: str) -> np.ndarray: + """Put one member's scores for THIS target on a common scale. + + Normalisation is per target candidate list, which is the only population + available at inference and the one the dev measurement was matched to. + + `rank` is invariant to any monotone rescaling, which is maximally safe + across members of differing width -- but it discards magnitude, so a + member that is screamingly confident about a ligand and one that barely + prefers it cast identical votes. `z` keeps that magnitude and measured + +0.0062 [+0.0048,+0.0076] on the DUD-E-shaped dev proxy scored the way + this function scores (normalise within the candidate list, then combine). + `mad` is the robust variant and measured slightly behind `z`. + """ + if how == "rank": + return x.argsort().argsort().astype(np.float64) / max(1, len(x) - 1) + if how == "z": + return (x - x.mean()) / (x.std() + 1e-12) + if how == "mad": + med = np.median(x) + mad = np.median(np.abs(x - med)) + return 0.6745 * (x - med) / (mad + 1e-12) + raise ValueError(f"unknown member normalisation {how!r}") + + +def combine_members(per_model: list, mode: str, + normalise: str = "rank") -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([normalise_member(p, normalise) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-normalise", choices=("rank", "z", "mad"), + help="per-member score normalisation within a " + "target's candidate list") + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + # Default "rank" keeps older packages, which carry no member_normalise + # key, scoring exactly as they did before this setting existed. + member_normalise = (args.member_normalise + or settings.get("member_normalise", "rank")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine, + member_normalise) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..80a6a17393f9010d39b65dd1096b8d23b67e890a --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S016/training_summary.json @@ -0,0 +1,991 @@ +{ + "background_rows": 2048, + "ensemble_size": 9, + "inference": { + "background_mode": "mean", + "background_weight": 0.5, + "conformer_pooling": "mean", + "conformers": 2, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "member_combine": "top7", + "member_normalise": "z", + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-ztop7c2hub", + "molecule_init_official": true, + "notes": "9 members, z-normalised top7 reduction, 2 conformers, hubness mean@0.5", + "parameter_count": 858350186, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c35446c8595fb8cff8e6ef55809cc36fb7151d93 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/README.md @@ -0,0 +1,95 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-ztop7c4hub`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **858350186** +- ensemble members: 9 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `top7` +- member normalisation: `z` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +9 members, z-normalised top7 reduction, 4 conformers, hubness mean@0.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..84a6b22655d6717777ca6535f3e8f10540b0c315 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/model_config.json @@ -0,0 +1,230 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..52ae5c06891b8a0b03f108588d1164cb4b52e9d9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "4949adfb6da7703a3f9ec4ff572d006f7d36c191c23ade21615e8270aeaf0c18" + }, + "method": "dual-unimol-ztop7c4hub", + "model_config": "model_config.json", + "parameter_count": 858350186, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..448e53151b6e0b5149ae4f68d2e4968bcb53520b --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/predict.py @@ -0,0 +1,401 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def normalise_member(x: np.ndarray, how: str) -> np.ndarray: + """Put one member's scores for THIS target on a common scale. + + Normalisation is per target candidate list, which is the only population + available at inference and the one the dev measurement was matched to. + + `rank` is invariant to any monotone rescaling, which is maximally safe + across members of differing width -- but it discards magnitude, so a + member that is screamingly confident about a ligand and one that barely + prefers it cast identical votes. `z` keeps that magnitude and measured + +0.0062 [+0.0048,+0.0076] on the DUD-E-shaped dev proxy scored the way + this function scores (normalise within the candidate list, then combine). + `mad` is the robust variant and measured slightly behind `z`. + """ + if how == "rank": + return x.argsort().argsort().astype(np.float64) / max(1, len(x) - 1) + if how == "z": + return (x - x.mean()) / (x.std() + 1e-12) + if how == "mad": + med = np.median(x) + mad = np.median(np.abs(x - med)) + return 0.6745 * (x - med) / (mad + 1e-12) + raise ValueError(f"unknown member normalisation {how!r}") + + +def combine_members(per_model: list, mode: str, + normalise: str = "rank") -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([normalise_member(p, normalise) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-normalise", choices=("rank", "z", "mad"), + help="per-member score normalisation within a " + "target's candidate list") + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + # Default "rank" keeps older packages, which carry no member_normalise + # key, scoring exactly as they did before this setting existed. + member_normalise = (args.member_normalise + or settings.get("member_normalise", "rank")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine, + member_normalise) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..d8c835ec41972767a054c825b52bd9d7730f537d --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S017/training_summary.json @@ -0,0 +1,991 @@ +{ + "background_rows": 2048, + "ensemble_size": 9, + "inference": { + "background_mode": "mean", + "background_weight": 0.5, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "member_combine": "top7", + "member_normalise": "z", + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-ztop7c4hub", + "molecule_init_official": true, + "notes": "9 members, z-normalised top7 reduction, 4 conformers, hubness mean@0.5", + "parameter_count": 858350186, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/README.md new file mode 100644 index 0000000000000000000000000000000000000000..da64f021efca00e47f387aa0c842ca7fa758bd06 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/README.md @@ -0,0 +1,96 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-ztop7c4hub10`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **954305028** +- ensemble members: 10 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554, 95954842 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 +- epoch 6: dl_pm_bedroc=0.1814, dl_pool_bedroc=0.2837, mpm_bedroc=0.2604, multi_bedroc_max=0.3144, multi_bedroc_znorm=0.3120, ndl_pm_bedroc=0.1592, ndl_pool_bedroc=0.2643, novel_pm_bedroc=0.2478, novel_pool_bedroc=0.3461, pm_bedroc=0.3088, pm_mrr=0.2220, pm_top1pct=0.3079, pool_bedroc=0.3952, pool_mrr=0.0876, pool_top1pct=0.4243 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `top7` +- member normalisation: `z` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are combined by averaging within-target normalised ranks, + which is invariant to each member's score scale + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +10 members, z-normalised top7 reduction, 4 conformers, hubness mean@0.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..94c02a89d9265ecd0ad7de39b18628af735d1861 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/model_config.json @@ -0,0 +1,255 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..e1528cb8efdbedc22504294d3cf04a03cf451fe2 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "aa6503d77ffcb7fd82a4dc82a6a31fff1fddb5541c6af35addeaa3c7e5ca3fdd" + }, + "method": "dual-unimol-ztop7c4hub10", + "model_config": "model_config.json", + "parameter_count": 954305028, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..acb05c139ab3438c3a382eb93abe708a6dca3faa --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/nmodel.py @@ -0,0 +1,465 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected tower output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..448e53151b6e0b5149ae4f68d2e4968bcb53520b --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/predict.py @@ -0,0 +1,401 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def normalise_member(x: np.ndarray, how: str) -> np.ndarray: + """Put one member's scores for THIS target on a common scale. + + Normalisation is per target candidate list, which is the only population + available at inference and the one the dev measurement was matched to. + + `rank` is invariant to any monotone rescaling, which is maximally safe + across members of differing width -- but it discards magnitude, so a + member that is screamingly confident about a ligand and one that barely + prefers it cast identical votes. `z` keeps that magnitude and measured + +0.0062 [+0.0048,+0.0076] on the DUD-E-shaped dev proxy scored the way + this function scores (normalise within the candidate list, then combine). + `mad` is the robust variant and measured slightly behind `z`. + """ + if how == "rank": + return x.argsort().argsort().astype(np.float64) / max(1, len(x) - 1) + if how == "z": + return (x - x.mean()) / (x.std() + 1e-12) + if how == "mad": + med = np.median(x) + mad = np.median(np.abs(x - med)) + return 0.6745 * (x - med) / (mad + 1e-12) + raise ValueError(f"unknown member normalisation {how!r}") + + +def combine_members(per_model: list, mode: str, + normalise: str = "rank") -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([normalise_member(p, normalise) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-normalise", choices=("rank", "z", "mad"), + help="per-member score normalisation within a " + "target's candidate list") + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + # Default "rank" keeps older packages, which carry no member_normalise + # key, scoring exactly as they did before this setting existed. + member_normalise = (args.member_normalise + or settings.get("member_normalise", "rank")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine, + member_normalise) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S018/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/README.md new file mode 100644 index 0000000000000000000000000000000000000000..30af88ee72c342d293dc8e154080d688a4b03bdf --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/README.md @@ -0,0 +1,96 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-zlse06c4hub10`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **954305028** +- ensemble members: 10 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554, 95954842 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 +- epoch 6: dl_pm_bedroc=0.1814, dl_pool_bedroc=0.2837, mpm_bedroc=0.2604, multi_bedroc_max=0.3144, multi_bedroc_znorm=0.3120, ndl_pm_bedroc=0.1592, ndl_pool_bedroc=0.2643, novel_pm_bedroc=0.2478, novel_pool_bedroc=0.3461, pm_bedroc=0.3088, pm_mrr=0.2220, pm_top1pct=0.3079, pool_bedroc=0.3952, pool_mrr=0.0876, pool_top1pct=0.4243 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `lse0.6` +- member normalisation: `z` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are scored independently, each member's scores are + normalised within the target's own candidate list (z-normalised, which preserves score magnitude), and the per-member values are then reduced with `lse0.6` ((1/0.6) log mean exp(0.6 x value), a smooth interpolation between the mean and the max that down-weights dissenting members instead of discarding a fixed number of them) + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Member reduction top7 -> lse0.6 (smooth log-sum-exp mean/max interpolation). Chosen on a smooth plateau of dl/ndl rather than the pm_local argmax; see NOTES. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..94c02a89d9265ecd0ad7de39b18628af735d1861 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/model_config.json @@ -0,0 +1,255 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..d25cf2629b41ef7bf012251c7c7854f595d00792 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "3dba4324393ef6903a26c4d47db7e8a60045576cd2c83fcf1305666f716fb504" + }, + "method": "dual-unimol-zlse06c4hub10", + "model_config": "model_config.json", + "parameter_count": 954305028, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..91e6412832dda89f61ecebcf9a87492dae6538c9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/nmodel.py @@ -0,0 +1,484 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.pocket_hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected MOLECULE output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + @property + def pocket_hidden_dim(self) -> int: + """Width of the un-projected POCKET output. + + It differs from `hidden_dim` only for `pkt_slots > 1`, where `pool()` + returns early with one `width`-sized vector per slot and never applies + the `cls_mean` concatenation. Sharing a single dimension made + `--pool cls_mean --pkt-slots 4` fail at the first forward pass with + "mat1 and mat2 shapes cannot be multiplied (492x512 and 1024x512)", + because the molecule tower emitted 2*width and the pocket tower width. + + No-op for every configuration trained so far: when `pkt_slots > 1` the + existing members all use `pool="cls"`, for which the two dimensions + already coincide. + """ + if self.config.pkt_slots > 1: + return self.config.width + return self.hidden_dim + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..6643eb56811fa08075329674e1e9d30db81a49d8 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/predict.py @@ -0,0 +1,415 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +def normalise_member(x: np.ndarray, how: str) -> np.ndarray: + """Put one member's scores for THIS target on a common scale. + + Normalisation is per target candidate list, which is the only population + available at inference and the one the dev measurement was matched to. + + `rank` is invariant to any monotone rescaling, which is maximally safe + across members of differing width -- but it discards magnitude, so a + member that is screamingly confident about a ligand and one that barely + prefers it cast identical votes. `z` keeps that magnitude and measured + +0.0062 [+0.0048,+0.0076] on the DUD-E-shaped dev proxy scored the way + this function scores (normalise within the candidate list, then combine). + `mad` is the robust variant and measured slightly behind `z`. + """ + if how == "rank": + return x.argsort().argsort().astype(np.float64) / max(1, len(x) - 1) + if how == "z": + return (x - x.mean()) / (x.std() + 1e-12) + if how == "mad": + med = np.median(x) + mad = np.median(np.abs(x - med)) + return 0.6745 * (x - med) / (mad + 1e-12) + raise ValueError(f"unknown member normalisation {how!r}") + + +def combine_members(per_model: list, mode: str, + normalise: str = "rank") -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([normalise_member(p, normalise) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + if mode.startswith("lse"): + # (1/b) log mean exp(b s): the smooth interpolation between the mean + # (b -> 0) and the max (b -> inf). `topK` samples that same + # "discount the dissenters" axis, but only at integers and with a + # hard cutoff; the smooth form weights every member by how high it + # scored instead of keeping k and discarding the rest. + # + # Shifted by the per-ligand max before exponentiating, so the + # exponent is never positive and this cannot overflow for any b. + b = float(mode[len("lse"):]) + if not b > 0: + raise ValueError(f"member combine {mode!r} needs a positive beta") + m = stack.max(axis=0) + return m + np.log(np.exp(b * (stack - m)).mean(axis=0)) / b + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-normalise", choices=("rank", "z", "mad"), + help="per-member score normalisation within a " + "target's candidate list") + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + # Default "rank" keeps older packages, which carry no member_normalise + # key, scoring exactly as they did before this setting existed. + member_normalise = (args.member_normalise + or settings.get("member_normalise", "rank")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine, + member_normalise) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..5e31ae10ee2426c8f00bc0a6ec93ee56bad5d7f0 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S020/training_summary.json @@ -0,0 +1,1099 @@ +{ + "background_rows": 2048, + "ensemble_size": 10, + "inference": { + "background_mode": "mean", + "background_weight": 0.5, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "member_combine": "lse0.6", + "member_normalise": "z", + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm256_ep6.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm256_ep6.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.18135241294207832, + "dl_pool_bedroc": 0.2837347500594526, + "dl_queries": 5559, + "mpm_bedroc": 0.26044486582935344, + "mpm_targets": 202, + "multi_bedroc_max": 0.31441598547439653, + "multi_bedroc_znorm": 0.3120025801452303, + "multi_targets": 202, + "ndl_pm_bedroc": 0.1592227672369005, + "ndl_pool_bedroc": 0.26434652384193025, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24776520920496842, + "novel_pool_bedroc": 0.346050838337958, + "novel_queries": 8926, + "pm_bedroc": 0.30882754918366695, + "pm_mrr": 0.22204750940452253, + "pm_top1pct": 0.30791666666666667, + "pool_bedroc": 0.39521698966643853, + "pool_mrr": 0.08761897391052133, + "pool_top1pct": 0.42425, + "queries": 12000 + }, + "epoch": 6, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "33", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm256_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-zlse06c4hub10", + "molecule_init_official": true, + "notes": "Member reduction top7 -> lse0.6 (smooth log-sum-exp mean/max interpolation). Chosen on a smooth plateau of dl/ndl rather than the pm_local argmax; see NOTES.", + "parameter_count": 954305028, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554, + 95954842 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554, + 95954842 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f0a1154de554bc67196c795427af9875a1aab73e --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/README.md @@ -0,0 +1,103 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-zlse06c4hub10`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **954305028** +- ensemble members: 10 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554, 95954842 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 +- epoch 6: dl_pm_bedroc=0.1814, dl_pool_bedroc=0.2837, mpm_bedroc=0.2604, multi_bedroc_max=0.3144, multi_bedroc_znorm=0.3120, ndl_pm_bedroc=0.1592, ndl_pool_bedroc=0.2643, novel_pm_bedroc=0.2478, novel_pool_bedroc=0.3461, pm_bedroc=0.3088, pm_mrr=0.2220, pm_top1pct=0.3079, pool_bedroc=0.3952, pool_mrr=0.0876, pool_top1pct=0.4243 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `lse0.6` +- member normalisation: `z` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are scored independently, each member's scores are + normalised within the target's own candidate list (z-normalised, which preserves score magnitude), and the per-member values are then reduced with `lse0.6` ((1/0.6) log mean exp(0.6 x value), a smooth interpolation between the mean and the max that down-weights dissenting members instead of discarding a fixed number of them) + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- The development proxies differ from the benchmarks in candidate-list + shape: most have one active per list against a benchmark target's many, + and the larger proxy lists are padded with uniformly drawn library + molecules rather than property-matched decoys. Both differences were + measured to change which scoring rule looks best, so the inference + settings above were selected on the proxies matching the benchmarks in + decoy tightness and active count, and the margins behind them are small. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Member reduction lse0.6 over z-normalised per-member scores. Selected on the dev proxies that match the benchmarks in decoy tightness and active count; margins are small. Weights unchanged from the previous package. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..94c02a89d9265ecd0ad7de39b18628af735d1861 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/model_config.json @@ -0,0 +1,255 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..d25cf2629b41ef7bf012251c7c7854f595d00792 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "3dba4324393ef6903a26c4d47db7e8a60045576cd2c83fcf1305666f716fb504" + }, + "method": "dual-unimol-zlse06c4hub10", + "model_config": "model_config.json", + "parameter_count": 954305028, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..91e6412832dda89f61ecebcf9a87492dae6538c9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/nmodel.py @@ -0,0 +1,484 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.pocket_hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected MOLECULE output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + @property + def pocket_hidden_dim(self) -> int: + """Width of the un-projected POCKET output. + + It differs from `hidden_dim` only for `pkt_slots > 1`, where `pool()` + returns early with one `width`-sized vector per slot and never applies + the `cls_mean` concatenation. Sharing a single dimension made + `--pool cls_mean --pkt-slots 4` fail at the first forward pass with + "mat1 and mat2 shapes cannot be multiplied (492x512 and 1024x512)", + because the molecule tower emitted 2*width and the pocket tower width. + + No-op for every configuration trained so far: when `pkt_slots > 1` the + existing members all use `pool="cls"`, for which the two dimensions + already coincide. + """ + if self.config.pkt_slots > 1: + return self.config.width + return self.hidden_dim + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..451f859fe21bd590d2b78ef49461b9446cf7bda6 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/predict.py @@ -0,0 +1,488 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import math +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +_NDTRI_A = [-3.969683028665376e+01, 2.209460984245205e+02, -2.759285104469687e+02, + 1.383577518672690e+02, -3.066479806614716e+01, 2.506628277459239e+00] +_NDTRI_B = [-5.447609879822406e+01, 1.615858368580409e+02, -1.556989798598866e+02, + 6.680131188771972e+01, -1.328068155288572e+01] +_NDTRI_C = [-7.784894002430293e-03, -3.223964580411365e-01, -2.400758277161838e+00, + -2.549732539343734e+00, 4.374664141464968e+00, 2.938163982698783e+00] +_NDTRI_D = [7.784695709041462e-03, 3.224671290700398e-01, 2.445134137142996e+00, + 3.754408661907416e+00] + + +def _ndtri(p: np.ndarray) -> np.ndarray: + """Standard normal quantile (Acklam's approximation + one Halley step). + + Inlined rather than imported: the package ships a fixed set of files and + may depend only on numpy, torch and lmdb, so scipy is unavailable. Kept + numerically identical to `research/src/ndtri_np.py`, which is tested + against it. + """ + p = np.asarray(p, dtype=np.float64) + x = np.empty_like(p) + lo, hi = p < 0.02425, p > 1.0 - 0.02425 + if lo.any(): + q = np.sqrt(-2.0 * np.log(p[lo])) + x[lo] = ((((((_NDTRI_C[0] * q + _NDTRI_C[1]) * q + _NDTRI_C[2]) * q + + _NDTRI_C[3]) * q + _NDTRI_C[4]) * q + _NDTRI_C[5]) + / ((((_NDTRI_D[0] * q + _NDTRI_D[1]) * q + _NDTRI_D[2]) * q + + _NDTRI_D[3]) * q + 1.0)) + if hi.any(): + q = np.sqrt(-2.0 * np.log1p(-p[hi])) + x[hi] = -((((((_NDTRI_C[0] * q + _NDTRI_C[1]) * q + _NDTRI_C[2]) * q + + _NDTRI_C[3]) * q + _NDTRI_C[4]) * q + _NDTRI_C[5]) + / ((((_NDTRI_D[0] * q + _NDTRI_D[1]) * q + _NDTRI_D[2]) * q + + _NDTRI_D[3]) * q + 1.0)) + mid = ~(lo | hi) + if mid.any(): + q = p[mid] - 0.5 + r = q * q + x[mid] = ((((((_NDTRI_A[0] * r + _NDTRI_A[1]) * r + _NDTRI_A[2]) * r + + _NDTRI_A[3]) * r + _NDTRI_A[4]) * r + _NDTRI_A[5]) * q + / (((((_NDTRI_B[0] * r + _NDTRI_B[1]) * r + _NDTRI_B[2]) * r + + _NDTRI_B[3]) * r + _NDTRI_B[4]) * r + 1.0)) + erfc = np.vectorize(math.erfc, otypes=[np.float64]) + e = 0.5 * erfc(-x / np.sqrt(2.0)) - p + u = e * np.sqrt(2.0 * np.pi) * np.exp(x * x / 2.0) + return x - u / (1.0 + x * u / 2.0) + + +_VDW_CACHE: dict[int, np.ndarray] = {} + + +def _vdw_scores(n: int) -> np.ndarray: + """van der Waerden scores for a list of length `n`, cached by length. + + Target candidate lists differ in length, so this cannot be a single + precomputed table; it is cached because a benchmark presents many + targets and most share a length. + """ + out = _VDW_CACHE.get(n) + if out is None: + out = _ndtri((np.arange(n, dtype=np.float64) + 0.5) / n) + _VDW_CACHE[n] = out + return out + + +def normalise_member(x: np.ndarray, how: str) -> np.ndarray: + """Put one member's scores for THIS target on a common scale. + + Normalisation is per target candidate list, which is the only population + available at inference and the one the dev measurement was matched to. + + `rank` is invariant to any monotone rescaling, which is maximally safe + across members of differing width -- but it discards magnitude, so a + member that is screamingly confident about a ligand and one that barely + prefers it cast identical votes. `z` keeps that magnitude and measured + +0.0062 [+0.0048,+0.0076] on the DUD-E-shaped dev proxy scored the way + this function scores (normalise within the candidate list, then combine). + `mad` is the robust variant and measured slightly behind `z`. + """ + if how == "rank": + return x.argsort().argsort().astype(np.float64) / max(1, len(x) - 1) + if how == "normal": + # van der Waerden: rank, then map rank -> standard normal quantile. + # Invariant to each member's scale like `rank`, but restores a + # bell-shaped spread so the top of the list is not compressed. Every + # member is forced to the SAME distribution, which is what makes a + # max-like reduction comparable across members: under `z` a member + # with a wider raw spread dominates the maximum for no good reason. + return _vdw_scores(len(x))[x.argsort().argsort()] + if how == "z": + return (x - x.mean()) / (x.std() + 1e-12) + if how == "mad": + med = np.median(x) + mad = np.median(np.abs(x - med)) + return 0.6745 * (x - med) / (mad + 1e-12) + raise ValueError(f"unknown member normalisation {how!r}") + + +def combine_members(per_model: list, mode: str, + normalise: str = "rank") -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([normalise_member(p, normalise) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + if mode.startswith("lse"): + # (1/b) log mean exp(b s): the smooth interpolation between the mean + # (b -> 0) and the max (b -> inf). `topK` samples that same + # "discount the dissenters" axis, but only at integers and with a + # hard cutoff; the smooth form weights every member by how high it + # scored instead of keeping k and discarding the rest. + # + # Shifted by the per-ligand max before exponentiating, so the + # exponent is never positive and this cannot overflow for any b. + b = float(mode[len("lse"):]) + if not b > 0: + raise ValueError(f"member combine {mode!r} needs a positive beta") + m = stack.max(axis=0) + return m + np.log(np.exp(b * (stack - m)).mean(axis=0)) / b + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-normalise", choices=("rank", "z", "mad"), + help="per-member score normalisation within a " + "target's candidate list") + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + # Default "rank" keeps older packages, which carry no member_normalise + # key, scoring exactly as they did before this setting existed. + member_normalise = (args.member_normalise + or settings.get("member_normalise", "rank")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine, + member_normalise) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..db3e5d7f4a89ce508001844283b85a98a112eb97 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S021/training_summary.json @@ -0,0 +1,1099 @@ +{ + "background_rows": 2048, + "ensemble_size": 10, + "inference": { + "background_mode": "mean", + "background_weight": 0.5, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "member_combine": "lse0.6", + "member_normalise": "z", + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm256_ep6.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm256_ep6.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.18135241294207832, + "dl_pool_bedroc": 0.2837347500594526, + "dl_queries": 5559, + "mpm_bedroc": 0.26044486582935344, + "mpm_targets": 202, + "multi_bedroc_max": 0.31441598547439653, + "multi_bedroc_znorm": 0.3120025801452303, + "multi_targets": 202, + "ndl_pm_bedroc": 0.1592227672369005, + "ndl_pool_bedroc": 0.26434652384193025, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24776520920496842, + "novel_pool_bedroc": 0.346050838337958, + "novel_queries": 8926, + "pm_bedroc": 0.30882754918366695, + "pm_mrr": 0.22204750940452253, + "pm_top1pct": 0.30791666666666667, + "pool_bedroc": 0.39521698966643853, + "pool_mrr": 0.08761897391052133, + "pool_top1pct": 0.42425, + "queries": 12000 + }, + "epoch": 6, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "33", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm256_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-zlse06c4hub10", + "molecule_init_official": true, + "notes": "Member reduction lse0.6 over z-normalised per-member scores. Selected on the dev proxies that match the benchmarks in decoy tightness and active count; margins are small. Weights unchanged from the previous package.", + "parameter_count": 954305028, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554, + 95954842 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554, + 95954842 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a6e7029b80fdf30c6ffcc967559697d5b033b38b --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/README.md @@ -0,0 +1,103 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-ztop9c4hub10`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **954305028** +- ensemble members: 10 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554, 95954842 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 +- epoch 6: dl_pm_bedroc=0.1814, dl_pool_bedroc=0.2837, mpm_bedroc=0.2604, multi_bedroc_max=0.3144, multi_bedroc_znorm=0.3120, ndl_pm_bedroc=0.1592, ndl_pool_bedroc=0.2643, novel_pm_bedroc=0.2478, novel_pool_bedroc=0.3461, pm_bedroc=0.3088, pm_mrr=0.2220, pm_top1pct=0.3079, pool_bedroc=0.3952, pool_mrr=0.0876, pool_top1pct=0.4243 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `top9` +- member normalisation: `z` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are scored independently, each member's scores are + normalised within the target's own candidate list (z-normalised, which preserves score magnitude), and the per-member values are then reduced with `top9` (the mean of the 9 highest member values per ligand, discarding the rest) + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- The development proxies differ from the benchmarks in candidate-list + shape: most have one active per list against a benchmark target's many, + and the larger proxy lists are padded with uniformly drawn library + molecules rather than property-matched decoys. Both differences were + measured to change which scoring rule looks best, so the inference + settings above were selected on the proxies matching the benchmarks in + decoy tightness and active count, and the margins behind them are small. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Member reduction lse0.6 -> top9 (mean of the 9 highest member values per ligand, discarding only the single worst). Selected on dev proxies matched to the benchmarks in decoy tightness and active count; +0.004 to +0.007 there across three construction settings, both halves positive. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..94c02a89d9265ecd0ad7de39b18628af735d1861 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/model_config.json @@ -0,0 +1,255 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..e5d6a424e5353ee7d97905e9e59ed25d99071393 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "8f45ea100f7e40f71aba616b1f13f6b46622f17222849254d910cf86282bc558" + }, + "method": "dual-unimol-ztop9c4hub10", + "model_config": "model_config.json", + "parameter_count": 954305028, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..91e6412832dda89f61ecebcf9a87492dae6538c9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/nmodel.py @@ -0,0 +1,484 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.pocket_hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected MOLECULE output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + @property + def pocket_hidden_dim(self) -> int: + """Width of the un-projected POCKET output. + + It differs from `hidden_dim` only for `pkt_slots > 1`, where `pool()` + returns early with one `width`-sized vector per slot and never applies + the `cls_mean` concatenation. Sharing a single dimension made + `--pool cls_mean --pkt-slots 4` fail at the first forward pass with + "mat1 and mat2 shapes cannot be multiplied (492x512 and 1024x512)", + because the molecule tower emitted 2*width and the pocket tower width. + + No-op for every configuration trained so far: when `pkt_slots > 1` the + existing members all use `pool="cls"`, for which the two dimensions + already coincide. + """ + if self.config.pkt_slots > 1: + return self.config.width + return self.hidden_dim + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..451f859fe21bd590d2b78ef49461b9446cf7bda6 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/predict.py @@ -0,0 +1,488 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import math +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +_NDTRI_A = [-3.969683028665376e+01, 2.209460984245205e+02, -2.759285104469687e+02, + 1.383577518672690e+02, -3.066479806614716e+01, 2.506628277459239e+00] +_NDTRI_B = [-5.447609879822406e+01, 1.615858368580409e+02, -1.556989798598866e+02, + 6.680131188771972e+01, -1.328068155288572e+01] +_NDTRI_C = [-7.784894002430293e-03, -3.223964580411365e-01, -2.400758277161838e+00, + -2.549732539343734e+00, 4.374664141464968e+00, 2.938163982698783e+00] +_NDTRI_D = [7.784695709041462e-03, 3.224671290700398e-01, 2.445134137142996e+00, + 3.754408661907416e+00] + + +def _ndtri(p: np.ndarray) -> np.ndarray: + """Standard normal quantile (Acklam's approximation + one Halley step). + + Inlined rather than imported: the package ships a fixed set of files and + may depend only on numpy, torch and lmdb, so scipy is unavailable. Kept + numerically identical to `research/src/ndtri_np.py`, which is tested + against it. + """ + p = np.asarray(p, dtype=np.float64) + x = np.empty_like(p) + lo, hi = p < 0.02425, p > 1.0 - 0.02425 + if lo.any(): + q = np.sqrt(-2.0 * np.log(p[lo])) + x[lo] = ((((((_NDTRI_C[0] * q + _NDTRI_C[1]) * q + _NDTRI_C[2]) * q + + _NDTRI_C[3]) * q + _NDTRI_C[4]) * q + _NDTRI_C[5]) + / ((((_NDTRI_D[0] * q + _NDTRI_D[1]) * q + _NDTRI_D[2]) * q + + _NDTRI_D[3]) * q + 1.0)) + if hi.any(): + q = np.sqrt(-2.0 * np.log1p(-p[hi])) + x[hi] = -((((((_NDTRI_C[0] * q + _NDTRI_C[1]) * q + _NDTRI_C[2]) * q + + _NDTRI_C[3]) * q + _NDTRI_C[4]) * q + _NDTRI_C[5]) + / ((((_NDTRI_D[0] * q + _NDTRI_D[1]) * q + _NDTRI_D[2]) * q + + _NDTRI_D[3]) * q + 1.0)) + mid = ~(lo | hi) + if mid.any(): + q = p[mid] - 0.5 + r = q * q + x[mid] = ((((((_NDTRI_A[0] * r + _NDTRI_A[1]) * r + _NDTRI_A[2]) * r + + _NDTRI_A[3]) * r + _NDTRI_A[4]) * r + _NDTRI_A[5]) * q + / (((((_NDTRI_B[0] * r + _NDTRI_B[1]) * r + _NDTRI_B[2]) * r + + _NDTRI_B[3]) * r + _NDTRI_B[4]) * r + 1.0)) + erfc = np.vectorize(math.erfc, otypes=[np.float64]) + e = 0.5 * erfc(-x / np.sqrt(2.0)) - p + u = e * np.sqrt(2.0 * np.pi) * np.exp(x * x / 2.0) + return x - u / (1.0 + x * u / 2.0) + + +_VDW_CACHE: dict[int, np.ndarray] = {} + + +def _vdw_scores(n: int) -> np.ndarray: + """van der Waerden scores for a list of length `n`, cached by length. + + Target candidate lists differ in length, so this cannot be a single + precomputed table; it is cached because a benchmark presents many + targets and most share a length. + """ + out = _VDW_CACHE.get(n) + if out is None: + out = _ndtri((np.arange(n, dtype=np.float64) + 0.5) / n) + _VDW_CACHE[n] = out + return out + + +def normalise_member(x: np.ndarray, how: str) -> np.ndarray: + """Put one member's scores for THIS target on a common scale. + + Normalisation is per target candidate list, which is the only population + available at inference and the one the dev measurement was matched to. + + `rank` is invariant to any monotone rescaling, which is maximally safe + across members of differing width -- but it discards magnitude, so a + member that is screamingly confident about a ligand and one that barely + prefers it cast identical votes. `z` keeps that magnitude and measured + +0.0062 [+0.0048,+0.0076] on the DUD-E-shaped dev proxy scored the way + this function scores (normalise within the candidate list, then combine). + `mad` is the robust variant and measured slightly behind `z`. + """ + if how == "rank": + return x.argsort().argsort().astype(np.float64) / max(1, len(x) - 1) + if how == "normal": + # van der Waerden: rank, then map rank -> standard normal quantile. + # Invariant to each member's scale like `rank`, but restores a + # bell-shaped spread so the top of the list is not compressed. Every + # member is forced to the SAME distribution, which is what makes a + # max-like reduction comparable across members: under `z` a member + # with a wider raw spread dominates the maximum for no good reason. + return _vdw_scores(len(x))[x.argsort().argsort()] + if how == "z": + return (x - x.mean()) / (x.std() + 1e-12) + if how == "mad": + med = np.median(x) + mad = np.median(np.abs(x - med)) + return 0.6745 * (x - med) / (mad + 1e-12) + raise ValueError(f"unknown member normalisation {how!r}") + + +def combine_members(per_model: list, mode: str, + normalise: str = "rank") -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([normalise_member(p, normalise) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + if mode.startswith("lse"): + # (1/b) log mean exp(b s): the smooth interpolation between the mean + # (b -> 0) and the max (b -> inf). `topK` samples that same + # "discount the dissenters" axis, but only at integers and with a + # hard cutoff; the smooth form weights every member by how high it + # scored instead of keeping k and discarding the rest. + # + # Shifted by the per-ligand max before exponentiating, so the + # exponent is never positive and this cannot overflow for any b. + b = float(mode[len("lse"):]) + if not b > 0: + raise ValueError(f"member combine {mode!r} needs a positive beta") + m = stack.max(axis=0) + return m + np.log(np.exp(b * (stack - m)).mean(axis=0)) / b + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-normalise", choices=("rank", "z", "mad"), + help="per-member score normalisation within a " + "target's candidate list") + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + # Default "rank" keeps older packages, which carry no member_normalise + # key, scoring exactly as they did before this setting existed. + member_normalise = (args.member_normalise + or settings.get("member_normalise", "rank")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine, + member_normalise) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..93719701d2789bf6f10ced562fe0ec2c886ee79b --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S022/training_summary.json @@ -0,0 +1,1099 @@ +{ + "background_rows": 2048, + "ensemble_size": 10, + "inference": { + "background_mode": "mean", + "background_weight": 0.5, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "member_combine": "top9", + "member_normalise": "z", + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm256_ep6.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm256_ep6.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.18135241294207832, + "dl_pool_bedroc": 0.2837347500594526, + "dl_queries": 5559, + "mpm_bedroc": 0.26044486582935344, + "mpm_targets": 202, + "multi_bedroc_max": 0.31441598547439653, + "multi_bedroc_znorm": 0.3120025801452303, + "multi_targets": 202, + "ndl_pm_bedroc": 0.1592227672369005, + "ndl_pool_bedroc": 0.26434652384193025, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24776520920496842, + "novel_pool_bedroc": 0.346050838337958, + "novel_queries": 8926, + "pm_bedroc": 0.30882754918366695, + "pm_mrr": 0.22204750940452253, + "pm_top1pct": 0.30791666666666667, + "pool_bedroc": 0.39521698966643853, + "pool_mrr": 0.08761897391052133, + "pool_top1pct": 0.42425, + "queries": 12000 + }, + "epoch": 6, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "33", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm256_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-ztop9c4hub10", + "molecule_init_official": true, + "notes": "Member reduction lse0.6 -> top9 (mean of the 9 highest member values per ligand, discarding only the single worst). Selected on dev proxies matched to the benchmarks in decoy tightness and active count; +0.004 to +0.007 there across three construction settings, both halves positive.", + "parameter_count": 954305028, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554, + 95954842 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554, + 95954842 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d28cb05024a45f13ad54af9a2b8795a9e2a82d8f --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/README.md @@ -0,0 +1,104 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-ztop10c4hub11`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **1050259870** +- ensemble members: 11 (differing architectures of 95299226, 95300762, 95299226, 95299226, 95299226, 95299226, 95299226, 95823514, 95430554, 95954842, 95954842 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1680, dl_pool_bedroc=0.2651, multi_bedroc_max=0.3042, multi_bedroc_znorm=0.2801, ndl_pm_bedroc=0.1467, ndl_pool_bedroc=0.2462, novel_pm_bedroc=0.2394, novel_pool_bedroc=0.3281, pm_bedroc=0.2953, pm_mrr=0.2142, pm_top1pct=0.2941, pool_bedroc=0.3754, pool_mrr=0.0922, pool_top1pct=0.3989 +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 5: dl_pm_bedroc=0.1567, dl_pool_bedroc=0.2565, multi_bedroc_max=0.2833, multi_bedroc_znorm=0.2651, ndl_pm_bedroc=0.1320, ndl_pool_bedroc=0.2357, novel_pm_bedroc=0.2473, novel_pool_bedroc=0.3391, pm_bedroc=0.3076, pm_mrr=0.2288, pm_top1pct=0.3083, pool_bedroc=0.3877, pool_mrr=0.1019, pool_top1pct=0.4115 +- epoch 10: dl_pm_bedroc=0.1614, dl_pool_bedroc=0.2504, mpm_bedroc=0.2558, multi_bedroc_max=0.2992, multi_bedroc_znorm=0.2921, ndl_pm_bedroc=0.1398, ndl_pool_bedroc=0.2306, novel_pm_bedroc=0.2178, novel_pool_bedroc=0.3107, pm_bedroc=0.2758, pm_mrr=0.1917, pm_top1pct=0.2786, pool_bedroc=0.3589, pool_mrr=0.0872, pool_top1pct=0.3824 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 10: dl_pm_bedroc=0.1710, dl_pool_bedroc=0.2607, mpm_bedroc=0.2359, multi_bedroc_max=0.2840, multi_bedroc_znorm=0.2797, ndl_pm_bedroc=0.1498, ndl_pool_bedroc=0.2412, novel_pm_bedroc=0.2463, novel_pool_bedroc=0.3327, pm_bedroc=0.3006, pm_mrr=0.2165, pm_top1pct=0.3034, pool_bedroc=0.3797, pool_mrr=0.0901, pool_top1pct=0.4056 +- epoch 6: dl_pm_bedroc=0.1814, dl_pool_bedroc=0.2837, mpm_bedroc=0.2604, multi_bedroc_max=0.3144, multi_bedroc_znorm=0.3120, ndl_pm_bedroc=0.1592, ndl_pool_bedroc=0.2643, novel_pm_bedroc=0.2478, novel_pool_bedroc=0.3461, pm_bedroc=0.3088, pm_mrr=0.2220, pm_top1pct=0.3079, pool_bedroc=0.3952, pool_mrr=0.0876, pool_top1pct=0.4243 +- epoch 10: dl_pm_bedroc=0.1777, dl_pool_bedroc=0.2794, mpm_bedroc=0.2793, multi_bedroc_max=0.3325, multi_bedroc_znorm=0.3140, ndl_pm_bedroc=0.1528, ndl_pool_bedroc=0.2581, novel_pm_bedroc=0.2598, novel_pool_bedroc=0.3464, pm_bedroc=0.3193, pm_mrr=0.2343, pm_top1pct=0.3215, pool_bedroc=0.3961, pool_mrr=0.0945, pool_top1pct=0.4224 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `top10` +- member normalisation: `z` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are scored independently, each member's scores are + normalised within the target's own candidate list (z-normalised, which preserves score magnitude), and the per-member values are then reduced with `top10` (the mean of the 10 highest member values per ligand, discarding the rest) + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- The development proxies differ from the benchmarks in candidate-list + shape: most have one active per list against a benchmark target's many, + and the larger proxy lists are padded with uniformly drawn library + molecules rather than property-matched decoys. Both differences were + measured to change which scoring rule looks best, so the inference + settings above were selected on the proxies matching the benchmarks in + decoy tightness and active count, and the margins behind them are small. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Eleventh member dlxcm256aug (cls_mean + embedding-dim 256 + noise augmentation), and reduction top9 -> top10, which keeps the rule 'discard the single worst member per ligand' at the new ensemble size. Selected on dev proxies matched to the benchmarks in decoy tightness and active count. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/model_config.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/model_config.json new file mode 100644 index 0000000000000000000000000000000000000000..922a3414ca7747793d2602f4d36646fa435d72be --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/model_config.json @@ -0,0 +1,280 @@ +{ + "members": [ + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 4, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 24.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 128, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + }, + { + "basis": 128, + "dropout": 0.1, + "embedding_dim": 256, + "ffn": 2048, + "grad_ckpt": true, + "learn_scale": false, + "logit_scale": 14.0, + "mol_attn_dropout": 0.0, + "mol_heads": 64, + "mol_layers": 15, + "mol_vocab": 31, + "pkt_attn_dropout": 0.0, + "pkt_dropout": 0.1, + "pkt_grad_ckpt": false, + "pkt_heads": 16, + "pkt_layers": 15, + "pkt_slots": 1, + "pkt_vocab": 10, + "pool": "cls_mean", + "proj_hidden": 512, + "proj_layers": 2, + "slots": 1, + "width": 512 + } + ], + "schema": "screen-model-config/v2" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..acf27a430380a6fd0f15f99cce732f9a381a9f7c --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "0e136f14ef920cf8f0cef384c17b7176d18fa7f4733ec9f90b5c476fbcd018c5" + }, + "method": "dual-unimol-ztop10c4hub11", + "model_config": "model_config.json", + "parameter_count": 1050259870, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/nmodel.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/nmodel.py new file mode 100644 index 0000000000000000000000000000000000000000..91e6412832dda89f61ecebcf9a87492dae6538c9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/nmodel.py @@ -0,0 +1,484 @@ +"""Efficient Uni-Mol towers + dual-encoder screening model. + +Parameter names of :class:`UniMolEncoder` match the official Uni-Mol v0.1 +molecule checkpoint so that it can be loaded directly. Distances and edge +types are derived on the accelerator from tokens and coordinates, which keeps +the host pipeline free of O(L^2) tensors. +""" +from __future__ import annotations + +from dataclasses import asdict, dataclass +import math + +import torch +from torch import nn +import torch.nn.functional as F +from torch.utils.checkpoint import checkpoint + +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +class GaussianLayer(nn.Module): + def __init__(self, vocab_size: int, basis: int = 128) -> None: + super().__init__() + self.basis = basis + self.means = nn.Embedding(1, basis) + self.stds = nn.Embedding(1, basis) + self.mul = nn.Embedding(vocab_size * vocab_size, 1) + self.bias = nn.Embedding(vocab_size * vocab_size, 1) + nn.init.uniform_(self.means.weight, 0, 3) + nn.init.uniform_(self.stds.weight, 0, 3) + nn.init.ones_(self.mul.weight) + nn.init.zeros_(self.bias.weight) + + def forward(self, distance: torch.Tensor, edge_type: torch.Tensor) -> torch.Tensor: + mul = self.mul(edge_type).squeeze(-1) + bias = self.bias(edge_type).squeeze(-1) + value = (mul * distance + bias).unsqueeze(-1) + mean = self.means.weight.float().view(-1) + std = self.stds.weight.float().view(-1).abs() + 1e-5 + normalized = (value.float() - mean) / std + return torch.exp(-0.5 * normalized.square()) / (math.sqrt(2 * math.pi) * std) + + +class NonLinearHead(nn.Module): + def __init__(self, inp: int, hidden: int, out: int) -> None: + super().__init__() + self.linear1 = nn.Linear(inp, hidden) + self.linear2 = nn.Linear(hidden, out) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return self.linear2(F.gelu(self.linear1(value))) + + +class SelfAttention(nn.Module): + def __init__(self, width: int, heads: int) -> None: + super().__init__() + self.heads = heads + self.head_dim = width // heads + self.in_proj = nn.Linear(width, width * 3) + self.out_proj = nn.Linear(width, width) + + def forward(self, value, bias, attention_dropout: float, training: bool): + b, l, w = value.shape + q, k, v = self.in_proj(value).chunk(3, dim=-1) + q = q.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) * (self.head_dim ** -0.5) + k = k.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + v = v.reshape(b, l, self.heads, self.head_dim).transpose(1, 2) + logits = torch.baddbmm( + bias.reshape(b * self.heads, l, l), + q.reshape(b * self.heads, l, self.head_dim), + k.reshape(b * self.heads, l, self.head_dim).transpose(-1, -2), + ).view(b, self.heads, l, l) + probs = F.softmax(logits.float(), dim=-1).type_as(value) + if attention_dropout and training: + probs = F.dropout(probs, p=attention_dropout, training=True) + attended = torch.matmul(probs, v).transpose(1, 2).reshape(b, l, w) + return self.out_proj(attended), logits + + +class EncoderLayer(nn.Module): + def __init__(self, width: int, heads: int, ffn: int, dropout: float, + attention_dropout: float) -> None: + super().__init__() + self.self_attn = SelfAttention(width, heads) + self.self_attn_layer_norm = nn.LayerNorm(width) + self.fc1 = nn.Linear(width, ffn) + self.fc2 = nn.Linear(ffn, width) + self.final_layer_norm = nn.LayerNorm(width) + self.dropout = dropout + self.attention_dropout = attention_dropout + + def forward(self, value, bias): + attention, bias = self.self_attn(self.self_attn_layer_norm(value), bias, + self.attention_dropout, self.training) + value = value + F.dropout(attention, p=self.dropout, training=self.training) + hidden = F.gelu(self.fc1(self.final_layer_norm(value))) + value = value + F.dropout(self.fc2(hidden), p=self.dropout, training=self.training) + return value, bias + + +class Encoder(nn.Module): + def __init__(self, width, heads, ffn, layers, dropout, attention_dropout, + grad_ckpt: bool) -> None: + super().__init__() + self.emb_layer_norm = nn.LayerNorm(width) + self.final_layer_norm = nn.LayerNorm(width) + self.layers = nn.ModuleList([ + EncoderLayer(width, heads, ffn, dropout, attention_dropout) + for _ in range(layers) + ]) + self.dropout = dropout + self.grad_ckpt = grad_ckpt + + def forward(self, value, bias, padding_mask): + value = F.dropout(self.emb_layer_norm(value), p=self.dropout, training=self.training) + value = value.masked_fill(padding_mask.unsqueeze(-1), 0) + bias = bias.masked_fill(padding_mask[:, None, None, :], float("-inf")) + for layer in self.layers: + if self.grad_ckpt and self.training: + value, bias = checkpoint(layer, value, bias, use_reentrant=False) + else: + value, bias = layer(value, bias) + return self.final_layer_norm(value) + + +class UniMolEncoder(nn.Module): + """Uni-Mol v1 encoder; ``forward`` takes tokens + coordinates.""" + + def __init__(self, vocab_size: int, width: int = 512, heads: int = 64, + ffn: int = 2048, layers: int = 15, basis: int = 128, + dropout: float = 0.1, attention_dropout: float | None = None, + grad_ckpt: bool = True) -> None: + super().__init__() + self.vocab_size = vocab_size + self.width = width + self.heads = heads + self.embed_tokens = nn.Embedding(vocab_size, width, padding_idx=PAD) + self.encoder = Encoder(width, heads, ffn, layers, dropout, + dropout if attention_dropout is None else attention_dropout, + grad_ckpt) + self.gbf_proj = NonLinearHead(basis, basis, heads) + self.gbf = GaussianLayer(vocab_size, basis) + self.grad_ckpt = grad_ckpt + self.pair_chunk = 8 + self.apply(self._init_bert_params) + + @staticmethod + def _init_bert_params(module: nn.Module) -> None: + if isinstance(module, (nn.Linear, nn.Embedding)): + nn.init.normal_(module.weight, mean=0.0, std=0.02) + if isinstance(module, nn.Linear) and module.bias is not None: + nn.init.zeros_(module.bias) + if isinstance(module, nn.Embedding) and module.padding_idx is not None: + with torch.no_grad(): + module.weight[module.padding_idx].zero_() + + def _pair_chunk(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + delta = coords.unsqueeze(-2) - coords.unsqueeze(-3) + distance = delta.square().sum(-1).clamp_min(1e-12).sqrt() + edge = tokens.unsqueeze(-1) * self.vocab_size + tokens.unsqueeze(-2) + return self.gbf_proj(self.gbf(distance, edge)) + + def _pair(self, tokens: torch.Tensor, coords: torch.Tensor) -> torch.Tensor: + # The radial-basis tensor is rows x L^2 x basis, so the row count that + # fits a fixed byte budget depends on the padded length of this batch. + length = tokens.shape[1] + budget = getattr(self, "pair_bytes", 1 << 30) + size = max(1, budget // max(1, length * length * self.gbf.basis * 4)) + size = min(size, max(1, self.pair_chunk)) if self.training else size + if tokens.shape[0] <= size: + return self._pair_chunk(tokens, coords) + return torch.cat([self._pair_chunk(tokens[i:i + size], coords[i:i + size]) + for i in range(0, tokens.shape[0], size)], dim=0) + + def forward(self, tokens: torch.Tensor, coords: torch.Tensor, + return_tokens: bool = False) -> torch.Tensor: + if self.grad_ckpt and self.training: + bias = checkpoint(self._pair, tokens, coords, use_reentrant=False) + else: + bias = self._pair(tokens, coords) + bias = bias.permute(0, 3, 1, 2).contiguous() + hidden = self.encoder(self.embed_tokens(tokens), bias, tokens.eq(PAD)) + return hidden if return_tokens else hidden[:, 0] + + def load_official_checkpoint(self, path, expected_sha256: str | None = None) -> dict: + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + actual = hashlib.file_digest(stream, "sha256").hexdigest() + if actual != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + own = self.state_dict() + if set(state) != set(own): + raise ValueError( + f"key mismatch: missing={sorted(set(own) - set(state))[:5]} " + f"unexpected={sorted(set(state) - set(own))[:5]}") + self.load_state_dict(state, strict=True) + return {"loaded_tensors": len(state), + "loaded_parameters": int(sum(v.numel() for v in state.values()))} + + def load_remapped_checkpoint(self, path, expected_sha256: str | None = None, + src_heads: int = 64) -> dict: + """Initialise a smaller-dictionary tower from the molecule checkpoint.""" + import hashlib + from pathlib import Path + path = Path(path) + if expected_sha256 is not None: + with path.open("rb") as stream: + if hashlib.file_digest(stream, "sha256").hexdigest() != expected_sha256: + raise ValueError("Uni-Mol molecule checkpoint SHA256 mismatch") + raw = torch.load(path, map_location="cpu", weights_only=False) + excluded = ("lm_head.", "dist_head.", "pair2coord_proj.", + "encoder.final_head_layer_norm.") + state = {k: v for k, v in raw["model"].items() if not k.startswith(excluded)} + state = remap_unimol_state(state, src_heads=src_heads, + dst_heads=self.heads) + own = self.state_dict() + if set(state) != set(own): + raise ValueError("remapped key mismatch") + for key, value in state.items(): + if value.shape != own[key].shape: + raise ValueError(f"remapped shape mismatch for {key}") + self.load_state_dict(state, strict=True) + return {"remapped_tensors": len(state), + "remapped_parameters": int(sum(v.numel() for v in state.values()))} + + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") + + +def remap_unimol_state(state: dict, src_vocab=MOL_VOCAB, dst_vocab=PKT_VOCAB, + src_heads: int = 64, dst_heads: int = 64) -> dict: + """Project a Uni-Mol state dict onto a smaller element dictionary. + + Every token of the pocket dictionary also exists in the molecule + dictionary, so the token embedding table and the per-edge-type Gaussian + parameters can be copied exactly; the rest of the tower is dictionary + independent. This lets the supplied generic molecule checkpoint initialise + the pocket tower instead of starting it from random weights. + """ + index = {a: i for i, a in enumerate(src_vocab)} + pick = torch.tensor([index[a] for a in dst_vocab], dtype=torch.long) + ns, nd = len(src_vocab), len(dst_vocab) + edge = (pick[:, None] * ns + pick[None, :]).reshape(-1) + out = {} + for key, value in state.items(): + if key == "embed_tokens.weight": + out[key] = value[pick].clone() + elif key in ("gbf.mul.weight", "gbf.bias.weight"): + if value.shape[0] != ns * ns: + raise ValueError(f"unexpected {key} shape {tuple(value.shape)}") + out[key] = value[edge].clone() + elif key.startswith("gbf_proj.linear2.") and dst_heads != src_heads: + # One pair-bias channel per attention head. A wider head (fewer, + # larger heads) inherits the mean of thesource channels it now covers. + if src_heads % dst_heads: + raise ValueError("head counts must be commensurate") + group = src_heads // dst_heads + out[key] = value.reshape(dst_heads, group, *value.shape[1:]).mean(1).clone() + else: + out[key] = value.clone() + assert out["gbf.mul.weight"].shape[0] == nd * nd + return out + + +class ProjectionHead(nn.Module): + def __init__(self, source: int, target: int, hidden: int | None = None, + layers: int = 2) -> None: + super().__init__() + hidden = source if hidden is None else hidden + mods: list[nn.Module] = [] + dim = source + for _ in range(layers - 1): + mods += [nn.Linear(dim, hidden), nn.ReLU()] + dim = hidden + mods.append(nn.Linear(dim, target)) + self.layers = nn.Sequential(*mods) + + def forward(self, value: torch.Tensor) -> torch.Tensor: + return F.normalize(self.layers(value), dim=-1) + + +class SlotPool(nn.Module): + """Pool token states into `slots` vectors with learned query attention. + + One vector per record forces a pocket to commit to a single description of + what it wants. A pocket is large and only partly occupied by any one + ligand, so several slots let different subsites be matched independently + and the score take the best match per slot (late interaction). + """ + + def __init__(self, width: int, slots: int, init_std: float = 0.002) -> None: + super().__init__() + self.slots = slots + self.query = nn.Parameter(torch.empty(slots, width)) + # Near-zero queries make every slot start as plain mean pooling, which + # is a sane readout of a pretrained tower; a large random init would + # instead start the pocket side at noise and force the projection head + # to relearn from scratch. The small std is only there to break the + # symmetry between slots, which would otherwise receive identical + # gradients forever. + nn.init.normal_(self.query, mean=0.0, std=init_std) + self.scale = width ** -0.5 + + def forward(self, hidden: torch.Tensor, mask: torch.Tensor) -> torch.Tensor: + # hidden (B, L, W); mask (B, L) True where the position is padding. + logits = torch.einsum("blw,kw->bkl", hidden, self.query) * self.scale + logits = logits.masked_fill(mask.unsqueeze(1), float("-inf")) + return torch.einsum("bkl,blw->bkw", logits.softmax(dim=-1), hidden) + + +def similarity(pocket: torch.Tensor, molecule: torch.Tensor) -> torch.Tensor: + """Pocket-by-molecule score matrix for single- or multi-slot embeddings. + + Three cases, all reducing to one matmul: + + * both single-vector: the usual cosine product; + * multi-slot pocket against single-vector molecules: the score is the + **max** over pocket slots, i.e. "the ligand fits at least one subsite". + Averaging instead would be a no-op — the mean of the slot scores is the + score of the mean slot — so max is what makes the extra slots useful; + * both multi-slot: mean over pocket slots of the best-matching molecule + slot, the usual late-interaction form. + """ + if pocket.dim() == 2: + return pocket @ molecule.transpose(-1, -2) + p, k, d = pocket.shape + if molecule.dim() == 2: + flat = pocket.reshape(p * k, d) @ molecule.transpose(-1, -2) + return flat.view(p, k, -1).amax(dim=1) + m, j, _ = molecule.shape + flat = pocket.reshape(p * k, d) @ molecule.reshape(m * j, d).T + return flat.view(p, k, m, j).amax(dim=3).mean(dim=1) + + +@dataclass(frozen=True) +class ScreenConfig: + mol_vocab: int = 31 + pkt_vocab: int = 10 + mol_layers: int = 15 + pkt_layers: int = 15 + width: int = 512 + ffn: int = 2048 + mol_heads: int = 64 + pkt_heads: int = 64 + basis: int = 128 + embedding_dim: int = 128 + proj_layers: int = 2 + proj_hidden: int = 512 + dropout: float = 0.1 + pkt_dropout: float = 0.1 + mol_attn_dropout: float = 0.0 + pkt_attn_dropout: float = 0.0 + logit_scale: float = 14.0 + learn_scale: bool = False + grad_ckpt: bool = True + pkt_grad_ckpt: bool = False + pool: str = "cls" # "cls", "cls_mean" or "slots" + slots: int = 1 # >1 enables multi-vector (late-interaction) scoring + # Asymmetric variant: several vectors for the pocket, one for the + # molecule. A molecule is small and has one identity, while a pocket is + # large, only partly occupied by any one ligand, and its score is the best + # match over its subsites. It is also the affordable half: K pocket slots + # cost K x the score matrix, whereas K molecule slots would also multiply + # the 72k-row negative bank and the 4.2M-ligand inference index. + pkt_slots: int = 1 + + def to_dict(self) -> dict: + return asdict(self) + + +class ScreenModel(nn.Module): + def __init__(self, config: ScreenConfig) -> None: + super().__init__() + self.config = config + self.molecule_encoder = UniMolEncoder( + config.mol_vocab, config.width, config.mol_heads, config.ffn, + config.mol_layers, config.basis, config.dropout, + config.mol_attn_dropout, grad_ckpt=config.grad_ckpt) + self.pocket_encoder = UniMolEncoder( + config.pkt_vocab, config.width, config.pkt_heads, config.ffn, + config.pkt_layers, config.basis, config.pkt_dropout, + config.pkt_attn_dropout, grad_ckpt=config.pkt_grad_ckpt) + self.molecule_projection = ProjectionHead( + self.hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + self.pocket_projection = ProjectionHead( + self.pocket_hidden_dim, config.embedding_dim, config.proj_hidden, + config.proj_layers) + if config.pool == "slots": + self.slot_pool = nn.ModuleList( + [SlotPool(config.width, config.slots) for _ in range(2)]) + if config.pkt_slots > 1: + self.pocket_slot = SlotPool(config.width, config.pkt_slots - 1) + scale = torch.tensor(math.log(config.logit_scale)) + if config.learn_scale: + self.logit_scale = nn.Parameter(scale) + else: + self.register_buffer("logit_scale", scale) + + @property + def hidden_dim(self) -> int: + """Width of the un-projected MOLECULE output that the head consumes.""" + return self.config.width * (2 if self.config.pool == "cls_mean" else 1) + + @property + def pocket_hidden_dim(self) -> int: + """Width of the un-projected POCKET output. + + It differs from `hidden_dim` only for `pkt_slots > 1`, where `pool()` + returns early with one `width`-sized vector per slot and never applies + the `cls_mean` concatenation. Sharing a single dimension made + `--pool cls_mean --pkt-slots 4` fail at the first forward pass with + "mat1 and mat2 shapes cannot be multiplied (492x512 and 1024x512)", + because the molecule tower emitted 2*width and the pocket tower width. + + No-op for every configuration trained so far: when `pkt_slots > 1` the + existing members all use `pool="cls"`, for which the two dimensions + already coincide. + """ + if self.config.pkt_slots > 1: + return self.config.width + return self.hidden_dim + + def pool(self, encoder, tokens, coords): + """Summarise a tower's token states into one or more vectors. + + `cls_mean` concatenates the `[CLS]` state with the mean over real atom + states; the special tokens carry a zero coordinate and so see only the + radial distance from the centroid, while the atom states carry the + local geometry the screening decision depends on. `pkt_slots > 1` + gives the pocket tower several vectors regardless of `pool`. + """ + if encoder is self.pocket_encoder and self.config.pkt_slots > 1: + # Slot 0 is the pretrained [CLS] readout, so the multi-slot model + # starts from the single-vector model's pocket representation and + # the learned slots are additions to it rather than replacements. + hidden = encoder(tokens, coords, return_tokens=True) + extra = self.pocket_slot(hidden, tokens.eq(PAD)) + return torch.cat([hidden[:, :1], extra], dim=1) + if self.config.pool == "cls": + return encoder(tokens, coords) + hidden = encoder(tokens, coords, return_tokens=True) + if self.config.pool == "cls_mean": + atoms = tokens.gt(UNK).unsqueeze(-1).to(hidden.dtype) + mean = (hidden * atoms).sum(1) / atoms.sum(1).clamp_min(1.0) + return torch.cat([hidden[:, 0], mean], dim=-1) + if self.config.pool == "slots": + slot = self.slot_pool[0 if encoder is self.molecule_encoder else 1] + return slot(hidden, tokens.eq(PAD)) + raise ValueError(f"unknown pool {self.config.pool!r}") + + def set_grad_ckpt(self, flag: bool, pocket: bool | None = None) -> None: + for enc, value in ((self.molecule_encoder, flag), + (self.pocket_encoder, flag if pocket is None else pocket)): + enc.grad_ckpt = value + enc.encoder.grad_ckpt = value + + def pool_molecule(self, tokens, coords): + return self.pool(self.molecule_encoder, tokens, coords) + + def encode_molecule(self, tokens, coords): + return self.molecule_projection(self.pool_molecule(tokens, coords)) + + def encode_pocket(self, tokens, coords): + return self.pocket_projection(self.pool(self.pocket_encoder, tokens, coords)) + + def scale(self) -> torch.Tensor: + return self.logit_scale.clamp(max=math.log(100.0)).exp() + + +def parameter_count(model: nn.Module) -> int: + return int(sum(p.numel() for p in model.parameters())) diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/pkgdata.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/pkgdata.py new file mode 100644 index 0000000000000000000000000000000000000000..f0180cb65ef7b1e05fb2526e1b76b8c153b444fd --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/pkgdata.py @@ -0,0 +1,203 @@ +"""Label-free LMDB readers and Uni-Mol featurisation for inference.""" +from __future__ import annotations + +import pickle +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import Dataset + +MOL_VOCAB = ( + "[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", + "CL", "F", "BR", "I", "SI", "P", "B", "NA", "K", "AL", "CA", + "SN", "AS", "HG", "FE", "ZN", "CR", "SE", "GD", "AU", "LI", "[MASK]", +) +PKT_VOCAB = ("[PAD]", "[CLS]", "[SEP]", "[UNK]", "C", "N", "O", "S", "H", "[MASK]") +MOL_IDX = {a: i for i, a in enumerate(MOL_VOCAB)} +PKT_IDX = {a: i for i, a in enumerate(PKT_VOCAB)} +PAD, CLS, SEP, UNK = 0, 1, 2, 3 + + +def pocket_element(name) -> str: + """Element of a PDB/MOL2 atom name: ``CA`` -> C, ``N.am`` -> N, ``1HB`` -> H.""" + a = str(name).strip().upper() + if not a: + return "" + return a[1] if a[0].isdigit() and len(a) > 1 else a[:1] + + +def _conformers(value) -> np.ndarray: + arr = np.asarray(value, dtype=np.float32) + if arr.ndim == 2: + arr = arr[None] + if arr.ndim != 3 or arr.shape[-1] != 3: + raise ValueError(f"unusable coordinate array of shape {arr.shape}") + return arr + + +def crop_nearest(xyz: np.ndarray, keep: int): + if len(xyz) <= keep: + return None + d = np.linalg.norm(xyz - xyz.mean(axis=0), axis=1) + idx = np.argpartition(d, keep - 1)[:keep] + idx.sort() + return idx + + +def featurize(tokens: np.ndarray, xyz: np.ndarray, max_atoms: int): + idx = crop_nearest(xyz, max_atoms) + if idx is not None: + tokens, xyz = tokens[idx], xyz[idx] + xyz = xyz - xyz.mean(axis=0, keepdims=True) + n = len(tokens) + out_tok = np.empty(n + 2, dtype=np.int64) + out_tok[0] = CLS + out_tok[-1] = SEP + out_tok[1:-1] = tokens + out_xyz = np.zeros((n + 2, 3), dtype=np.float32) + out_xyz[1:-1] = xyz + return out_tok, out_xyz + + +def pad_batch(items): + m = max(len(t) for t, _ in items) + tok = np.zeros((len(items), m), dtype=np.int64) + xyz = np.zeros((len(items), m, 3), dtype=np.float32) + for i, (t, x) in enumerate(items): + tok[i, :len(t)] = t + xyz[i, :len(t)] = x + return torch.from_numpy(tok), torch.from_numpy(xyz) + + +class LMDBReader: + """Contiguous ASCII-integer-keyed LMDB of pickled dictionaries.""" + + def __init__(self, path: Path) -> None: + self.path = Path(path) + self.env = None + import lmdb + env = lmdb.open(str(self.path), subdir=False, readonly=True, lock=False, + readahead=False, meminit=False, max_readers=512) + with env.begin() as t: + self.n = t.stat()["entries"] + env.close() + + def __len__(self) -> int: + return self.n + + def __getitem__(self, i: int) -> dict: + if self.env is None: + import lmdb + self.env = lmdb.open(str(self.path), subdir=False, readonly=True, + lock=False, readahead=False, meminit=False, + max_readers=512) + with self.env.begin(buffers=True) as t: + raw = t.get(str(i).encode("ascii")) + if raw is None: + raise KeyError(f"missing key {i} in {self.path}") + return pickle.loads(bytes(raw)) + + def __getstate__(self): + state = dict(self.__dict__) + state["env"] = None + return state + + +class MoleculeSet(Dataset): + """One item per molecule, emitting every requested conformer in one read.""" + + def __init__(self, path: Path, max_atoms: int, n_conformers: int, + limit: int | None = None) -> None: + self.reader = LMDBReader(path) + self.max_atoms = max_atoms + self.n_conformers = max(1, n_conformers) + self.limit = len(self.reader) if limit is None else min(limit, len(self.reader)) + + def __len__(self) -> int: + return self.limit + + def __getitem__(self, index: int): + index = int(index) + try: + return self._item(index) + except Exception: + # Every ligand must receive a score, so a malformed record falls + # back to a single placeholder atom rather than failing the run. + return [_dummy(self.max_atoms)], index + + def _item(self, index: int): + record = self.reader[index] + atoms = [str(a).strip().upper() for a in record["atoms"]] + keep = [k for k, a in enumerate(atoms) if a != "H"] + if not keep: + keep = list(range(len(atoms))) + if not keep: + return [_dummy(self.max_atoms)], index + tokens = np.fromiter((MOL_IDX.get(atoms[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + try: + xyz = _conformers(record["coordinates"]) + except Exception: + xyz = np.zeros((1, len(atoms), 3), dtype=np.float32) + out = [] + for slot in range(min(self.n_conformers, xyz.shape[0])): + conformer = xyz[slot] + if conformer.shape[0] < len(atoms): + conformer = np.pad(conformer, + ((0, len(atoms) - conformer.shape[0]), (0, 0))) + coords = np.ascontiguousarray(conformer[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + out.append(featurize(tokens, coords, self.max_atoms)) + return out, index + + +def collate_molecules(batch): + items, index = [], [] + for features, i in batch: + items.extend(features) + index.extend([i] * len(features)) + tok, xyz = pad_batch(items) + return {"tok": tok, "xyz": xyz, + "index": torch.tensor(index, dtype=torch.long)} + + +def _dummy(max_atoms: int): + return featurize(np.array([UNK], dtype=np.int64), + np.zeros((1, 3), dtype=np.float32), max_atoms) + + +def read_pockets(path: Path, max_atoms: int): + reader = LMDBReader(path) + items = [] + for i in range(len(reader)): + try: + record = reader[i] + names = list(record["pocket_atoms"]) + except Exception: + items.append(_dummy(max_atoms)) + continue + xyz = np.asarray(record["pocket_coordinates"], dtype=np.float32) + if xyz.ndim == 3: + xyz = xyz[0] + elements = [pocket_element(a) for a in names] + keep = [k for k, e in enumerate(elements) if e != "H"] + if not keep: + keep = list(range(len(elements))) + if not keep or len(xyz) == 0: + items.append(_dummy(max_atoms)) + continue + keep = [k for k in keep if k < len(xyz)] + if not keep: + items.append(_dummy(max_atoms)) + continue + tokens = np.fromiter((PKT_IDX.get(elements[k], UNK) for k in keep), + dtype=np.int64, count=len(keep)) + coords = np.ascontiguousarray(xyz[keep]) + if not np.isfinite(coords).all(): + coords = np.nan_to_num(coords, nan=0.0, posinf=0.0, neginf=0.0) + items.append(featurize(tokens, coords, max_atoms)) + if not items: + raise ValueError(f"empty pocket LMDB: {path}") + return items diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/predict.py b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/predict.py new file mode 100644 index 0000000000000000000000000000000000000000..451f859fe21bd590d2b78ef49461b9446cf7bda6 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/predict.py @@ -0,0 +1,488 @@ +#!/usr/bin/env python3 +"""Score every ligand of every supplied DUD-E / LIT-PCBA target. + +Reads the label-free LMDB view described by the delivery contract and writes +``scores.csv`` with one finite score per (benchmark, target, ligand index). +""" +from __future__ import annotations + +import argparse +import csv +import hashlib +import json +import math +import os +import sys +from pathlib import Path + +import numpy as np +import torch +from torch.utils.data import DataLoader + +HERE = Path(__file__).resolve().parent +sys.path.insert(0, str(HERE)) + +from nmodel import (ScreenConfig, ScreenModel, parameter_count, # noqa: E402 + similarity) +from pkgdata import (LMDBReader, MoleculeSet, collate_molecules, pad_batch, # noqa: E402 + read_pockets) + + +def sha256(path: Path) -> str: + digest = hashlib.sha256() + with Path(path).open("rb") as stream: + for block in iter(lambda: stream.read(8 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def contained(root: Path, relative: str) -> Path: + path = (root / relative).resolve() + if not path.is_relative_to(root.resolve()): + raise ValueError("manifest path escapes the model package") + return path + + +def load_model(package: Path, device: torch.device): + manifest = json.loads((package / "model_manifest.json").read_text()) + checkpoint_path = contained(package, manifest["checkpoint"]["path"]) + if sha256(checkpoint_path) != manifest["checkpoint"]["sha256"]: + raise ValueError("checkpoint checksum mismatch") + blob = torch.load(checkpoint_path, map_location="cpu", weights_only=False) + declared = json.loads(contained(package, manifest["model_config"]).read_text()) + if blob["model_config"] != declared: + raise ValueError("checkpoint and declared model config disagree") + models = [] + states = blob["state_dicts"] if "state_dicts" in blob else [blob["state_dict"]] + # v2 declares one config per member, because members may differ in + # architecture (for example a multi-slot pocket alongside a single-vector + # one). A v1 package declares a single flat config shared by all members. + if isinstance(declared, dict) and "members" in declared: + member_configs = declared["members"] + else: + member_configs = [declared] * len(states) + if len(member_configs) != len(states): + raise ValueError(f"{len(member_configs)} declared configs for " + f"{len(states)} checkpoints") + for config, state in zip(member_configs, states): + model = ScreenModel(ScreenConfig(**config)) + model.load_state_dict(state, strict=True) + model.set_grad_ckpt(False) + models.append(model.to(device).eval()) + settings = dict(blob.get("inference", {})) + background = blob.get("background") + if background is not None: + background = [torch.as_tensor(b, dtype=torch.float32, device=device) + for b in background] + return models, settings, background, manifest + + +def test_targets(root: Path, which: str = "all"): + for benchmark, directory, pocket_name in ( + ("dude", root / "test/dude", "pocket.lmdb"), + ("lit_pcba", root / "test/lit_pcba", "pockets.lmdb"), + ): + if which != "all" and benchmark != which: + continue + if not directory.is_dir(): + raise FileNotFoundError(directory) + for target in sorted(p for p in directory.iterdir() if p.is_dir()): + mols = target / "mols.lmdb" + pockets = target / pocket_name + if not pockets.is_file(): + alternate = target / ("pockets.lmdb" if pocket_name == "pocket.lmdb" + else "pocket.lmdb") + if alternate.is_file(): + pockets = alternate + if not mols.is_file() or not pockets.is_file(): + raise FileNotFoundError(f"missing benchmark LMDB under {target}") + yield benchmark, target.name, mols, pockets + + +@torch.no_grad() +def encode_pockets(models, path: Path, budgets, device, dtype): + """Average each pocket's embedding over several atom budgets (TTA).""" + out = [None] * len(models) + for budget in budgets: + items = read_pockets(path, budget) + for k, model in enumerate(models): + chunks = [] + for start in range(0, len(items), 8): + tok, xyz = pad_batch(items[start:start + 8]) + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + chunks.append( + model.encode_pocket(tok.to(device), xyz.to(device)).float()) + value = torch.cat(chunks) + out[k] = value if out[k] is None else out[k] + value + return [torch.nn.functional.normalize(v, dim=-1) for v in out] + + +@torch.no_grad() +def encode_molecules(model, tok, xyz, dtype, device, pair_budget: int): + """Encode a padded batch in slices that bound ``rows * length^2``. + + Ligand batches are collated from a privately shuffled LMDB, so one large + molecule can inflate the padded length of an otherwise small batch; the + attention bias is O(rows * heads * length^2) and must stay bounded. + """ + rows, length = tok.shape + per = max(1, min(rows, pair_budget // max(1, length * length))) + out = [] + start = 0 + while start < rows: + stop = min(rows, start + per) + try: + with torch.autocast("cuda", dtype=dtype, enabled=device.type == "cuda"): + out.append(model.encode_molecule(tok[start:stop], + xyz[start:stop]).float()) + except torch.cuda.OutOfMemoryError: + if stop - start == 1: + raise + torch.cuda.empty_cache() + per = max(1, (stop - start) // 2) + continue + start = stop + return torch.cat(out) + + +_NDTRI_A = [-3.969683028665376e+01, 2.209460984245205e+02, -2.759285104469687e+02, + 1.383577518672690e+02, -3.066479806614716e+01, 2.506628277459239e+00] +_NDTRI_B = [-5.447609879822406e+01, 1.615858368580409e+02, -1.556989798598866e+02, + 6.680131188771972e+01, -1.328068155288572e+01] +_NDTRI_C = [-7.784894002430293e-03, -3.223964580411365e-01, -2.400758277161838e+00, + -2.549732539343734e+00, 4.374664141464968e+00, 2.938163982698783e+00] +_NDTRI_D = [7.784695709041462e-03, 3.224671290700398e-01, 2.445134137142996e+00, + 3.754408661907416e+00] + + +def _ndtri(p: np.ndarray) -> np.ndarray: + """Standard normal quantile (Acklam's approximation + one Halley step). + + Inlined rather than imported: the package ships a fixed set of files and + may depend only on numpy, torch and lmdb, so scipy is unavailable. Kept + numerically identical to `research/src/ndtri_np.py`, which is tested + against it. + """ + p = np.asarray(p, dtype=np.float64) + x = np.empty_like(p) + lo, hi = p < 0.02425, p > 1.0 - 0.02425 + if lo.any(): + q = np.sqrt(-2.0 * np.log(p[lo])) + x[lo] = ((((((_NDTRI_C[0] * q + _NDTRI_C[1]) * q + _NDTRI_C[2]) * q + + _NDTRI_C[3]) * q + _NDTRI_C[4]) * q + _NDTRI_C[5]) + / ((((_NDTRI_D[0] * q + _NDTRI_D[1]) * q + _NDTRI_D[2]) * q + + _NDTRI_D[3]) * q + 1.0)) + if hi.any(): + q = np.sqrt(-2.0 * np.log1p(-p[hi])) + x[hi] = -((((((_NDTRI_C[0] * q + _NDTRI_C[1]) * q + _NDTRI_C[2]) * q + + _NDTRI_C[3]) * q + _NDTRI_C[4]) * q + _NDTRI_C[5]) + / ((((_NDTRI_D[0] * q + _NDTRI_D[1]) * q + _NDTRI_D[2]) * q + + _NDTRI_D[3]) * q + 1.0)) + mid = ~(lo | hi) + if mid.any(): + q = p[mid] - 0.5 + r = q * q + x[mid] = ((((((_NDTRI_A[0] * r + _NDTRI_A[1]) * r + _NDTRI_A[2]) * r + + _NDTRI_A[3]) * r + _NDTRI_A[4]) * r + _NDTRI_A[5]) * q + / (((((_NDTRI_B[0] * r + _NDTRI_B[1]) * r + _NDTRI_B[2]) * r + + _NDTRI_B[3]) * r + _NDTRI_B[4]) * r + 1.0)) + erfc = np.vectorize(math.erfc, otypes=[np.float64]) + e = 0.5 * erfc(-x / np.sqrt(2.0)) - p + u = e * np.sqrt(2.0 * np.pi) * np.exp(x * x / 2.0) + return x - u / (1.0 + x * u / 2.0) + + +_VDW_CACHE: dict[int, np.ndarray] = {} + + +def _vdw_scores(n: int) -> np.ndarray: + """van der Waerden scores for a list of length `n`, cached by length. + + Target candidate lists differ in length, so this cannot be a single + precomputed table; it is cached because a benchmark presents many + targets and most share a length. + """ + out = _VDW_CACHE.get(n) + if out is None: + out = _ndtri((np.arange(n, dtype=np.float64) + 0.5) / n) + _VDW_CACHE[n] = out + return out + + +def normalise_member(x: np.ndarray, how: str) -> np.ndarray: + """Put one member's scores for THIS target on a common scale. + + Normalisation is per target candidate list, which is the only population + available at inference and the one the dev measurement was matched to. + + `rank` is invariant to any monotone rescaling, which is maximally safe + across members of differing width -- but it discards magnitude, so a + member that is screamingly confident about a ligand and one that barely + prefers it cast identical votes. `z` keeps that magnitude and measured + +0.0062 [+0.0048,+0.0076] on the DUD-E-shaped dev proxy scored the way + this function scores (normalise within the candidate list, then combine). + `mad` is the robust variant and measured slightly behind `z`. + """ + if how == "rank": + return x.argsort().argsort().astype(np.float64) / max(1, len(x) - 1) + if how == "normal": + # van der Waerden: rank, then map rank -> standard normal quantile. + # Invariant to each member's scale like `rank`, but restores a + # bell-shaped spread so the top of the list is not compressed. Every + # member is forced to the SAME distribution, which is what makes a + # max-like reduction comparable across members: under `z` a member + # with a wider raw spread dominates the maximum for no good reason. + return _vdw_scores(len(x))[x.argsort().argsort()] + if how == "z": + return (x - x.mean()) / (x.std() + 1e-12) + if how == "mad": + med = np.median(x) + mad = np.median(np.abs(x - med)) + return 0.6745 * (x - med) / (mad + 1e-12) + raise ValueError(f"unknown member normalisation {how!r}") + + +def combine_members(per_model: list, mode: str, + normalise: str = "rank") -> np.ndarray: + """Combine per-member pooled score vectors into one ranking. + + Each member's pooled scores are rank-normalised to [0, 1] first, so + members need not share an embedding width or score scale, and then + reduced across members. + + `mean` is a plain rank-average. `topK` averages only the K highest member + ranks for each ligand, discarding the rest. + + Why topK and not mean: measured on the nine published members over the + BioLiP dev proxies, 64.4% of queries have at least one member that scores + the query at zero. Under a plain mean a single dissenting member drags a + ligand down even when every other member ranks it at the very top, and + BEDROC(alpha=80.5) only pays for the very top of the list. Discarding the + lowest few member ranks per ligand measured +0.0066 ndl_pm + [+0.0036,+0.0097] and +0.0153 mpm [+0.0026,+0.0294] against the mean, at + identical inference cost -- the reduction is a few array operations + against a full encode pass. + + This is a fixed arithmetic function of the member scores, identical for + every target and using no labels, so it introduces no per-target fitting. + """ + stack = np.stack([normalise_member(p, normalise) for p in per_model]) + n = stack.shape[0] + if mode == "mean": + return stack.mean(axis=0) + if mode.startswith("top"): + k = min(int(mode[len("top"):]), n) + if k <= 0: + raise ValueError(f"member combine {mode!r} selects no members") + # np.partition puts the k largest in the last k rows (unordered, + # which is all the mean needs). + return np.partition(stack, n - k, axis=0)[n - k:].mean(axis=0) + if mode.startswith("lse"): + # (1/b) log mean exp(b s): the smooth interpolation between the mean + # (b -> 0) and the max (b -> inf). `topK` samples that same + # "discount the dissenters" axis, but only at integers and with a + # hard cutoff; the smooth form weights every member by how high it + # scored instead of keeping k and discarding the rest. + # + # Shifted by the per-ligand max before exponentiating, so the + # exponent is never positive and this cannot overflow for any b. + b = float(mode[len("lse"):]) + if not b > 0: + raise ValueError(f"member combine {mode!r} needs a positive beta") + m = stack.max(axis=0) + return m + np.log(np.exp(b * (stack - m)).mean(axis=0)) / b + raise ValueError(f"unknown member combine {mode!r}") + + +def pool_pockets(sims: np.ndarray, mode: str) -> np.ndarray: + """Reduce a (pockets, ligands) similarity block to one score per ligand.""" + if sims.shape[0] == 1: + return sims[0] + if mode == "max": + return sims.max(axis=0) + if mode == "mean": + return sims.mean(axis=0) + if mode == "znorm_max": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).max(axis=0) + if mode == "znorm_mean": + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + return (0.6745 * (sims - median) / (mad + 1e-6)).mean(axis=0) + median = np.median(sims, axis=1, keepdims=True) + mad = np.median(np.abs(sims - median), axis=1, keepdims=True) + z = 0.6745 * (sims - median) / (mad + 1e-6) + if mode == "znorm_softmax": + w = np.exp(z - z.max(axis=0, keepdims=True)) + return (z * w).sum(axis=0) / w.sum(axis=0) + if mode.startswith("znorm_top"): + k = min(int(mode[len("znorm_top"):]), z.shape[0]) + return np.sort(z, axis=0)[-k:].mean(axis=0) + raise ValueError(f"unknown pocket pooling {mode!r}") + + +@torch.no_grad() +def hubness_correct(sims, reference, ligands, weight: float, mode: str, + chunk: int = 8192): + """Remove each ligand's generic affinity for arbitrary pockets. + + ``mean`` subtracts the mean reference-pocket score; ``zscore`` also + divides by its spread. The reference pockets are a fixed sample of BioLiP + training pockets stored in the package, so nothing is fitted at inference. + + The background is computed through ``similarity`` rather than as a matrix + product with the mean reference embedding. For a single-vector model the + two agree, but a multi-slot pocket scores by a max over its slots, and the + mean of a max is not the max of a mean. + """ + if mode not in ("mean", "zscore"): + raise ValueError(f"unknown background mode {mode!r}") + out = sims.clone() + for start in range(0, ligands.shape[0], chunk): + stop = start + chunk + block = similarity(reference, ligands[start:stop]) + window = sims[:, start:stop] + mu = block.mean(dim=0) + if mode == "mean": + out[:, start:stop] = window - weight * mu.unsqueeze(0) + else: + sd = block.std(dim=0) + 1e-6 + out[:, start:stop] = (1 - weight) * window + weight * ( + (window - mu.unsqueeze(0)) / sd.unsqueeze(0)) + return out + + +@torch.no_grad() +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("input_root", type=Path) + parser.add_argument("output_root", type=Path) + parser.add_argument("--model-package", type=Path, default=HERE) + parser.add_argument("--batch-size", type=int, default=1024, + help="padded encoder rows per batch (molecules x conformers)") + parser.add_argument("--pair-budget", type=int, default=12_000_000, + help="cap on rows * padded_length^2 per encoder call") + parser.add_argument("--workers", type=int, default=8) + parser.add_argument("--device", default="cuda" if torch.cuda.is_available() else "cpu") + parser.add_argument("--benchmark", choices=("all", "dude", "lit_pcba"), default="all") + parser.add_argument("--conformers", type=int) + parser.add_argument("--pocket-pooling") + parser.add_argument("--conformer-pooling", choices=("mean", "renormalise")) + parser.add_argument("--pocket-budgets", type=int, nargs="+") + parser.add_argument("--background-weight", type=float) + parser.add_argument("--background-mode", choices=("mean", "zscore")) + parser.add_argument("--member-normalise", choices=("rank", "z", "mad"), + help="per-member score normalisation within a " + "target's candidate list") + parser.add_argument("--member-combine", + help="how to reduce per-member ranks: 'mean' or " + "'topK' (average the K best member ranks per " + "ligand). Overrides the packaged setting.") + parser.add_argument("--max-targets", type=int, help="smoke test only") + parser.add_argument("--max-ligands", type=int, help="smoke test only") + args = parser.parse_args() + + device = torch.device(args.device) + package = args.model_package.resolve() + models, settings, background, manifest = load_model(package, device) + conformers = args.conformers or int(settings.get("conformers", 1)) + pooling = args.pocket_pooling or settings.get("pocket_pooling", "znorm_max") + bg_weight = (args.background_weight if args.background_weight is not None + else float(settings.get("background_weight", 0.0))) + conformer_pooling = (args.conformer_pooling + or settings.get("conformer_pooling", "mean")) + bg_mode = args.background_mode or settings.get("background_mode", "mean") + # Default "mean" keeps older packages, which carry no member_combine key, + # scoring exactly as they did before this setting existed. + member_combine = (args.member_combine + or settings.get("member_combine", "mean")) + # Default "rank" keeps older packages, which carry no member_normalise + # key, scoring exactly as they did before this setting existed. + member_normalise = (args.member_normalise + or settings.get("member_normalise", "rank")) + max_mol_atoms = int(settings.get("max_mol_atoms", 256)) + max_pocket_atoms = int(settings.get("max_pocket_atoms", 384)) + budgets = [int(b) for b in (args.pocket_budgets + or settings.get("pocket_budgets") + or [max_pocket_atoms])] + dtype = torch.bfloat16 if device.type == "cuda" else torch.float32 + + output = args.output_root.resolve() + output.mkdir(parents=True, exist_ok=True) + selected = list(test_targets(args.input_root.resolve(), args.benchmark)) + if args.max_targets: + selected = selected[:args.max_targets] + + temporary = output / "scores.csv.tmp" + rows = 0 + with temporary.open("w", newline="") as stream: + writer = csv.writer(stream) + writer.writerow(("benchmark", "target_id", "ligand_index", "score")) + for benchmark, target_id, mol_path, pocket_path in selected: + pocket_embeddings = encode_pockets(models, pocket_path, budgets, + device, dtype) + dataset = MoleculeSet(mol_path, max_mol_atoms, conformers, + limit=args.max_ligands) + count = len(dataset) + per_batch = max(1, args.batch_size // max(1, conformers)) + loader = DataLoader(dataset, batch_size=per_batch, shuffle=False, + num_workers=args.workers, collate_fn=collate_molecules, + pin_memory=device.type == "cuda") + # Members are combined by rank-averaging pooled score vectors + # below, so they need not share an embedding width; give each its + # own accumulator. + emb_sum = [torch.zeros((count, m.config.embedding_dim), + dtype=torch.float32, device=device) + for m in models] + seen = torch.zeros(count, dtype=torch.float32, device=device) + first = True + for batch in loader: + tok = batch["tok"].to(device, non_blocking=True) + xyz = batch["xyz"].to(device, non_blocking=True) + index = batch["index"].to(device, non_blocking=True) + for k, model in enumerate(models): + emb = encode_molecules(model, tok, xyz, dtype, device, + args.pair_budget) + emb_sum[k].index_add_(0, index, emb) + seen.index_add_(0, index, torch.ones_like(index, dtype=torch.float32)) + first = False + if first: + raise ValueError(f"no molecules read from {mol_path}") + seen = seen.clamp_min(1.0).unsqueeze(1) + per_model = [] + for k in range(len(models)): + mean = emb_sum[k] / seen + if conformer_pooling == "renormalise": + mean = torch.nn.functional.normalize(mean, dim=-1) + sims = similarity(pocket_embeddings[k], mean) + if bg_weight and background is not None: + sims = hubness_correct(sims, background[k], mean, bg_weight, + bg_mode) + per_model.append(pool_pockets(sims.cpu().numpy().astype(np.float64), + pooling)) + if len(per_model) == 1: + scores = per_model[0] + else: + scores = combine_members(per_model, member_combine, + member_normalise) + scores = np.nan_to_num(scores, nan=-1e9, posinf=1e9, neginf=-1e9) + for i, value in enumerate(scores): + writer.writerow((benchmark, target_id, i, repr(float(value)))) + rows += len(scores) + print(f"{benchmark}/{target_id}: {len(scores)} ligands", flush=True) + os.replace(temporary, output / "scores.csv") + (output / "prediction_manifest.json").write_text(json.dumps({ + "schema": "target-based-drug-screening-predictions/v1", + "rows": rows, "targets": len(selected), "benchmark": args.benchmark, + "models": len(models), "conformers": conformers, + "pocket_pooling": pooling, "background_weight": bg_weight, + "conformer_pooling": conformer_pooling, "pocket_budgets": budgets, + "background_mode": bg_mode, + "complete_benchmark": args.max_targets is None and args.max_ligands is None, + "model_manifest_sha256": sha256(package / "model_manifest.json"), + }, indent=2, sort_keys=True) + "\n") + + +if __name__ == "__main__": + main() diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5 diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/training_summary.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/training_summary.json new file mode 100644 index 0000000000000000000000000000000000000000..36aa1546309d46fd8ec5e07390cbebe7a47bb69d --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S023/training_summary.json @@ -0,0 +1,1207 @@ +{ + "background_rows": 2048, + "ensemble_size": 11, + "inference": { + "background_mode": "mean", + "background_weight": 0.5, + "conformer_pooling": "mean", + "conformers": 4, + "max_mol_atoms": 256, + "max_pocket_atoms": 384, + "member_combine": "top10", + "member_normalise": "z", + "pocket_budgets": [ + 384 + ], + "pocket_pooling": "max" + }, + "init_chains": [ + [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "data": "biolip_train", + "epochs": 18, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m2_pre/best.pt", + "data": "profsa_pretrain_500k", + "epochs": 14, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm256_ep6.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ], + [ + { + "checkpoint": "/workspace/research/snap_dlxcm256aug_ep10.pt", + "data": "biolip_train", + "epochs": 41, + "init_mol_official": true, + "init_pkt_official": false + }, + { + "checkpoint": "/workspace/research/exp/m1_pre/last.pt", + "data": "profsa_pretrain_500k", + "epochs": 8, + "init_mol_official": true, + "init_pkt_official": true + } + ] + ], + "members": [ + { + "checkpoint": "/workspace/research/snap_dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16801894614828858, + "dl_pool_bedroc": 0.2650962926934237, + "dl_queries": 5559, + "multi_bedroc_max": 0.3041930164774818, + "multi_bedroc_znorm": 0.28014367629410153, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14665528983074524, + "ndl_pool_bedroc": 0.24621145781532028, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23942194363734795, + "novel_pool_bedroc": 0.3281136164589236, + "novel_queries": 8926, + "pm_bedroc": 0.2953490105772687, + "pm_mrr": 0.214153745610112, + "pm_top1pct": 0.2940833333333333, + "pool_bedroc": 0.37539041335391865, + "pool_mrr": 0.09219559286191092, + "pool_top1pct": 0.39891666666666664, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "2.2", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "4", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxslot_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1664755781246109, + "dl_pool_bedroc": 0.2562422708329113, + "dl_queries": 5559, + "mpm_bedroc": 0.2309433459290298, + "mpm_targets": 202, + "multi_bedroc_max": 0.29551300354935767, + "multi_bedroc_znorm": 0.2844056914707833, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14346708324535248, + "ndl_pool_bedroc": 0.23464904383909949, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23207309841030976, + "novel_pool_bedroc": 0.32306596171671526, + "novel_queries": 8926, + "pm_bedroc": 0.28719694230187565, + "pm_mrr": 0.2019367792762323, + "pm_top1pct": 0.28875, + "pool_bedroc": 0.37010977997978445, + "pool_mrr": 0.0841358063695273, + "pool_top1pct": 0.39508333333333334, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.8", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "4", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "7", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxslot_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m1_ep5.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.156661265423493, + "dl_pool_bedroc": 0.2565488005792692, + "dl_queries": 5559, + "multi_bedroc_max": 0.2832527002359017, + "multi_bedroc_znorm": 0.2650805414254804, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13199078292335661, + "ndl_pool_bedroc": 0.23571971889871177, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24730738999488666, + "novel_pool_bedroc": 0.33907228141729395, + "novel_queries": 8926, + "pm_bedroc": 0.3075885262104949, + "pm_mrr": 0.22884553969924662, + "pm_top1pct": 0.30833333333333335, + "pool_bedroc": 0.3876709886789866, + "pool_mrr": 0.10192002763447583, + "pool_top1pct": 0.4115, + "queries": 12000 + }, + "epoch": 5, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "18", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "5.3", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "resume": "True", + "seed": "1", + "select": "dl", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m1_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcrop_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1613965144745072, + "dl_pool_bedroc": 0.2503855396311353, + "dl_queries": 5559, + "mpm_bedroc": 0.2558077250765601, + "mpm_targets": 202, + "multi_bedroc_max": 0.2991672458868569, + "multi_bedroc_znorm": 0.2921429348880207, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13980800676867183, + "ndl_pool_bedroc": 0.23055150892776877, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.21784102571213945, + "novel_pool_bedroc": 0.31073988001466296, + "novel_queries": 8926, + "pm_bedroc": 0.2757981577255862, + "pm_mrr": 0.19167848339255406, + "pm_top1pct": 0.27858333333333335, + "pool_bedroc": 0.35894565129720796, + "pool_mrr": 0.0872091630226914, + "pool_top1pct": 0.3824166666666667, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.0", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "9", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcrop_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_m2dlx_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.16684071376392798, + "dl_pool_bedroc": 0.26669986672870655, + "dl_queries": 5559, + "mpm_bedroc": 0.2275815165272483, + "mpm_targets": 202, + "multi_bedroc_max": 0.28072716165667017, + "multi_bedroc_znorm": 0.27308702324825435, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14370865580256936, + "ndl_pool_bedroc": 0.24637974869633167, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24283952444191848, + "novel_pool_bedroc": 0.33738125227808025, + "novel_queries": 8926, + "pm_bedroc": 0.2989745035107514, + "pm_mrr": 0.21347763843810685, + "pm_top1pct": 0.30316666666666664, + "pool_bedroc": 0.38353072428422447, + "pool_mrr": 0.08877038862293576, + "pool_top1pct": 0.405, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m2_pre/best.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "14", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/m2dlx_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxls24_ep8.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1652565639549929, + "dl_pool_bedroc": 0.26241129233627764, + "dl_queries": 5559, + "mpm_bedroc": 0.23548597137064808, + "mpm_targets": 202, + "multi_bedroc_max": 0.2879989112727985, + "multi_bedroc_znorm": 0.2801992919481215, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14410643427626985, + "ndl_pool_bedroc": 0.24346150950940007, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2457831570714463, + "novel_pool_bedroc": 0.33622117107677796, + "novel_queries": 8926, + "pm_bedroc": 0.30032469392888766, + "pm_mrr": 0.21376721532700294, + "pm_top1pct": 0.30266666666666664, + "pool_bedroc": 0.38332303120631755, + "pool_mrr": 0.0914763839944599, + "pool_top1pct": 0.4086666666666667, + "queries": 12000 + }, + "epoch": 8, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "24.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "23", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxls24_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxaug_ep11.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1584067747879925, + "dl_pool_bedroc": 0.24652878488470567, + "dl_queries": 5559, + "mpm_bedroc": 0.22831657131730052, + "mpm_targets": 202, + "multi_bedroc_max": 0.27016178126488616, + "multi_bedroc_znorm": 0.27361543968843915, + "multi_targets": 202, + "ndl_pm_bedroc": 0.13543255041213045, + "ndl_pool_bedroc": 0.22615499896771418, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.23927939721475114, + "novel_pool_bedroc": 0.3212808667850621, + "novel_queries": 8926, + "pm_bedroc": 0.2940144214902805, + "pm_mrr": 0.21116406103325952, + "pm_top1pct": 0.29825, + "pool_bedroc": 0.3694747969092437, + "pool_mrr": 0.09075396473623987, + "pool_top1pct": 0.39316666666666666, + "queries": 12000 + }, + "epoch": 11, + "train_args": { + "allow_partial_init": "False", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.15", + "pocket_noise": "0.3", + "pool": "cls", + "resume": "True", + "seed": "25", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxaug_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm_ep13.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17462605835992448, + "dl_pool_bedroc": 0.26834111988583903, + "dl_queries": 5559, + "mpm_bedroc": 0.2507523777924781, + "mpm_targets": 202, + "multi_bedroc_max": 0.3112999815334348, + "multi_bedroc_znorm": 0.305267879975701, + "multi_targets": 202, + "ndl_pm_bedroc": 0.15360276484480176, + "ndl_pool_bedroc": 0.2494389669781302, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2481720302933697, + "novel_pool_bedroc": 0.3351057833400973, + "novel_queries": 8926, + "pm_bedroc": 0.3006639115142498, + "pm_mrr": 0.21543822948349, + "pm_top1pct": 0.3035833333333333, + "pool_bedroc": 0.3793121435837497, + "pool_mrr": 0.09031866735912782, + "pool_top1pct": 0.4083333333333333, + "queries": 12000 + }, + "epoch": 13, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "128", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "21", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxd256_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.17097729892870533, + "dl_pool_bedroc": 0.26065781137176686, + "dl_queries": 5559, + "mpm_bedroc": 0.23589549510197785, + "mpm_targets": 202, + "multi_bedroc_max": 0.284045847546807, + "multi_bedroc_znorm": 0.27968615096894256, + "multi_targets": 202, + "ndl_pm_bedroc": 0.14982154788670646, + "ndl_pool_bedroc": 0.24122562512654402, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.246268923899786, + "novel_pool_bedroc": 0.33266123234681144, + "novel_queries": 8926, + "pm_bedroc": 0.3006410874971601, + "pm_mrr": 0.2164977586391705, + "pm_top1pct": 0.30341666666666667, + "pool_bedroc": 0.37974803676461566, + "pool_mrr": 0.09014114658246679, + "pool_top1pct": 0.40558333333333335, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls", + "resume": "True", + "seed": "22", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxd256_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm256_ep6.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.18135241294207832, + "dl_pool_bedroc": 0.2837347500594526, + "dl_queries": 5559, + "mpm_bedroc": 0.26044486582935344, + "mpm_targets": 202, + "multi_bedroc_max": 0.31441598547439653, + "multi_bedroc_znorm": 0.3120025801452303, + "multi_targets": 202, + "ndl_pm_bedroc": 0.1592227672369005, + "ndl_pool_bedroc": 0.26434652384193025, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.24776520920496842, + "novel_pool_bedroc": 0.346050838337958, + "novel_queries": 8926, + "pm_bedroc": 0.30882754918366695, + "pm_mrr": 0.22204750940452253, + "pm_top1pct": 0.30791666666666667, + "pool_bedroc": 0.39521698966643853, + "pool_mrr": 0.08761897391052133, + "pool_top1pct": 0.42425, + "queries": 12000 + }, + "epoch": 6, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.0", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.0", + "pool": "cls_mean", + "resume": "True", + "seed": "33", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm256_ft", + "workers": "18" + } + }, + { + "checkpoint": "/workspace/research/snap_dlxcm256aug_ep10.pt", + "dev_metrics": { + "dl_pm_bedroc": 0.1777136637960689, + "dl_pool_bedroc": 0.279415709741605, + "dl_queries": 5559, + "mpm_bedroc": 0.2792917003438008, + "mpm_targets": 202, + "multi_bedroc_max": 0.33252087903973115, + "multi_bedroc_znorm": 0.3140060038339939, + "multi_targets": 202, + "ndl_pm_bedroc": 0.1528052518397721, + "ndl_pool_bedroc": 0.2580619207543733, + "ndl_queries": 4909, + "novel_pm_bedroc": 0.2597581467249815, + "novel_pool_bedroc": 0.3463871331941959, + "novel_queries": 8926, + "pm_bedroc": 0.31933823833981134, + "pm_mrr": 0.2343214335120428, + "pm_top1pct": 0.3215, + "pool_bedroc": 0.39608111061920165, + "pool_mrr": 0.09454489288487543, + "pool_top1pct": 0.42241666666666666, + "queries": 12000 + }, + "epoch": 10, + "train_args": { + "allow_partial_init": "True", + "bank_batch": "1024", + "bank_refresh": "1", + "batch_size": "768", + "clip_norm": "1.0", + "data": "biolip_train", + "dev_data": "biolip_dev", + "dev_index": "/workspace/research/cache/devbench_big", + "dropout": "0.1", + "druglike_file": "/workspace/research/cache/biolip_train/ligprops.npz", + "druglike_negatives": "False", + "druglike_ratio": "1.0", + "ema_decay": "0.999", + "embedding_dim": "256", + "epochs": "41", + "eval_every": "1", + "eval_queries": "12000", + "freeze_mol": "False", + "grad_ckpt": "True", + "init": "/workspace/research/exp/m1_pre/last.pt", + "init_mol_official": "True", + "init_pkt_official": "False", + "l2sp": "0.0", + "learn_scale": "False", + "ligand_budget": "1500000", + "log_every": "400", + "logit_scale": "14.0", + "lr": "0.0002", + "max_hours": "1.6", + "max_ligand_atoms": "0", + "max_mol_atoms": "256", + "max_pocket_atoms": "384", + "min_ligand_atoms": "8", + "mol_attn_dropout": "0.0", + "mol_lr_mult": "0.25", + "mol_noise": "0.1", + "neg": "0", + "neighbour_mask": "/workspace/research/cache/biolip_train/neighbours_0.9.npz", + "pair_chunk": "8", + "pkt_attn_dropout": "0.0", + "pkt_dropout": "0.1", + "pkt_grad_ckpt": "False", + "pkt_heads": "16", + "pkt_slots": "1", + "pocket_crop_low": "96", + "pocket_crop_prob": "0.25", + "pocket_dropout": "0.0", + "pocket_noise": "0.3", + "pool": "cls_mean", + "resume": "True", + "seed": "43", + "select": "ndlpm", + "site_groups": "/workspace/research/cache/biolip_train/site_positives.npz", + "site_positive": "True", + "steps_per_epoch": "0", + "sym_weight": "0.5", + "token_budget": "7100000", + "warmup_ratio": "0.03", + "weight_decay": "0.0", + "work_dir": "/workspace/research/exp/dlxcm256aug_ft", + "workers": "18" + } + } + ], + "method": "dual-unimol-ztop10c4hub11", + "molecule_init_official": true, + "notes": "Eleventh member dlxcm256aug (cls_mean + embedding-dim 256 + noise augmentation), and reduction top9 -> top10, which keeps the rule 'discard the single worst member per ligand' at the new ensemble size. Selected on dev proxies matched to the benchmarks in decoy tightness and active count.", + "parameter_count": 1050259870, + "parameters_by_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554, + 95954842, + 95954842 + ], + "parameters_per_member": [ + 95299226, + 95300762, + 95299226, + 95299226, + 95299226, + 95299226, + 95299226, + 95823514, + 95430554, + 95954842, + 95954842 + ], + "pocket_init_remapped": true, + "schema": "target-based-drug-screening-fit/v4" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/README.md b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fc26b9513677117cabec099bf5c917ecac3d4607 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/README.md @@ -0,0 +1,100 @@ +# Target-based virtual screening package + +Method identifier: `dual-unimol-ztop6c4hub7`. + +## Model + +Two independent Uni-Mol-style 3D encoders (one for the binding pocket, one +for the ligand) are trained contrastively into a shared normalised embedding +space; a ligand is scored by the similarity of its embedding to the +embedding(s) of the target pocket. Distances and edge types are derived from +atom coordinates inside the model, and each structure is presented to the +encoder as `[CLS] atoms... [SEP]` with the two special tokens placed at the +centroid of the (mean-centred) structure, matching Uni-Mol preprocessing. + +- exact learned parameter count: **668931638** +- ensemble members: 7 (differing architectures of 95300762, 95299226, 95299226, 95299226, 95823514, 95954842, 95954842 parameters respectively). The members are + shipped as one fixed parameter set, used unchanged for every target + in both benchmarks. +- pocket tower: 15 layers, width 512, 16 attention heads, element dictionary of 10 tokens +- ligand tower: 15 layers, width 512, 64 attention heads, element dictionary of 31 tokens +- projection: 2-layer head to 128 dimensions, L2 normalised, fixed logit scale 14.0 + +## Initialisation and training provenance + +- The ligand tower is initialised from the supplied generic Uni-Mol molecule + checkpoint `mol_pre_no_h_220816.pt` (SHA256 verified at training time). +- The pocket tower is initialised from that same generic checkpoint, + remapped onto the 10-token pocket element dictionary: every pocket token + also exists in the molecule dictionary, so the token embeddings and the + per-edge-type Gaussian parameters are copied exactly and the remaining + weights are dictionary independent. +- No pocket-specific, author-released or benchmark-trained weights are used + anywhere. +- Stage 1 trains on the supplied ProFSA pretraining split; stage 2 trains on + the supplied BioLiP training split. Both stages use in-batch plus + molecule-bank contrastive negatives drawn only from the training split. +- BioLiP development records are used exclusively for validation and + checkpoint selection; no development record contributes a gradient. +- No DUD-E or LIT-PCBA input, label, checkpoint or cached prediction was used + at any point. + +## Selection + +Checkpoints are selected on BioLiP development screening proxies built only +from development records: single-active retrieval of the true ligand against +the full pool of unique development ligands, and the same queries against +property-matched, topologically dissimilar decoys. Near-duplicate ligands and +ligands bound elsewhere in the same PDB entry are removed from a query's +candidate list. Selection maximises BEDROC(alpha=80.5) on these proxies. + +Per-member development metrics: + +- epoch 8: dl_pm_bedroc=0.1665, dl_pool_bedroc=0.2562, mpm_bedroc=0.2309, multi_bedroc_max=0.2955, multi_bedroc_znorm=0.2844, ndl_pm_bedroc=0.1435, ndl_pool_bedroc=0.2346, novel_pm_bedroc=0.2321, novel_pool_bedroc=0.3231, pm_bedroc=0.2872, pm_mrr=0.2019, pm_top1pct=0.2888, pool_bedroc=0.3701, pool_mrr=0.0841, pool_top1pct=0.3951 +- epoch 8: dl_pm_bedroc=0.1668, dl_pool_bedroc=0.2667, mpm_bedroc=0.2276, multi_bedroc_max=0.2807, multi_bedroc_znorm=0.2731, ndl_pm_bedroc=0.1437, ndl_pool_bedroc=0.2464, novel_pm_bedroc=0.2428, novel_pool_bedroc=0.3374, pm_bedroc=0.2990, pm_mrr=0.2135, pm_top1pct=0.3032, pool_bedroc=0.3835, pool_mrr=0.0888, pool_top1pct=0.4050 +- epoch 8: dl_pm_bedroc=0.1653, dl_pool_bedroc=0.2624, mpm_bedroc=0.2355, multi_bedroc_max=0.2880, multi_bedroc_znorm=0.2802, ndl_pm_bedroc=0.1441, ndl_pool_bedroc=0.2435, novel_pm_bedroc=0.2458, novel_pool_bedroc=0.3362, pm_bedroc=0.3003, pm_mrr=0.2138, pm_top1pct=0.3027, pool_bedroc=0.3833, pool_mrr=0.0915, pool_top1pct=0.4087 +- epoch 11: dl_pm_bedroc=0.1584, dl_pool_bedroc=0.2465, mpm_bedroc=0.2283, multi_bedroc_max=0.2702, multi_bedroc_znorm=0.2736, ndl_pm_bedroc=0.1354, ndl_pool_bedroc=0.2262, novel_pm_bedroc=0.2393, novel_pool_bedroc=0.3213, pm_bedroc=0.2940, pm_mrr=0.2112, pm_top1pct=0.2983, pool_bedroc=0.3695, pool_mrr=0.0908, pool_top1pct=0.3932 +- epoch 13: dl_pm_bedroc=0.1746, dl_pool_bedroc=0.2683, mpm_bedroc=0.2508, multi_bedroc_max=0.3113, multi_bedroc_znorm=0.3053, ndl_pm_bedroc=0.1536, ndl_pool_bedroc=0.2494, novel_pm_bedroc=0.2482, novel_pool_bedroc=0.3351, pm_bedroc=0.3007, pm_mrr=0.2154, pm_top1pct=0.3036, pool_bedroc=0.3793, pool_mrr=0.0903, pool_top1pct=0.4083 +- epoch 6: dl_pm_bedroc=0.1814, dl_pool_bedroc=0.2837, mpm_bedroc=0.2604, multi_bedroc_max=0.3144, multi_bedroc_znorm=0.3120, ndl_pm_bedroc=0.1592, ndl_pool_bedroc=0.2643, novel_pm_bedroc=0.2478, novel_pool_bedroc=0.3461, pm_bedroc=0.3088, pm_mrr=0.2220, pm_top1pct=0.3079, pool_bedroc=0.3952, pool_mrr=0.0876, pool_top1pct=0.4243 +- epoch 10: dl_pm_bedroc=0.1777, dl_pool_bedroc=0.2794, mpm_bedroc=0.2793, multi_bedroc_max=0.3325, multi_bedroc_znorm=0.3140, ndl_pm_bedroc=0.1528, ndl_pool_bedroc=0.2581, novel_pm_bedroc=0.2598, novel_pool_bedroc=0.3464, pm_bedroc=0.3193, pm_mrr=0.2343, pm_top1pct=0.3215, pool_bedroc=0.3961, pool_mrr=0.0945, pool_top1pct=0.4224 + +## Inference + +- ligand conformers averaged per molecule: 4 (pooling `mean`) +- pocket atom budget: 384 (nearest atoms to the pocket centroid) +- ligand atom budget: 256 +- multi-pocket pooling: `max` +- member combination: `top6` +- member normalisation: `z` +- hubness correction: mode `mean`, weight 0.5, over 2048 fixed reference pocket embeddings +- ensemble members are scored independently, each member's scores are + normalised within the target's own candidate list (z-normalised, which preserves score magnitude), and the per-member values are then reduced with `top6` (the mean of the 6 highest member values per ligand, discarding the rest) + +`bash infer.sh ` writes `scores.csv` with one row +per (benchmark, target_id, ligand_index) and a finite score, higher meaning +more likely active. Inference needs only this package: no training workspace, +no original Uni-Mol checkpoint, and no network. + +## Limitations + +- Training data contains no measured activity values and no explicit + inactives; negatives are constructed by sampling other ligands, so the model + learns pocket/ligand compatibility rather than calibrated affinity. +- The ligand universe seen during training is far smaller and less drug-like + than a screening library, so scores on unusual chemotypes are extrapolation. +- Scores are comparable within a target only. No cross-target calibration is + claimed, and the metric used for selection is a development proxy, not the + held-out benchmark. +- The development proxies differ from the benchmarks in candidate-list + shape: most have one active per list against a benchmark target's many, + and the larger proxy lists are padded with uniformly drawn library + molecules rather than property-matched decoys. Both differences were + measured to change which scoring rule looks best, so the inference + settings above were selected on the proxies matching the benchmarks in + decoy tightness and active count, and the margins behind them are small. +- Ligand conformers are taken as supplied; the model does not dock, so it + cannot reason about an explicit bound pose. + +## Notes + +Ensemble reduced from 11 members to 7 and reduction top10 -> top6, keeping the rule 'discard the single worst member per ligand'. The four dropped members (dlx, dlxd256, dlxcrop, m1) were admitted on a dev proxy since shown to have the wrong candidate-list shape; on proxies matched to the benchmarks in decoy tightness and active count they measure harmful. Selection validated on held-out targets. Also cuts inference cost by 36%. diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/infer.sh b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/infer.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8e4fc15250038540a8de7e04148faee23b1e952 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/infer.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +here=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +[[ $# -ge 2 ]] || { echo "usage: infer.sh INPUT_ROOT OUTPUT_ROOT" >&2; exit 2; } +exec python "$here/predict.py" "$1" "$2" --model-package "$here" "${@:3}" diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/model_manifest.json b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/model_manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..273b9c756eb8d28f1e1771dd39c44511c4bb8d0d --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/model_manifest.json @@ -0,0 +1,11 @@ +{ + "checkpoint": { + "path": "model.pt", + "sha256": "93107d85335d0ba30f004cd95fac86f5543240e50920a27224d9bc3d579c1b04" + }, + "method": "dual-unimol-ztop6c4hub7", + "model_config": "model_config.json", + "parameter_count": 668931638, + "schema": "target-based-drug-screening-model/v2", + "training_summary": "training_summary.json" +} diff --git a/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/requirements.txt b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..e0d0c38463a1f5dcef799c88ce86a8427236f7f9 --- /dev/null +++ b/tasks/target-based-drug-screening/target-based-drug-screening-fable52-xhigh-1h100-48h-20261110a/submissions/S024/requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.26 +torch>=2.4 +lmdb>=1.5