pranamanam commited on
Commit
f616d9f
·
verified ·
1 Parent(s): a8d73b3

Delete lecture_5

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. lecture_5/.gitignore +0 -5
  2. lecture_5/README.md +0 -87
  3. lecture_5/SLIDE_CODE_MAP.md +0 -24
  4. lecture_5/common.py +0 -134
  5. lecture_5/data/README.md +0 -1
  6. lecture_5/data/dna_train.tsv +0 -257
  7. lecture_5/examples/areuredi.py +0 -7
  8. lecture_5/examples/dirichlet.py +0 -7
  9. lecture_5/examples/fisher.py +0 -7
  10. lecture_5/examples/gat.py +0 -7
  11. lecture_5/examples/gumbel.py +0 -7
  12. lecture_5/examples/mog_dfm.py +0 -7
  13. lecture_5/examples/rectified.py +0 -7
  14. lecture_5/examples/redi.py +0 -7
  15. lecture_5/flows.py +0 -188
  16. lecture_5/lecture_core.py +0 -203
  17. lecture_5/numerical_examples.py +0 -26
  18. lecture_5/requirements.txt +0 -3
  19. lecture_5/run.py +0 -115
  20. lecture_5/run_all.py +0 -15
  21. lecture_5/tests/test_mathematics.py +0 -66
  22. lecture_5/verified_examples/README.md +0 -16
  23. lecture_5/verified_examples/areuredi/config.json +0 -22
  24. lecture_5/verified_examples/areuredi/losses.json +0 -162
  25. lecture_5/verified_examples/areuredi/report.json +0 -19
  26. lecture_5/verified_examples/areuredi/samples.txt +0 -8
  27. lecture_5/verified_examples/dirichlet/config.json +0 -22
  28. lecture_5/verified_examples/dirichlet/losses.json +0 -162
  29. lecture_5/verified_examples/dirichlet/report.json +0 -17
  30. lecture_5/verified_examples/dirichlet/samples.txt +0 -8
  31. lecture_5/verified_examples/environment.json +0 -7
  32. lecture_5/verified_examples/fisher/config.json +0 -22
  33. lecture_5/verified_examples/fisher/losses.json +0 -162
  34. lecture_5/verified_examples/fisher/report.json +0 -17
  35. lecture_5/verified_examples/fisher/samples.txt +0 -8
  36. lecture_5/verified_examples/gat/config.json +0 -22
  37. lecture_5/verified_examples/gat/losses.json +0 -162
  38. lecture_5/verified_examples/gat/report.json +0 -13
  39. lecture_5/verified_examples/gat/samples.txt +0 -8
  40. lecture_5/verified_examples/gumbel/config.json +0 -22
  41. lecture_5/verified_examples/gumbel/losses.json +0 -162
  42. lecture_5/verified_examples/gumbel/report.json +0 -18
  43. lecture_5/verified_examples/gumbel/samples.txt +0 -8
  44. lecture_5/verified_examples/mog-dfm/config.json +0 -22
  45. lecture_5/verified_examples/mog-dfm/losses.json +0 -162
  46. lecture_5/verified_examples/mog-dfm/report.json +0 -21
  47. lecture_5/verified_examples/mog-dfm/samples.txt +0 -8
  48. lecture_5/verified_examples/rectified/config.json +0 -22
  49. lecture_5/verified_examples/rectified/losses.json +0 -162
  50. lecture_5/verified_examples/rectified/report.json +0 -17
lecture_5/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- __pycache__/
2
- .venv/
3
- outputs/
4
- *.pt
5
- .pytest_cache/
 
 
 
 
 
 
lecture_5/README.md DELETED
@@ -1,87 +0,0 @@
1
- # CIS 6270 - Lecture 5 - Discrete Flow Matching
2
-
3
- Course hub: [ChatterjeeLab/CIS6270 on Hugging Face](https://huggingface.co/ChatterjeeLab/CIS6270).
4
-
5
- Complete CPU examples for the flow-matching code in the [Discrete Generation lecture](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit). Begin with **Gat et al.'s classic discrete flow matching**, then change the path, loss, or guidance module. Lecture 4's diffusion examples are in [lecture_4/](../lecture_4/README.md). The slide deck remains combined.
6
-
7
- The examples use synthetic DNA and small transformers to make training and generation inspectable. They are teaching implementations, not replications of large-scale paper experiments.
8
-
9
- ## Run classic DFM first
10
-
11
- Python 3.11 or later, CPU. Data generation and training require no external downloads beyond the dependencies.
12
-
13
- From the course repository root, enter this lecture folder.
14
-
15
- ```bash
16
- cd lecture_5
17
- python -m venv .venv
18
- source .venv/bin/activate
19
- pip install -r requirements.txt
20
- python run.py --method gat --data data/dna_train.tsv --out outputs/gat
21
- python run.py --method gat --mode sample --out outputs/gat
22
- ```
23
-
24
- The first command trains on independent source/target pairs, validates on held-out synthetic DNA, saves a checkpoint, and generates sequences using the learned jump rates. Outputs include `config.json`, `losses.json`, `report.json`, `samples.txt`, and `checkpoint.pt`. Generation-only commands must use the checkpoint's method, width, and sequence length. Optimizer state is not saved for resumed training.
25
-
26
- ```bash
27
- python examples/gat.py --length 4 --train-steps 160 --samples 8
28
- python run_all.py
29
- python run_all.py --quick
30
- python -m unittest discover -s tests -v
31
- python numerical_examples.py
32
- ```
33
-
34
- ## Change only the relevant module
35
-
36
- `lecture_core.py` contains the code modules from the slides. `common.py` contains the backbone-independent data and training utilities. `flows.py` implements complete integration, teacher recoupling, guidance, and refinement loops. `run.py` selects the loss and sampler. Each `examples/*.py` file is a runnable method-specific entry point.
37
-
38
- | Example | Training | Generation |
39
- | --- | --- | --- |
40
- | `gat` | Endpoint-token cross-entropy on a categorical mixture path | Euler updates from posterior-derived jump rates |
41
- | `dirichlet` | Endpoint prediction from Dirichlet samples | Posterior average of Beta-CDF-derived conditional fields |
42
- | `fisher` | Tangent velocity regression on square-root geodesics | Tangent integration, positive-orthant correction, spherical normalization |
43
- | `gumbel` | Regression to the full noisy path derivative | Integrate from an approximate finite-temperature base and decode |
44
- | `rectified` | Straight source-to-one-hot probability-path regression | Integrate the learned probability-vector field |
45
- | `redi` | Train a Gat teacher, retain source/endpoints, train a new student | Generate from the recoupled student's rates |
46
- | `mog-dfm` | Train a Gat backbone | Rank/direction rate reweighting and an adaptive acute hypercone |
47
- | `areuredi` | Gat teacher followed by ReDi student training | Student generation, then annealed locally balanced MH refinement |
48
-
49
- ```bash
50
- python examples/dirichlet.py
51
- python examples/fisher.py --guidance 0.1
52
- python examples/gumbel.py
53
- python examples/rectified.py
54
- python examples/redi.py --teacher-steps 300 --pairs 256
55
- python examples/mog_dfm.py --preference 0.7 0.3 --strength 1
56
- python examples/areuredi.py --preference 0.5 0.5 --refine-steps 100
57
- ```
58
-
59
- All objectives in `common.objectives` are maximized: GC fraction and agreement with a repeating ATAT motif. They deliberately conflict. `--guidance` adds the differentiable toy GC objective to a simplex field; it is not a learned biological classifier.
60
-
61
- ## Numerical and theorem boundaries
62
-
63
- - **Gat:** the linear schedule uses `t=n/steps`, so the singular rate at `t=1` is never evaluated. Its Euler update is valid at each position because `h <= 1-t`. Parallel token updates have finite-step joint approximation error.
64
- - **Dirichlet:** concentration increment ranges from 0 to 8. The Beta-CDF concentration derivative is evaluated with a centered finite difference. A finite concentration endpoint is not a vertex distribution; the final output uses argmax.
65
- - **Fisher:** the metric has the factor four under the square-root map. Spherical tangency does not ensure positive coordinates under a finite neural Euler step. The sampler records negative-coordinate corrections before projection and normalization.
66
- - **Gumbel:** the slide construction fixes the full perturbed logits and cools temperature. Defaults are `beta=1`, `tau_max=4`, decay 4. A finite starting temperature does not remove endpoint dependence exactly; the sampler's data-independent noise base is an approximation. The finite noisy endpoint need not select the training letter. The code does not claim exact endpoint matching. `numerical_examples.py` shows why noise scale and temperature play different roles.
67
- - **Continuous rectification:** this example trains one rectified field. The convex-cost theorem concerns the exact conditional-mean field and preserved marginals; a finite learned projected solver is approximate.
68
- - **ReDi:** the code performs one teacher-recoupling round and stores `teacher_pairs.pt`. It does not assume that recoupling automatically decreases conditional total correlation. The lecture states the extra projection-compatibility condition needed for the data-processing argument.
69
- - **MOG-DFM:** candidate ranks are normalized within each position. The code evaluates all positions before a parallel Euler step, rather than using the paper's random-position loop. The cone adapts within 10 to 89 degrees and does not use an outside-cone fallback, so the acute-cone local progress condition is retained. The reported guarantee is local weighted progress, not improvement in every property or global Pareto optimality.
70
- - **AReUReDi:** the MH demonstration uses an explicitly evaluable, smoothed position-wise reference fit to the DNA training data. A denoiser alone is not treated as a joint density. The full forward/reverse proposal and reference ratios remain in acceptance. Finite annealing is not a proof of equilibrium concentration or global optimization.
71
-
72
- The simplex solver reports how often a proposed update needed a nonnegativity correction. Increase `--sample-steps` when studying discretization; projection itself modifies the numerical dynamics.
73
-
74
- ## Numerical checks and slide mapping
75
-
76
- The tests verify the exact master equation on all 16 two-base states, Fisher midpoint/tangency, Gumbel's path derivative with a fixed noise realization, and MH detailed balance on the complete two-base state space. `SLIDE_CODE_MAP.md` links all Lecture 5 code units to the matching functions. `verified_examples/` contains actual seeded CPU training and generation results for every method.
77
-
78
- ## Sources
79
-
80
- - [Gat et al. - Discrete Flow Matching](https://arxiv.org/abs/2407.15595)
81
- - [Dirichlet Flow Matching](https://arxiv.org/abs/2402.05841)
82
- - [Fisher Flow Matching](https://arxiv.org/abs/2405.14664)
83
- - [Gumbel-Softmax Flow Matching](https://arxiv.org/abs/2503.17361)
84
- - [Rectified Flow](https://arxiv.org/abs/2209.03003)
85
- - [ReDi](https://arxiv.org/abs/2507.15897)
86
- - [MOG-DFM](https://arxiv.org/abs/2505.07086)
87
- - [AReUReDi](https://arxiv.org/abs/2510.00352)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/SLIDE_CODE_MAP.md DELETED
@@ -1,24 +0,0 @@
1
- # Code walkthrough map
2
-
3
- Function names are stable even if the combined deck is later split or reordered. Each method has a full training and sampling command in the README.
4
-
5
- | Slide unit | Code | Location |
6
- | --- | --- | --- |
7
- | [Code for classic DFM training pairs](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u155_s9) | `gat_loss` | `lecture_core.py` |
8
- | [Code for convert a posterior into Gat jump rates](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u156_s4) | `gat_rates` | `lecture_core.py` |
9
- | [Code for one valid categorical Euler step](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u157_s7) | `rate_step` | `lecture_core.py` |
10
- | [Code for classic DFM generation](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u158_s12) | `gat_sample` | `lecture_core.py` |
11
- | [Code for Dirichlet posterior training](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u159_s7) | `dirichlet_loss` | `lecture_core.py` |
12
- | [Code for the Dirichlet velocity module](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u160_s9) | `dirichlet_velocity` | `lecture_core.py` |
13
- | [Code for a Fisher conditional path](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u161_s9) | `fisher_path` | `lecture_core.py` |
14
- | [Code for Fisher velocity regression](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u162_s9) | `fisher_loss` | `lecture_core.py` |
15
- | [Code for the Gumbel conditional path](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u163_s9) | `gumbel_path` | `lecture_core.py` |
16
- | [Code for Gumbel velocity regression](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u164_s7) | `gumbel_loss` | `lecture_core.py` |
17
- | [Code for objective scores modify the base rates](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u165_s12) | `mog_rates` | `lecture_core.py` |
18
- | [Code for continuous rectified-flow training](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u166_s8) | `rectified_loss` | `lecture_core.py` |
19
- | [Code for ReDi replaces the endpoint pairing](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u167_s6) | `redi_pairs` | `lecture_core.py` |
20
- | [Code for the preference scalarization](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u168_s3) | `maxmin` | `lecture_core.py` |
21
- | [Code for enumerate every single-base DNA edit](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u169_s3) | `dna_neighbors` | `lecture_core.py` |
22
- | [Code for a normalized locally balanced proposal](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u170_s6) | `proposal` | `lecture_core.py` |
23
- | [Code for correct the refinement proposal](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u171_s12) | `mh_refine` | `lecture_core.py` |
24
- | [Code for run a complete Gat DFM experiment](https://docs.google.com/presentation/d/1qcPdF4SYTq4VdTN_5w9GjviLRPr2HFtbuYMpbfLrc_M/edit#slide=id.cis4r2_u181_s5) | `complete experiment` | `lecture_core.py` and `run.py` |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/common.py DELETED
@@ -1,134 +0,0 @@
1
- """CPU teaching utilities shared by the two lecture folders."""
2
- import csv
3
- import json
4
- import random
5
- from pathlib import Path
6
- import numpy as np
7
- import torch
8
- from torch import nn
9
- from lecture_core import DNA, K, MASK, encode
10
-
11
-
12
- def seed_all(seed):
13
- random.seed(seed)
14
- np.random.seed(seed)
15
- torch.manual_seed(seed)
16
- torch.set_num_threads(1)
17
-
18
-
19
- def decode(tokens):
20
- alphabet = 'ACGTm'
21
- return [''.join(alphabet[int(i)] for i in row) for row in tokens]
22
-
23
-
24
- def make_data(count=512, length=8, seed=7):
25
- """Four synthetic motif families, with independent 8% base mutations."""
26
- rng = np.random.default_rng(seed)
27
- motifs = ['ACGT', 'CGTA', 'TATA', 'GCGC']
28
- strings, labels = [], []
29
- for _ in range(count):
30
- motif = motifs[int(rng.integers(4))]
31
- seq = list((motif * ((length + 3) // 4))[:length])
32
- for j in range(length):
33
- if rng.random() < .08:
34
- seq[j] = 'ACGT'[int(rng.integers(4))]
35
- strings.append(''.join(seq))
36
- labels.append(int(sum(x in 'GC' for x in seq) / length >= .6))
37
- return encode(strings), torch.tensor(labels)
38
-
39
-
40
- def load_data(path, length):
41
- if path is None:
42
- return make_data(length=length)
43
- with open(path) as f:
44
- rows = list(csv.DictReader(f, delimiter='\t'))
45
- strings = [r['sequence'].strip().upper() for r in rows]
46
- if not strings or any(len(s) != length or set(s) - set('ACGT') for s in strings):
47
- raise ValueError('All DNA sequences must contain only A/C/G/T and have --length bases.')
48
- labels = [int(r.get('label', sum(c in 'GC' for c in s) / length >= .6))
49
- for r, s in zip(rows, strings)]
50
- if set(labels) - {0, 1}:
51
- raise ValueError('Labels must be 0 or 1.')
52
- return encode(strings), torch.tensor(labels)
53
-
54
-
55
- class ConditionalDNA(DNA):
56
- """The slide network plus a label embedding; label 2 means unconditional."""
57
- def __init__(self, width=32, max_len=64):
58
- super().__init__(width, max_len)
59
- self.condition = nn.Embedding(3, width)
60
-
61
- def forward(self, z, t=None, label=None):
62
- h = self.token(z) if z.ndim == 2 else self.soft(z)
63
- pos = torch.arange(z.shape[1], device=z.device)
64
- h = h + self.position(pos)[None]
65
- if t is not None:
66
- h = h + self.time(t[:, None])[:, None]
67
- if label is None:
68
- label = torch.full((len(z),), 2, dtype=torch.long, device=z.device)
69
- h = h + self.condition(label)[:, None]
70
- return self.output(self.context(h))
71
-
72
-
73
- def objectives(tokens):
74
- """Both toy objectives are maximized: GC fraction and ATAT agreement."""
75
- onehot = torch.nn.functional.one_hot(tokens.long(), 4).float()
76
- return soft_objectives(onehot)
77
-
78
-
79
- def soft_objectives(z):
80
- gc = (z[..., 1] + z[..., 2]).mean(-1)
81
- motif = torch.tensor([0, 3], device=z.device).repeat((z.shape[1] + 1) // 2)[:z.shape[1]]
82
- match = z.gather(-1, motif[None, :, None].expand(z.shape[0], -1, 1)).squeeze(-1).mean(-1)
83
- return torch.stack((gc, match), -1)
84
-
85
-
86
- def metrics(tokens):
87
- strings = decode(tokens)
88
- score = objectives(tokens).mean(0)
89
- return dict(valid_dna=all(set(s) <= set('ACGT') for s in strings),
90
- unique_fraction=len(set(strings)) / len(strings),
91
- mean_gc=float(score[0]), mean_atat_match=float(score[1]))
92
-
93
-
94
- def save_run(out, config, losses, samples, extra=None):
95
- out = Path(out)
96
- out.mkdir(parents=True, exist_ok=True)
97
- (out / ('sample_config.json' if config.get('mode') == 'sample' else 'config.json')).write_text(json.dumps(config, indent=2))
98
- if losses or not (out / 'losses.json').exists():
99
- (out / 'losses.json').write_text(json.dumps(losses, indent=2))
100
- (out / 'samples.txt').write_text('\n'.join(decode(samples)) + '\n')
101
- report = {'metrics': metrics(samples), **(extra or {})}
102
- (out / 'report.json').write_text(json.dumps(report, indent=2))
103
- print(json.dumps({'output': str(out), **report}, indent=2))
104
- return report
105
-
106
-
107
- def optimize(model, loss_fn, data, steps, batch_size=32, lr=.002):
108
- optimizer = torch.optim.AdamW(model.parameters(), lr=lr)
109
- losses = []
110
- model.train()
111
- for step in range(steps):
112
- idx = torch.randint(len(data), (batch_size,))
113
- optimizer.zero_grad(set_to_none=True)
114
- loss = loss_fn(model, data[idx], idx)
115
- if not torch.isfinite(loss):
116
- raise FloatingPointError(f'Nonfinite loss at step {step}')
117
- loss.backward()
118
- torch.nn.utils.clip_grad_norm_(model.parameters(), 1.)
119
- optimizer.step()
120
- losses.append(float(loss.detach()))
121
- model.eval()
122
- return losses
123
-
124
-
125
- def project_simplex(z, eps=1e-6):
126
- """Euclidean simplex projection, followed by a small interior floor."""
127
- sorted_z = z.sort(-1, descending=True).values
128
- cssv = sorted_z.cumsum(-1) - 1.
129
- k = torch.arange(1, z.shape[-1] + 1, dtype=z.dtype, device=z.device)
130
- active = sorted_z - cssv / k > 0
131
- rho = active.sum(-1, keepdim=True).clamp_min(1)
132
- theta = cssv.gather(-1, rho - 1) / rho
133
- result = (z - theta).clamp_min(eps)
134
- return result / result.sum(-1, keepdim=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/data/README.md DELETED
@@ -1 +0,0 @@
1
- Synthetic teaching DNA only. Each eight-base sequence begins as two copies of ACGT, CGTA, TATA, or GCGC, then each base is replaced independently with probability 0.08. Seed 7. Label 1 means GC fraction >= 0.6. These labels are not measured biological activity. The CLI also generates length-adjusted data when --data is omitted.
 
 
lecture_5/data/dna_train.tsv DELETED
@@ -1,257 +0,0 @@
1
- sequence label
2
- TAAACTTA 0
3
- ACGCTCCC 1
4
- CGTACGTA 0
5
- ACGTACGT 0
6
- CGTACGTA 0
7
- ACGTAAGT 0
8
- TATAAATA 0
9
- ACGTACGT 0
10
- GCGCGCGC 1
11
- GCGCGCGC 1
12
- TATATACA 0
13
- ACGTACGT 0
14
- ACGTACGT 0
15
- ACGCGCGC 1
16
- TCTATATA 0
17
- GCGCGCGC 1
18
- CGTACGTA 0
19
- ACGTACGT 0
20
- CGTACGTA 0
21
- GAGCGCGC 1
22
- TATATATA 0
23
- ACGTACGT 0
24
- GCGCGCGC 1
25
- ACGTACGT 0
26
- GCGCACGC 1
27
- CGTACGTA 0
28
- GGTACGTA 0
29
- CTTACGTA 0
30
- ACGTACGT 0
31
- AATATATA 0
32
- CGTACGTA 0
33
- TATATATA 0
34
- GCGCGCGC 1
35
- GCGCGCGC 1
36
- GCGCTCGC 1
37
- TCTATCTA 0
38
- GCGCGCGC 1
39
- CAAATATA 0
40
- TCGCGCGC 1
41
- ACGTACGT 0
42
- AAGTACGT 0
43
- GCGCGCGC 1
44
- CGCGCTTA 1
45
- TACATATA 0
46
- TATATATA 0
47
- CGTACGTA 0
48
- ACGTACGT 0
49
- GCGTGCGC 1
50
- ACGTACCT 0
51
- ACATACAT 0
52
- ATGGACGT 0
53
- GCGCGCGC 1
54
- TATAAATA 0
55
- CGTACGTA 0
56
- ATTTACGA 0
57
- CGTACGTA 0
58
- GCACGCGC 1
59
- GCGCGCGC 1
60
- TTTATATA 0
61
- ACGTACGT 0
62
- GCGCGCGT 1
63
- GCGCGCGC 1
64
- TATATATA 0
65
- CTTACGTA 0
66
- CGTACGTA 0
67
- GCGCGCGC 1
68
- CGTACGTA 0
69
- TGTTCGTA 0
70
- ACGTACCT 0
71
- ACGTACGC 1
72
- GCGCGCGC 1
73
- CTTATGTA 0
74
- CGTGCGTG 1
75
- ACGTACGT 0
76
- GCGCCCAC 1
77
- CGTACGTC 1
78
- TATATATA 0
79
- GGGCGCGC 1
80
- TATATATA 0
81
- TCGCGCGC 1
82
- ACGTACGT 0
83
- TATATCTA 0
84
- GCGCGCGC 1
85
- TATATATC 0
86
- GCACGCGC 1
87
- ACGTACGT 0
88
- CGTACGTA 0
89
- TATATATA 0
90
- CGTACGTA 0
91
- GGGCGCGC 1
92
- TAGATATA 0
93
- CGTACATA 0
94
- ACGTACGT 0
95
- TAGAGATA 0
96
- ACGTACGT 0
97
- ACGTACGT 0
98
- TATATATA 0
99
- ACTTACGT 0
100
- CGTACCTA 0
101
- CGTACGTA 0
102
- GCGCGCGC 1
103
- GCTCGCGC 1
104
- GGGCGCCC 1
105
- TATATATA 0
106
- ACGTACGT 0
107
- ACGTACGT 0
108
- GCGCCCGC 1
109
- TATATATA 0
110
- ACGTACGT 0
111
- TATAGATA 0
112
- TATATATT 0
113
- CAGACGTA 0
114
- CGTACGTA 0
115
- CGTAGGTA 0
116
- GCACGACC 1
117
- CGTACGAA 0
118
- GTGCGCGC 1
119
- CGTACGTA 0
120
- TATATATA 0
121
- CGTACGTA 0
122
- GCACGCGC 1
123
- ACATACGA 0
124
- CGTAGGTA 0
125
- ACGTACAT 0
126
- TATATATA 0
127
- GATATATA 0
128
- ACGTACGT 0
129
- TCTAGATA 0
130
- CGTACGTA 0
131
- CGTACGTA 0
132
- TATATATA 0
133
- GCGCGCGC 1
134
- ACGTACGT 0
135
- TATATATA 0
136
- CGTACGTA 0
137
- ACGTACGT 0
138
- ACGTTCGT 0
139
- TATATATA 0
140
- GCGCGCGC 1
141
- ACGTACGT 0
142
- TATATATA 0
143
- ACGCACGT 1
144
- ACGTGCGT 1
145
- CGTACGTA 0
146
- GTGCGCGC 1
147
- GCGCGCGC 1
148
- CGTACGTA 0
149
- GCGCGCGC 1
150
- TATATATA 0
151
- GCGCGCGC 1
152
- CGTACGTA 0
153
- CGTACGTA 0
154
- ACGTACGT 0
155
- GCGCGCGC 1
156
- CGTACGTA 0
157
- GCGCGGGA 1
158
- TATATATA 0
159
- ACGTACGT 0
160
- ACGTACGT 0
161
- GCGCGCGT 1
162
- ACTTACGT 0
163
- CGTACGTA 0
164
- ACGTACGT 0
165
- TAAATAAA 0
166
- GCGTGCGC 1
167
- GCGCGCAC 1
168
- ACGTACGT 0
169
- TATATATA 0
170
- TAAATATA 0
171
- CGTACGTA 0
172
- ACGTACGT 0
173
- TGTACATA 0
174
- CGTACGGA 1
175
- CGTCCGTA 1
176
- GCGCGCGC 1
177
- ACGTACGT 0
178
- TATATATA 0
179
- CGTACGTA 0
180
- TGTACGTA 0
181
- ACGTACGT 0
182
- ACGTACGT 0
183
- GCGTATGT 0
184
- ACGTACGT 0
185
- CGGAAGTC 1
186
- TATATATA 0
187
- TATATATA 0
188
- CGTGCGTA 1
189
- GCGCGCGC 1
190
- CGTACGTA 0
191
- ACGTACGT 0
192
- ACGTACGT 0
193
- GCGCGCGC 1
194
- ACGTACGT 0
195
- ACGTACGT 0
196
- ACGTACGT 0
197
- CGTACGTA 0
198
- GCGCGCGC 1
199
- ACGTAGGT 0
200
- TATATATA 0
201
- ACATACGT 0
202
- CCGTACGT 1
203
- AAGTACGT 0
204
- CGTACGTA 0
205
- GCACGCGC 1
206
- TACATATA 0
207
- TATATATA 0
208
- GCGCGCGC 1
209
- ACGTACGT 0
210
- GCGTACGT 1
211
- TATATATA 0
212
- TATATATA 0
213
- GCGCGCGC 1
214
- CGTGCTTA 0
215
- ACGTACGT 0
216
- TATATATA 0
217
- CGTACGTA 0
218
- TATATATA 0
219
- GTGCGCGC 1
220
- CGTACGTA 0
221
- GCGTACGT 1
222
- GCGCGCGC 1
223
- TATATATA 0
224
- TATATGTA 0
225
- TATATATA 0
226
- CATACTAA 0
227
- ACGAACGT 0
228
- CGTACGTA 0
229
- GCGAGCGC 1
230
- TATATATA 0
231
- ACGAACCT 0
232
- GCGCGCGC 1
233
- CGTCCGTG 1
234
- GCGCGAGC 1
235
- CGTACCTA 0
236
- CGTACGTA 0
237
- GCGCGCGC 1
238
- TATATATA 0
239
- ACGTACGT 0
240
- ACGTAGGT 0
241
- GGTACGTA 0
242
- CGTACGTA 0
243
- GCGCGCGA 1
244
- CGTACGTA 0
245
- CGTACGGA 1
246
- ACGTACGT 0
247
- GCGCGCGC 1
248
- GCGCGCGC 1
249
- TATATATA 0
250
- ACGTACGT 0
251
- GCGCGCGC 1
252
- ACGTACGT 0
253
- ATGGACGT 0
254
- CGTAAGTA 0
255
- TATATATA 0
256
- TATATATA 0
257
- TATATATA 0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/examples/areuredi.py DELETED
@@ -1,7 +0,0 @@
1
- """Complete areuredi training and generation example."""
2
- import sys
3
- from pathlib import Path
4
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
5
- from run import main
6
- if __name__ == '__main__':
7
- main(['--method', 'areuredi', '--out', 'outputs/areuredi'] + sys.argv[1:])
 
 
 
 
 
 
 
 
lecture_5/examples/dirichlet.py DELETED
@@ -1,7 +0,0 @@
1
- """Complete dirichlet training and generation example."""
2
- import sys
3
- from pathlib import Path
4
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
5
- from run import main
6
- if __name__ == '__main__':
7
- main(['--method', 'dirichlet', '--out', 'outputs/dirichlet'] + sys.argv[1:])
 
 
 
 
 
 
 
 
lecture_5/examples/fisher.py DELETED
@@ -1,7 +0,0 @@
1
- """Complete fisher training and generation example."""
2
- import sys
3
- from pathlib import Path
4
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
5
- from run import main
6
- if __name__ == '__main__':
7
- main(['--method', 'fisher', '--out', 'outputs/fisher'] + sys.argv[1:])
 
 
 
 
 
 
 
 
lecture_5/examples/gat.py DELETED
@@ -1,7 +0,0 @@
1
- """Complete gat training and generation example."""
2
- import sys
3
- from pathlib import Path
4
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
5
- from run import main
6
- if __name__ == '__main__':
7
- main(['--method', 'gat', '--out', 'outputs/gat'] + sys.argv[1:])
 
 
 
 
 
 
 
 
lecture_5/examples/gumbel.py DELETED
@@ -1,7 +0,0 @@
1
- """Complete gumbel training and generation example."""
2
- import sys
3
- from pathlib import Path
4
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
5
- from run import main
6
- if __name__ == '__main__':
7
- main(['--method', 'gumbel', '--out', 'outputs/gumbel'] + sys.argv[1:])
 
 
 
 
 
 
 
 
lecture_5/examples/mog_dfm.py DELETED
@@ -1,7 +0,0 @@
1
- """Complete mog-dfm training and generation example."""
2
- import sys
3
- from pathlib import Path
4
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
5
- from run import main
6
- if __name__ == '__main__':
7
- main(['--method', 'mog-dfm', '--out', 'outputs/mog-dfm'] + sys.argv[1:])
 
 
 
 
 
 
 
 
lecture_5/examples/rectified.py DELETED
@@ -1,7 +0,0 @@
1
- """Complete rectified training and generation example."""
2
- import sys
3
- from pathlib import Path
4
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
5
- from run import main
6
- if __name__ == '__main__':
7
- main(['--method', 'rectified', '--out', 'outputs/rectified'] + sys.argv[1:])
 
 
 
 
 
 
 
 
lecture_5/examples/redi.py DELETED
@@ -1,7 +0,0 @@
1
- """Complete redi training and generation example."""
2
- import sys
3
- from pathlib import Path
4
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
5
- from run import main
6
- if __name__ == '__main__':
7
- main(['--method', 'redi', '--out', 'outputs/redi'] + sys.argv[1:])
 
 
 
 
 
 
 
 
lecture_5/flows.py DELETED
@@ -1,188 +0,0 @@
1
- """Full teaching samplers for simplex, rectification, and guided jump flows."""
2
- import math
3
- import numpy as np
4
- import torch
5
- import torch.nn.functional as F
6
- from lecture_core import (K, draw, gat_rates, rate_step, gat_sample,
7
- dirichlet_velocity, dna_neighbors, mh_refine)
8
- from common import project_simplex, objectives, soft_objectives, decode
9
-
10
-
11
- @torch.no_grad()
12
- def simplex_sample(model, method, batch, length, steps=100, a_max=8.,
13
- beta=1., tau_max=4., guidance=0.):
14
- """Finite Euler discretization with explicit simplex/orthant projection.
15
-
16
- Projection is a numerical safeguard, not the exact continuous dynamics.
17
- Gumbel has an approximate finite-temperature base and endpoint.
18
- """
19
- base = torch.distributions.Dirichlet(torch.ones(K))
20
- z = base.sample((batch, length))
21
- corrections = 0
22
- if method == 'gumbel':
23
- uniform = torch.rand(batch, length, K).clamp(1e-6, 1-1e-6)
24
- g = -(-uniform.log()).log()
25
- z = (g / (beta * tau_max)).softmax(-1)
26
- y = z.sqrt() if method == 'fisher' else z
27
- end = a_max if method == 'dirichlet' else 1.
28
- dt = end / steps
29
- for i in range(steps):
30
- time = i * dt
31
- t = torch.full((batch,), time)
32
- if method == 'dirichlet':
33
- posterior = model(y, t).softmax(-1)
34
- velocity = dirichlet_velocity(y, posterior, time)
35
- elif method == 'fisher':
36
- raw = model(y, t)
37
- velocity = raw - y * (raw * y).sum(-1, keepdim=True)
38
- else:
39
- raw = model(y, t)
40
- velocity = raw - raw.mean(-1, keepdim=True)
41
- if guidance:
42
- # A differentiable toy objective on probabilities, not a trained
43
- # biochemical predictor. Choose a direction toward higher GC.
44
- with torch.enable_grad():
45
- state = y.detach().requires_grad_(True)
46
- probability = state.square() if method == 'fisher' else state
47
- score = soft_objectives(probability)[:, 0].sum()
48
- gradient = torch.autograd.grad(score, state)[0]
49
- if method == 'fisher':
50
- gradient -= y * (gradient * y).sum(-1, keepdim=True)
51
- else:
52
- gradient -= gradient.mean(-1, keepdim=True)
53
- velocity += guidance * gradient
54
- candidate = y + dt * velocity
55
- if not torch.isfinite(candidate).all():
56
- raise FloatingPointError('Nonfinite simplex integration state.')
57
- corrections += int((candidate < 0).any(-1).sum())
58
- if method == 'fisher':
59
- candidate = candidate.clamp_min(1e-6)
60
- y = candidate / candidate.norm(dim=-1, keepdim=True)
61
- else:
62
- y = project_simplex(candidate)
63
- prob = y.square() if method == 'fisher' else y
64
- result = prob.argmax(-1)
65
- return result, {'negative_coordinate_corrections': corrections,
66
- 'max_probability_sum_error': float((prob.sum(-1)-1).abs().max()),
67
- 'finite_endpoint': True, 'decode': 'argmax'}
68
-
69
-
70
- def rectified_training_loss(model, clean):
71
- source = torch.distributions.Dirichlet(torch.ones(K)).sample(clean.shape)
72
- target = F.one_hot(clean, K).float()
73
- t = torch.rand(len(clean))
74
- z = (1-t[:, None, None])*source + t[:, None, None]*target
75
- raw = model(z, t)
76
- prediction = raw - raw.mean(-1, keepdim=True)
77
- return (prediction-(target-source)).square().sum(-1).mean()
78
-
79
-
80
- @torch.no_grad()
81
- def make_teacher_pairs(teacher, count, length, steps=60, chunk=64):
82
- sources, targets = [], []
83
- for start in range(0, count, chunk):
84
- batch = min(chunk, count-start)
85
- source = torch.randint(K, (batch, length))
86
- target = gat_sample(teacher, batch, length, steps, source=source)
87
- sources.append(source); targets.append(target)
88
- return torch.cat(sources), torch.cat(targets)
89
-
90
-
91
- def mog_multiplier(changes, preference, strength=1., angle=math.pi/3):
92
- """Rank/direction score and acute-cone test; all objectives maximize."""
93
- from scipy.stats import rankdata
94
- ranks = rankdata(changes, axis=0, method='average') / len(changes)
95
- rank_score = ranks.mean(1)
96
- norm = np.linalg.norm(changes, axis=1)
97
- cosine = (changes @ preference) / np.maximum(norm*np.linalg.norm(preference), 1e-12)
98
- direction = changes @ preference
99
- # Formula matches the lecture: z-standardized rank and direction terms.
100
- def standardize(x):
101
- return (x-x.mean()) / max(float(x.std()), 1e-12)
102
- score = standardize(rank_score) + standardize(direction)
103
- keep = (norm > 0) & (cosine >= np.cos(angle))
104
- return strength * np.exp(np.clip(score, -20, 20)) * keep
105
-
106
-
107
- @torch.no_grad()
108
- def mog_sample(model, batch, length, steps=50, preference=(.7, .3), strength=1.):
109
- """Evaluate all single-base edits, reweight rates, then use adaptive Euler.
110
-
111
- All-position scoring differs from the paper's random-position loop.
112
- Rank normalization is per position. The adaptive cone stays acute;
113
- no outside-cone fallback is used, so the local theorem remains valid.
114
- """
115
- z = torch.randint(K, (batch, length))
116
- t = 0.
117
- rejected = 0
118
- angle = math.pi/3
119
- ema = .5
120
- count = 0
121
- while t < 1-1e-6:
122
- tb = torch.full((batch,), t)
123
- rates = gat_rates(model(z, tb).softmax(-1), z, tb)
124
- rejected_step = 0
125
- for b in range(batch):
126
- for i in range(length):
127
- candidates, destinations = [], []
128
- for a in range(K):
129
- if a == int(z[b, i]):
130
- continue
131
- y = z[b].clone(); y[i] = a
132
- candidates.append(y); destinations.append(a)
133
- changes = (objectives(torch.stack(candidates)) - objectives(z[b:b+1])).numpy()
134
- multiplier = mog_multiplier(changes, np.array(preference), strength, angle)
135
- rejected_step += int(np.sum(multiplier == 0))
136
- for a, value in zip(destinations, multiplier):
137
- rates[b, i, a] *= float(value)
138
- rejected += rejected_step
139
- rejection = rejected_step / (batch * length * (K-1))
140
- ema = .9 * ema + .1 * rejection
141
- angle = float(np.clip(angle * np.exp(.02 * (ema-.5)),
142
- np.deg2rad(10), np.deg2rad(89)))
143
- max_exit = float(rates.sum(-1).max())
144
- h = min(1./steps, 1-t, .5/max(max_exit, 1e-8))
145
- z = rate_step(z, rates, h)
146
- t += h
147
- count += 1
148
- if count > 50000:
149
- raise RuntimeError('MOG integration failed to advance.')
150
- return z, {'filtered_candidates': rejected, 'adaptive_steps': count,
151
- 'preference': list(preference), 'final_cone_angle_degrees': float(np.rad2deg(angle)),
152
- 'guarantee': 'local weighted progress under the acute-cone assumptions'}
153
-
154
-
155
- def reference_model(data, pseudocount=.5):
156
- """A tractable positive product reference for exact MH ratios."""
157
- counts = F.one_hot(data, K).float().sum(0) + pseudocount
158
- probability = counts / counts.sum(-1, keepdim=True)
159
- def log_probability(sequence):
160
- idx = torch.tensor(['ACGT'.index(c) for c in sequence])
161
- return float(probability.log()[torch.arange(len(idx)), idx].sum())
162
- return probability, log_probability
163
-
164
-
165
- def refine_areuredi(tokens, data, steps=100, preference=(.5,.5), eta_max=8., seed=7):
166
- """ReDi endpoint refinement with normalized proposals and exact MH ratios.
167
-
168
- The reference is explicitly fitted and evaluable; it is not a denoiser
169
- joint density. Annealing is finite, so no global-optimum claim is made.
170
- """
171
- from lecture_core import encode
172
- _, log_ref = reference_model(data)
173
- weight = np.array(preference)
174
- def score(sequence):
175
- values = objectives(encode([sequence]))[0].numpy()
176
- return float(np.min(weight * values))
177
- rng = np.random.default_rng(seed)
178
- strings = decode(tokens)
179
- changes = 0
180
- for step in range(steps):
181
- eta = eta_max * (step+1) / steps
182
- for i, sequence in enumerate(strings):
183
- new = mh_refine(sequence, score, log_ref, eta, rng)
184
- changes += int(new != sequence)
185
- strings[i] = new
186
- return encode(strings), {'accepted_edits': changes, 'eta_final': eta_max,
187
- 'reference': 'smoothed position-wise empirical DNA frequencies',
188
- 'scope': 'finite annealing demonstration, not an equilibrium certificate'}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/lecture_core.py DELETED
@@ -1,203 +0,0 @@
1
- """Small teaching implementations; illustrative data, not paper reproductions."""
2
-
3
- import math
4
-
5
- import numpy as np
6
-
7
- import torch
8
-
9
- from torch import nn
10
-
11
- import torch.nn.functional as F
12
-
13
- from scipy.special import betainc, beta
14
-
15
- from scipy.stats import rankdata
16
-
17
- K, MASK = 4, 4
18
-
19
- ALPHABET = 'ACGT'
20
-
21
- def encode(strings):
22
- return torch.tensor([[ALPHABET.index(c) for c in s]
23
- for s in strings])
24
-
25
- def draw(prob):
26
- shape = prob.shape[:-1]
27
- sample = torch.multinomial(prob.reshape(-1, K), 1)
28
- return sample.reshape(shape)
29
-
30
- class DNA(nn.Module):
31
- def __init__(self, width=32, max_len=64):
32
- super().__init__()
33
- self.token = nn.Embedding(K + 1, width)
34
- self.soft = nn.Linear(K, width)
35
- self.position = nn.Embedding(max_len, width)
36
- self.time = nn.Linear(1, width)
37
- layer = nn.TransformerEncoderLayer(
38
- width, 4, 2 * width, dropout=0., batch_first=True)
39
- self.context = nn.TransformerEncoder(layer, 1)
40
- self.output = nn.Linear(width, K)
41
-
42
- def forward(self, z, t=None):
43
- h = self.token(z) if z.ndim == 2 else self.soft(z)
44
- pos = torch.arange(z.shape[1], device=z.device)
45
- h = h + self.position(pos)[None]
46
- if t is not None:
47
- h = h + self.time(t[:, None])[:, None]
48
- return self.output(self.context(h))
49
-
50
- def token_ce(logits, target):
51
- return F.cross_entropy(logits.transpose(1, 2),
52
- target, reduction='none')
53
-
54
- def train_step(model, optimizer, clean, loss_fn):
55
- model.train()
56
- optimizer.zero_grad()
57
- loss = loss_fn(model, clean)
58
- loss.backward()
59
- optimizer.step()
60
- return loss.item()
61
-
62
- def gat_loss(model, target, source=None):
63
- if source is None:
64
- source = torch.randint(K, target.shape)
65
- t = torch.rand(target.shape[0])
66
- use_target = torch.rand(target.shape) < t[:, None]
67
- z = torch.where(use_target, target, source)
68
- logits = model(z, t)
69
- return token_ce(logits, target).sum(1).mean()
70
-
71
- def gat_rates(prob, z, t):
72
- rates = prob / (1. - t[:, None, None])
73
- return rates.scatter(-1, z[..., None], 0.)
74
-
75
- def rate_step(z, rates, h):
76
- exit_rate = rates.sum(-1)
77
- assert torch.all(h * exit_rate <= 1. + 1e-6)
78
- prob = h * rates
79
- prob.scatter_(-1, z[..., None],
80
- (1. - h * exit_rate)[..., None])
81
- return draw(prob.clamp_min(0.))
82
-
83
- @torch.no_grad()
84
- def gat_sample(model, batch, length, steps=20, source=None):
85
- model.eval()
86
- z = (torch.randint(K, (batch, length))
87
- if source is None else source.clone())
88
- h = 1. / steps
89
- for n in range(steps):
90
- t = torch.full((batch,), n / steps)
91
- prob = model(z, t).softmax(-1)
92
- rates = gat_rates(prob, z, t)
93
- z = rate_step(z, rates, h)
94
- return z
95
-
96
- def dirichlet_loss(model, clean):
97
- a = 8. * torch.rand(clean.shape[0])
98
- target = F.one_hot(clean, K).float()
99
- concentration = 1. + a[:, None, None] * target
100
- z = torch.distributions.Dirichlet(concentration).sample()
101
- return token_ce(model(z, a), clean).sum(1).mean()
102
-
103
- def dirichlet_velocity(z, posterior, a):
104
- r = z.detach().double().numpy().clip(1e-7, 1. - 1e-7)
105
- da = 1e-4
106
- derivative = (betainc(1+a+da, K-1, r)
107
- - betainc(1+a-da, K-1, r)) / (2*da)
108
- density = r**a * (1-r)**(K-2) / beta(1+a, K-1)
109
- c = torch.as_tensor(-derivative / ((1-r)*density),
110
- dtype=z.dtype)
111
- weight = posterior * c
112
- return weight - z * weight.sum(-1, keepdim=True)
113
-
114
- def fisher_path(z0, target, t):
115
- y0, y1 = z0.sqrt(), F.one_hot(target, K).float()
116
- cosine = (y0 * y1).sum(-1, keepdim=True)
117
- w = cosine.clamp(-1+1e-6, 1-1e-6).acos()
118
- s = t[:, None, None]
119
- y = (((1-s)*w).sin()*y0 + (s*w).sin()*y1) / w.sin()
120
- velocity = w * (-((1-s)*w).cos()*y0
121
- + (s*w).cos()*y1) / w.sin()
122
- return y, velocity
123
-
124
- def fisher_loss(model, clean):
125
- base = torch.distributions.Dirichlet(torch.ones(K))
126
- z0 = base.sample(clean.shape)
127
- t = torch.rand(clean.shape[0])
128
- y, target = fisher_path(z0, clean, t)
129
- raw = model(y, t)
130
- tangent = raw - y * (raw * y).sum(-1, keepdim=True)
131
- return 4. * (tangent - target).square().sum(-1).mean()
132
-
133
- def gumbel_path(target, t, beta_noise=1., tau_max=4., decay=4.):
134
- uniform = torch.rand(*target.shape, K).clamp(1e-6, 1-1e-6)
135
- gumbel = -(-uniform.log()).log()
136
- a = F.one_hot(target, K).float() + gumbel / beta_noise
137
- tau = tau_max * (-decay*t[:, None, None]).exp()
138
- z = (a / tau).softmax(-1)
139
- velocity = (decay/tau) * z * (a - (z*a).sum(-1, keepdim=True))
140
- return z, velocity
141
-
142
- def gumbel_loss(model, clean):
143
- t = torch.rand(clean.shape[0])
144
- z, target = gumbel_path(clean, t)
145
- raw = model(z, t)
146
- tangent = raw - raw.mean(-1, keepdim=True)
147
- return (tangent - target).square().sum(-1).mean()
148
-
149
- def mog_rates(base, changes, preference, importance,
150
- strength, angle):
151
- ranks = rankdata(changes, axis=0, method='average')
152
- ranks = ranks / len(changes)
153
- norm = np.linalg.norm(changes, axis=1)
154
- denom = np.maximum(norm*np.linalg.norm(preference), 1e-12)
155
- cosine = (changes @ preference) / denom
156
- direction = changes @ preference
157
- standardize = lambda x: (x-x.mean()) / max(x.std(), 1e-12)
158
- score = (standardize((ranks*importance).mean(1))
159
- + standardize(direction))
160
- keep = (norm > 0) & (cosine >= np.cos(angle))
161
- return base * np.exp(strength*score) * keep
162
-
163
- def rectified_loss(model, source, target):
164
- t = torch.rand(source.shape[0])
165
- z = (1-t[:, None, None])*source + t[:, None, None]*target
166
- conditional_velocity = target - source
167
- raw = model(z, t)
168
- tangent = raw - raw.mean(-1, keepdim=True)
169
- return (tangent-conditional_velocity).square().sum(-1).mean()
170
-
171
- @torch.no_grad()
172
- def redi_pairs(teacher, batch, length, teacher_steps=100):
173
- source = torch.randint(K, (batch, length))
174
- target = gat_sample(teacher, batch, length,
175
- teacher_steps, source=source)
176
- return source, target
177
-
178
- def maxmin(scores, preference):
179
- return np.min(scores * preference, axis=-1)
180
-
181
- def dna_neighbors(sequence):
182
- return [sequence[:i] + b + sequence[i+1:]
183
- for i, old in enumerate(sequence)
184
- for b in ALPHABET if b != old]
185
-
186
- def proposal(sequence, score, eta):
187
- candidates = dna_neighbors(sequence)
188
- log_weight = .5 * eta * np.array([score(y)-score(sequence)
189
- for y in candidates])
190
- weight = np.exp(log_weight - log_weight.max())
191
- return candidates, weight / weight.sum()
192
-
193
- def mh_refine(sequence, score, log_ref, eta, rng):
194
- candidates, forward = proposal(sequence, score, eta)
195
- index = rng.choice(len(candidates), p=forward)
196
- candidate = candidates[index]
197
- reverse_candidates, reverse = proposal(candidate, score, eta)
198
- q_reverse = reverse[reverse_candidates.index(sequence)]
199
- log_ratio = log_ref(candidate) - log_ref(sequence)
200
- log_ratio += eta * (score(candidate)-score(sequence))
201
- log_ratio += np.log(q_reverse) - np.log(forward[index])
202
- accept = np.log(rng.random()) < min(0., log_ratio)
203
- return candidate if accept else sequence
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/numerical_examples.py DELETED
@@ -1,26 +0,0 @@
1
- """Transparent DNA path, rate, geometry, and guidance calculations."""
2
- import math
3
- import torch
4
- from lecture_core import encode, gat_rates, fisher_path, dirichlet_velocity
5
-
6
- print('Alphabet order: A C G T.')
7
- source=encode(['TGCA']);target=encode(['ACGT']);u=torch.tensor([[.1,.7,.2,.9]])
8
- print('Gat sampled t=.25 intermediate:',torch.where(u<.25,target,source).tolist(),'= AGGA')
9
- print('Gat target probability loss:',-math.log(.7*.6*.8*.5))
10
- rates=gat_rates(torch.tensor([[[.1,.6,.2,.1]]]),torch.tensor([[2]]),torch.tensor([.5]))
11
- p=.1*rates;p[...,2]=1-.1*rates.sum(-1)
12
- print('Gat Euler probabilities from G:',p.flatten().tolist())
13
- z=torch.tensor([[[.1,.2,.4,.3]]]);posterior=torch.tensor([[[0.,0.,1.,0.]]])
14
- v=dirichlet_velocity(z,posterior,3.)
15
- print('Dirichlet conditional G velocity:',v.flatten().tolist())
16
- y,v=fisher_path(torch.full((1,1,4),.25),torch.tensor([[2]]),torch.tensor([.5]))
17
- print('Fisher midpoint probabilities:',y.square().flatten().tolist())
18
- print('Fisher spherical velocity:',v.flatten().tolist())
19
- a=torch.tensor([0.,math.log(2),math.log(4),0.]);z=a.softmax(-1)
20
- print('Gumbel realized softmax at tau=1:',z.tolist())
21
- print('Same noisy logits at tau=.5:',(2*a).softmax(-1).tolist())
22
- print('Temperature derivative -1 velocity:',(z*(a-(z*a).sum())).tolist())
23
- for beta in [1.,4.,8.]:
24
- print('DNA endpoint winner probability, beta=',beta,':',math.exp(beta)/(math.exp(beta)+3))
25
- print('ReDi independent matching-pair TC:',math.log(4),'nats; deterministic informative coupling TC: 0')
26
- print('Preference (.8,.2), change (.3,-.1): weighted gain .22 despite second-objective loss')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/requirements.txt DELETED
@@ -1,3 +0,0 @@
1
- torch>=2.2
2
- numpy>=1.24
3
- scipy>=1.10
 
 
 
 
lecture_5/run.py DELETED
@@ -1,115 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Train and generate DNA with classic DFM before the simplex extensions."""
3
- import argparse
4
- from pathlib import Path
5
- import torch
6
- from lecture_core import (DNA, gat_loss, gat_sample, dirichlet_loss,
7
- fisher_loss, gumbel_loss)
8
- from common import seed_all, load_data, optimize, save_run
9
- from flows import (simplex_sample, rectified_training_loss, make_teacher_pairs,
10
- mog_sample, refine_areuredi)
11
-
12
- METHODS = ['gat', 'dirichlet', 'fisher', 'gumbel', 'rectified',
13
- 'redi', 'mog-dfm', 'areuredi']
14
-
15
-
16
- def main(argv=None):
17
- parser = argparse.ArgumentParser(description=__doc__)
18
- parser.add_argument('--method', choices=METHODS, default='gat')
19
- parser.add_argument('--mode', choices=['train-sample', 'train', 'sample'], default='train-sample')
20
- parser.add_argument('--train-steps', type=int, default=300)
21
- parser.add_argument('--teacher-steps', type=int, default=300)
22
- parser.add_argument('--sample-steps', type=int, default=100)
23
- parser.add_argument('--refine-steps', type=int, default=100)
24
- parser.add_argument('--pairs', type=int, default=256)
25
- parser.add_argument('--batch-size', type=int, default=32)
26
- parser.add_argument('--samples', type=int, default=32)
27
- parser.add_argument('--length', type=int, default=8)
28
- parser.add_argument('--width', type=int, default=32)
29
- parser.add_argument('--guidance', type=float, default=0., help='Toy GC objective for simplex samplers')
30
- parser.add_argument('--strength', type=float, default=1., help='MOG rate multiplier beta')
31
- parser.add_argument('--preference', type=float, nargs=2, default=[.7, .3])
32
- parser.add_argument('--seed', type=int, default=7)
33
- parser.add_argument('--data', help='TSV with DNA sequence column')
34
- parser.add_argument('--out', default='outputs/gat')
35
- args = parser.parse_args(argv)
36
- if min(args.length, args.sample_steps, args.samples, args.batch_size, args.pairs) < 1:
37
- parser.error('Lengths and sample/batch counts must be positive.')
38
- if args.width % 4 or args.length > 64:
39
- parser.error('Width must be divisible by four; length must be at most 64.')
40
- if min(args.preference) <= 0 or args.strength <= 0:
41
- parser.error('Preference weights and MOG strength must be positive.')
42
- if args.mode != 'sample' and min(args.train_steps, args.teacher_steps) < 1:
43
- parser.error('Training step counts must be positive.')
44
- preference = [p / sum(args.preference) for p in args.preference]
45
- seed_all(args.seed)
46
- out = Path(args.out); out.mkdir(parents=True, exist_ok=True)
47
- data, labels = load_data(args.data, args.length)
48
- split = max(1, int(.8 * len(data)))
49
- train = data[:split]
50
- model = DNA(args.width)
51
- losses = []
52
- report = {'method': args.method, 'data': 'synthetic DNA; not biological validation'}
53
- loss_fns = {'gat': gat_loss, 'dirichlet': dirichlet_loss,
54
- 'fisher': fisher_loss, 'gumbel': gumbel_loss,
55
- 'rectified': rectified_training_loss, 'mog-dfm': gat_loss}
56
- if args.mode == 'sample':
57
- checkpoint = torch.load(out / 'checkpoint.pt', weights_only=True)
58
- if checkpoint['method'] != args.method or checkpoint['length'] != args.length:
59
- raise ValueError('Checkpoint method/length must match command arguments.')
60
- model.load_state_dict(checkpoint['model'])
61
- if 'reference_data' in checkpoint:
62
- train = checkpoint['reference_data']
63
- else:
64
- if args.method in ['redi', 'areuredi']:
65
- teacher = DNA(args.width)
66
- teacher_losses = optimize(teacher, lambda m,x,i: gat_loss(m,x),
67
- train, args.teacher_steps, args.batch_size)
68
- source, target = make_teacher_pairs(teacher, args.pairs, args.length,
69
- min(args.sample_steps, 100))
70
- torch.save({'source': source, 'target': target}, out / 'teacher_pairs.pt')
71
- losses = optimize(model, lambda m,x,i: gat_loss(m,x,source[i]),
72
- target, args.train_steps, args.batch_size)
73
- report['teacher_loss_last_20_mean'] = sum(teacher_losses[-20:]) / len(teacher_losses[-20:])
74
- report['paired_examples'] = args.pairs
75
- report['redi_scope'] = 'one teacher-recoupling round; no guaranteed TC reduction'
76
- else:
77
- loss_fn = loss_fns[args.method]
78
- losses = optimize(model, lambda m,x,i: loss_fn(m,x), train,
79
- args.train_steps, args.batch_size)
80
- checkpoint = {'model': model.state_dict(), 'method': args.method,
81
- 'length': args.length, 'width': args.width}
82
- if args.method == 'areuredi':
83
- checkpoint['reference_data'] = train
84
- torch.save(checkpoint, out / 'checkpoint.pt')
85
- report['train_loss_first_20_mean'] = sum(losses[:20]) / len(losses[:20])
86
- report['train_loss_last_20_mean'] = sum(losses[-20:]) / len(losses[-20:])
87
- if args.method in loss_fns and len(data[split:]):
88
- with torch.no_grad():
89
- report['validation_loss_one_mc_draw'] = float(loss_fns[args.method](model, data[split:]))
90
- if args.mode == 'train':
91
- return save_run(out, vars(args), losses, train[:args.samples],
92
- {**report, 'sample_file_contains': 'training examples; generation not requested'})
93
- model.eval()
94
- if args.method in ['dirichlet', 'fisher', 'gumbel', 'rectified']:
95
- samples, extra = simplex_sample(model, args.method, args.samples,
96
- args.length, args.sample_steps, guidance=args.guidance)
97
- report.update(extra)
98
- if args.method == 'gumbel':
99
- report['gumbel_scope'] = ('beta=1, tau_max=4, decay=4; finite noisy endpoint '
100
- 'and approximate data-independent base; no exact data endpoint claim')
101
- elif args.method == 'mog-dfm':
102
- samples, extra = mog_sample(model, args.samples, args.length,
103
- args.sample_steps, preference, args.strength)
104
- report.update(extra)
105
- else:
106
- samples = gat_sample(model, args.samples, args.length, args.sample_steps)
107
- if args.method == 'areuredi':
108
- samples, extra = refine_areuredi(samples, train, args.refine_steps,
109
- preference, seed=args.seed)
110
- report.update(extra)
111
- return save_run(out, vars(args), losses, samples, report)
112
-
113
-
114
- if __name__ == '__main__':
115
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/run_all.py DELETED
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Run every complete training example; pass --quick for a small CPU check."""
3
- import argparse
4
- from run import main
5
- parser = argparse.ArgumentParser()
6
- parser.add_argument('--quick', action='store_true')
7
- args = parser.parse_args()
8
- methods = ['gat', 'dirichlet', 'fisher', 'gumbel', 'rectified', 'redi', 'mog-dfm', 'areuredi']
9
- for method in methods:
10
- command = ['--method', method, '--out', 'outputs/' + method]
11
- if args.quick:
12
- command += ['--train-steps', '20', '--samples', '4', '--length', '4',
13
- '--batch-size', '8', '--sample-steps', '20']
14
- command += ['--teacher-steps', '20', '--pairs', '32', '--refine-steps', '12']
15
- main(command)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/tests/test_mathematics.py DELETED
@@ -1,66 +0,0 @@
1
- import itertools
2
- import unittest
3
- import sys
4
- from pathlib import Path
5
- sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
6
- import numpy as np
7
- import torch
8
- from lecture_core import fisher_path, gumbel_path, proposal
9
- from flows import reference_model
10
-
11
-
12
- class Mathematics(unittest.TestCase):
13
- def test_gat_posterior_average_matches_full_master_equation(self):
14
- states = list(itertools.product(range(4), repeat=2))
15
- targets = [(a,a) for a in range(4)]
16
- def marginal(t):
17
- p=np.zeros(16); numerator=np.zeros((16,16))
18
- for a in states:
19
- for b in targets:
20
- for xi,x in enumerate(states):
21
- probability=np.prod([(1-t)*(x[j]==a[j])+t*(x[j]==b[j]) for j in range(2)])/64
22
- p[xi]+=probability
23
- for j in range(2):
24
- if x[j]!=b[j]:
25
- y=list(x);y[j]=b[j];yi=states.index(tuple(y))
26
- numerator[xi,yi]+=probability/(1-t)
27
- rates=numerator/p[:,None]
28
- np.fill_diagonal(rates,-rates.sum(1))
29
- return p,rates
30
- t=.4;h=1e-5
31
- p,r=marginal(t)
32
- derivative=(marginal(t+h)[0]-marginal(t-h)[0])/(2*h)
33
- np.testing.assert_allclose(p@r,derivative,atol=1e-9)
34
-
35
- def test_fisher_midpoint_and_tangent(self):
36
- y,v=fisher_path(torch.full((1,1,4),.25),torch.tensor([[2]]),torch.tensor([.5]))
37
- torch.testing.assert_close(y.square(),torch.tensor([[[1/12,1/12,3/4,1/12]]]))
38
- self.assertLess(float((y*v).sum(-1).abs().max()),1e-6)
39
-
40
- def test_gumbel_velocity_keeps_the_realized_noise(self):
41
- target=torch.tensor([[0,1,2,3]])
42
- def path(t):
43
- torch.manual_seed(12)
44
- return gumbel_path(target,torch.tensor([t]))
45
- z,v=path(.3);h=1e-3
46
- numeric=(path(.3+h)[0]-path(.3-h)[0])/(2*h)
47
- torch.testing.assert_close(v,numeric,atol=2e-4,rtol=2e-3)
48
- self.assertLess(float(v.sum(-1).abs().max()),1e-6)
49
-
50
- def test_mh_detailed_balance_on_all_two_base_sequences(self):
51
- states=[''.join(x) for x in itertools.product('ACGT',repeat=2)]
52
- score=lambda s:(s.count('G')+.5*s.count('C'))/2
53
- weight=np.array([np.exp(3*score(s)) for s in states]);pi=weight/weight.sum()
54
- matrix=np.zeros((16,16))
55
- for i,x in enumerate(states):
56
- neighbors,q=proposal(x,score,3.)
57
- for y,forward in zip(neighbors,q):
58
- j=states.index(y);back,reverse=proposal(y,score,3.)
59
- accept=min(1,pi[j]*reverse[back.index(x)]/(pi[i]*forward))
60
- matrix[i,j]=forward*accept
61
- matrix[i,i]=1-matrix[i].sum()
62
- np.testing.assert_allclose(pi[:,None]*matrix,pi[None,:]*matrix.T,atol=1e-14)
63
- np.testing.assert_allclose(pi@matrix,pi,atol=1e-14)
64
-
65
-
66
- if __name__ == '__main__': unittest.main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/README.md DELETED
@@ -1,16 +0,0 @@
1
- # Verified CPU examples
2
-
3
- Actual seed-7 runs: 160 optimizer steps, length 4, batch size 16, 40 sampling steps, and 8 requested samples. ReDi/AReUReDi additionally use 160 teacher updates and 128 recoupled pairs. PepTune returns its archive, whose size can differ from the requested sample count.
4
-
5
- | Method | Mean first 20 losses | Mean last 20 losses | Valid DNA |
6
- | --- | ---: | ---: | --- |
7
- | gat | 4.2671 | 2.6596 | True |
8
- | dirichlet | 5.1298 | 1.7297 | True |
9
- | fisher | 3.8173 | 2.2441 | True |
10
- | gumbel | 0.8744 | 0.3556 | True |
11
- | rectified | 0.8557 | 0.4507 | True |
12
- | redi | 3.9590 | 2.1978 | True |
13
- | mog-dfm | 4.2671 | 2.6596 | True |
14
- | areuredi | 3.9590 | 2.1978 | True |
15
-
16
- These are execution and learning checks on toy data, not paper benchmark results. Different method losses have different meanings and scales. The sample counts are too small for statistical quality claims.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/areuredi/config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "method": "areuredi",
3
- "mode": "train-sample",
4
- "train_steps": 160,
5
- "teacher_steps": 160,
6
- "sample_steps": 40,
7
- "refine_steps": 40,
8
- "pairs": 128,
9
- "batch_size": 16,
10
- "samples": 8,
11
- "length": 4,
12
- "width": 32,
13
- "guidance": 0.0,
14
- "strength": 1.0,
15
- "preference": [
16
- 0.7,
17
- 0.3
18
- ],
19
- "seed": 7,
20
- "data": null,
21
- "out": "outputs/areuredi"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/areuredi/losses.json DELETED
@@ -1,162 +0,0 @@
1
- [
2
- 5.578631401062012,
3
- 5.215188026428223,
4
- 4.979227542877197,
5
- 4.527420997619629,
6
- 4.682675838470459,
7
- 4.541810989379883,
8
- 4.201014041900635,
9
- 4.809026718139648,
10
- 3.5231478214263916,
11
- 3.2159132957458496,
12
- 3.903719902038574,
13
- 3.392885684967041,
14
- 3.4545810222625732,
15
- 3.26749324798584,
16
- 3.8055408000946045,
17
- 3.170132637023926,
18
- 3.293631076812744,
19
- 2.7804863452911377,
20
- 2.633892059326172,
21
- 4.202793598175049,
22
- 2.587411642074585,
23
- 2.8439173698425293,
24
- 2.620241165161133,
25
- 2.5747973918914795,
26
- 2.8458690643310547,
27
- 2.6336047649383545,
28
- 2.693552255630493,
29
- 2.5792150497436523,
30
- 3.147822618484497,
31
- 2.2284865379333496,
32
- 3.2001423835754395,
33
- 2.6833009719848633,
34
- 2.679579734802246,
35
- 2.5627329349517822,
36
- 2.251354932785034,
37
- 3.9288926124572754,
38
- 2.149650812149048,
39
- 3.063689708709717,
40
- 2.279712677001953,
41
- 4.056086540222168,
42
- 2.963582754135132,
43
- 2.6804754734039307,
44
- 1.967834234237671,
45
- 2.4215853214263916,
46
- 2.9922292232513428,
47
- 2.785958766937256,
48
- 3.5931544303894043,
49
- 2.694758892059326,
50
- 2.2316219806671143,
51
- 2.0388429164886475,
52
- 2.147338390350342,
53
- 2.3730430603027344,
54
- 1.6726641654968262,
55
- 2.4648900032043457,
56
- 1.438779592514038,
57
- 2.2980430126190186,
58
- 2.843613862991333,
59
- 1.9195117950439453,
60
- 2.389061450958252,
61
- 3.2739145755767822,
62
- 2.0545103549957275,
63
- 1.9256659746170044,
64
- 3.3023366928100586,
65
- 2.801600694656372,
66
- 2.824629545211792,
67
- 2.492016315460205,
68
- 2.8223798274993896,
69
- 1.6702975034713745,
70
- 2.814354419708252,
71
- 2.0587551593780518,
72
- 2.781656265258789,
73
- 1.737116813659668,
74
- 1.610327124595642,
75
- 2.4434523582458496,
76
- 2.191859006881714,
77
- 3.4145593643188477,
78
- 3.0424160957336426,
79
- 2.804013252258301,
80
- 2.3747494220733643,
81
- 2.493913173675537,
82
- 1.9928159713745117,
83
- 2.0292046070098877,
84
- 2.24965500831604,
85
- 3.6124138832092285,
86
- 2.4276280403137207,
87
- 1.9320605993270874,
88
- 2.759394645690918,
89
- 1.8870341777801514,
90
- 3.647275447845459,
91
- 1.537461519241333,
92
- 2.9912829399108887,
93
- 1.6703108549118042,
94
- 2.2091546058654785,
95
- 1.9724771976470947,
96
- 1.7340176105499268,
97
- 1.7092127799987793,
98
- 2.3674867153167725,
99
- 2.40274715423584,
100
- 2.2620091438293457,
101
- 1.8866041898727417,
102
- 3.7603864669799805,
103
- 2.1125717163085938,
104
- 2.674081325531006,
105
- 1.9604092836380005,
106
- 1.7161355018615723,
107
- 2.0131330490112305,
108
- 2.309553384780884,
109
- 2.6360435485839844,
110
- 2.5695250034332275,
111
- 2.009622812271118,
112
- 1.8004002571105957,
113
- 1.3521816730499268,
114
- 1.6246684789657593,
115
- 1.3006975650787354,
116
- 2.041378974914551,
117
- 2.0425312519073486,
118
- 2.045912027359009,
119
- 3.1553938388824463,
120
- 2.1102423667907715,
121
- 1.0823614597320557,
122
- 3.032719612121582,
123
- 1.9022471904754639,
124
- 2.118574857711792,
125
- 2.1357498168945312,
126
- 3.15908145904541,
127
- 2.7499589920043945,
128
- 3.0981345176696777,
129
- 2.4977638721466064,
130
- 2.40651273727417,
131
- 2.120854616165161,
132
- 1.4740090370178223,
133
- 1.7393325567245483,
134
- 2.018094539642334,
135
- 1.570328712463379,
136
- 2.010258436203003,
137
- 1.5725524425506592,
138
- 2.523509979248047,
139
- 2.2055015563964844,
140
- 1.5145868062973022,
141
- 1.9369760751724243,
142
- 2.6806631088256836,
143
- 2.1069183349609375,
144
- 1.9884653091430664,
145
- 3.1166341304779053,
146
- 2.874910831451416,
147
- 1.8844469785690308,
148
- 1.6240601539611816,
149
- 2.5054893493652344,
150
- 1.6134421825408936,
151
- 2.26651930809021,
152
- 2.565666913986206,
153
- 2.329096555709839,
154
- 1.6169782876968384,
155
- 2.5725347995758057,
156
- 2.094921588897705,
157
- 1.9747111797332764,
158
- 1.7718333005905151,
159
- 2.446991443634033,
160
- 1.5896382331848145,
161
- 2.3323352336883545
162
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/areuredi/report.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "metrics": {
3
- "valid_dna": true,
4
- "unique_fraction": 0.875,
5
- "mean_gc": 0.4375,
6
- "mean_atat_match": 0.21875
7
- },
8
- "method": "areuredi",
9
- "data": "synthetic DNA; not biological validation",
10
- "teacher_loss_last_20_mean": 2.72806202173233,
11
- "paired_examples": 128,
12
- "redi_scope": "one teacher-recoupling round; no guaranteed TC reduction",
13
- "train_loss_first_20_mean": 3.9589606523513794,
14
- "train_loss_last_20_mean": 2.1978128612041474,
15
- "accepted_edits": 181,
16
- "eta_final": 8.0,
17
- "reference": "smoothed position-wise empirical DNA frequencies",
18
- "scope": "finite annealing demonstration, not an equilibrium certificate"
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/areuredi/samples.txt DELETED
@@ -1,8 +0,0 @@
1
- CTTT
2
- GCGC
3
- ACAA
4
- ACGA
5
- GAGC
6
- TGTA
7
- TCTT
8
- TCTT
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/dirichlet/config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "method": "dirichlet",
3
- "mode": "train-sample",
4
- "train_steps": 160,
5
- "teacher_steps": 160,
6
- "sample_steps": 40,
7
- "refine_steps": 40,
8
- "pairs": 128,
9
- "batch_size": 16,
10
- "samples": 8,
11
- "length": 4,
12
- "width": 32,
13
- "guidance": 0.0,
14
- "strength": 1.0,
15
- "preference": [
16
- 0.7,
17
- 0.3
18
- ],
19
- "seed": 7,
20
- "data": null,
21
- "out": "outputs/dirichlet"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/dirichlet/losses.json DELETED
@@ -1,162 +0,0 @@
1
- [
2
- 5.987035274505615,
3
- 5.7057271003723145,
4
- 5.4776153564453125,
5
- 5.435891628265381,
6
- 5.582164287567139,
7
- 5.3017377853393555,
8
- 5.315533638000488,
9
- 5.035096645355225,
10
- 5.051508903503418,
11
- 5.2037739753723145,
12
- 5.109261989593506,
13
- 5.108462810516357,
14
- 4.778862953186035,
15
- 4.777516841888428,
16
- 4.974148750305176,
17
- 4.8705244064331055,
18
- 4.619065761566162,
19
- 4.653285980224609,
20
- 4.839997291564941,
21
- 4.7690043449401855,
22
- 4.481639862060547,
23
- 4.536505699157715,
24
- 4.780343055725098,
25
- 4.4304728507995605,
26
- 4.663294315338135,
27
- 4.257389068603516,
28
- 4.1362128257751465,
29
- 4.409623622894287,
30
- 4.034981727600098,
31
- 4.11863899230957,
32
- 4.146239280700684,
33
- 4.428400993347168,
34
- 3.9758212566375732,
35
- 3.926872491836548,
36
- 3.5168545246124268,
37
- 3.9071707725524902,
38
- 3.735076665878296,
39
- 3.8633854389190674,
40
- 3.630112886428833,
41
- 3.444991111755371,
42
- 3.599454879760742,
43
- 3.0867366790771484,
44
- 3.204212188720703,
45
- 4.141026973724365,
46
- 3.969395637512207,
47
- 3.0596437454223633,
48
- 3.5696041584014893,
49
- 3.088737964630127,
50
- 3.611302137374878,
51
- 3.785858154296875,
52
- 3.3500888347625732,
53
- 2.989191770553589,
54
- 3.21290922164917,
55
- 2.6051502227783203,
56
- 2.8940303325653076,
57
- 2.719219446182251,
58
- 2.355130910873413,
59
- 2.667929172515869,
60
- 2.6372263431549072,
61
- 2.487605571746826,
62
- 2.2540249824523926,
63
- 3.2833821773529053,
64
- 2.2793779373168945,
65
- 2.491062879562378,
66
- 1.6186134815216064,
67
- 1.9055742025375366,
68
- 2.983051300048828,
69
- 2.754556894302368,
70
- 2.1230244636535645,
71
- 2.6531665325164795,
72
- 2.091691732406616,
73
- 2.476653575897217,
74
- 2.002650260925293,
75
- 1.9472030401229858,
76
- 2.250502109527588,
77
- 2.285085439682007,
78
- 1.957679271697998,
79
- 2.7570881843566895,
80
- 1.6728074550628662,
81
- 2.135037422180176,
82
- 1.627407431602478,
83
- 2.2475335597991943,
84
- 3.223327875137329,
85
- 2.079972982406616,
86
- 2.17677903175354,
87
- 1.4659333229064941,
88
- 1.854305624961853,
89
- 2.135460138320923,
90
- 2.5259783267974854,
91
- 2.1924796104431152,
92
- 2.6706223487854004,
93
- 1.7147475481033325,
94
- 1.5733774900436401,
95
- 1.5839917659759521,
96
- 1.8101816177368164,
97
- 1.6969491243362427,
98
- 2.1939094066619873,
99
- 2.2701213359832764,
100
- 1.3590651750564575,
101
- 1.8197208642959595,
102
- 2.5202126502990723,
103
- 1.112671136856079,
104
- 1.6572060585021973,
105
- 1.9186416864395142,
106
- 2.151210308074951,
107
- 2.294743061065674,
108
- 1.6319775581359863,
109
- 2.6904213428497314,
110
- 1.4546334743499756,
111
- 1.5501033067703247,
112
- 1.0871210098266602,
113
- 2.4776058197021484,
114
- 1.789743185043335,
115
- 1.3015778064727783,
116
- 0.7730430364608765,
117
- 1.2221710681915283,
118
- 1.3628941774368286,
119
- 1.5448253154754639,
120
- 1.8459429740905762,
121
- 1.5920908451080322,
122
- 1.8741068840026855,
123
- 1.606163740158081,
124
- 1.0870177745819092,
125
- 1.9514107704162598,
126
- 1.4525673389434814,
127
- 2.047329902648926,
128
- 2.161097288131714,
129
- 1.0058730840682983,
130
- 1.4372437000274658,
131
- 1.685389518737793,
132
- 1.0957973003387451,
133
- 1.4873944520950317,
134
- 0.9507176280021667,
135
- 0.9506893157958984,
136
- 1.4974210262298584,
137
- 1.191109538078308,
138
- 2.463002920150757,
139
- 2.1995906829833984,
140
- 2.0290000438690186,
141
- 2.622788906097412,
142
- 2.003711700439453,
143
- 2.577554941177368,
144
- 2.561497211456299,
145
- 1.0081901550292969,
146
- 1.6362948417663574,
147
- 1.4071522951126099,
148
- 1.8568885326385498,
149
- 1.614437460899353,
150
- 2.286831855773926,
151
- 1.1085795164108276,
152
- 0.9553455114364624,
153
- 1.2254221439361572,
154
- 2.3875327110290527,
155
- 2.3000073432922363,
156
- 1.2774486541748047,
157
- 1.0425993204116821,
158
- 2.0665574073791504,
159
- 1.6575270891189575,
160
- 1.2717294692993164,
161
- 2.348963975906372
162
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/dirichlet/report.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "metrics": {
3
- "valid_dna": true,
4
- "unique_fraction": 0.875,
5
- "mean_gc": 0.3125,
6
- "mean_atat_match": 0.125
7
- },
8
- "method": "dirichlet",
9
- "data": "synthetic DNA; not biological validation",
10
- "train_loss_first_20_mean": 5.129810786247253,
11
- "train_loss_last_20_mean": 1.7297136068344117,
12
- "validation_loss_one_mc_draw": 1.699185848236084,
13
- "negative_coordinate_corrections": 0,
14
- "max_probability_sum_error": 1.1920928955078125e-07,
15
- "finite_endpoint": true,
16
- "decode": "argmax"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/dirichlet/samples.txt DELETED
@@ -1,8 +0,0 @@
1
- ACTT
2
- TATA
3
- ACTC
4
- AGGA
5
- CGTA
6
- CATA
7
- TATA
8
- CCTA
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/environment.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "python": "3.12.14",
3
- "torch": "2.14.0+cpu",
4
- "numpy": "2.3.5",
5
- "scipy": "1.17.0",
6
- "device": "cpu"
7
- }
 
 
 
 
 
 
 
 
lecture_5/verified_examples/fisher/config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "method": "fisher",
3
- "mode": "train-sample",
4
- "train_steps": 160,
5
- "teacher_steps": 160,
6
- "sample_steps": 40,
7
- "refine_steps": 40,
8
- "pairs": 128,
9
- "batch_size": 16,
10
- "samples": 8,
11
- "length": 4,
12
- "width": 32,
13
- "guidance": 0.0,
14
- "strength": 1.0,
15
- "preference": [
16
- 0.7,
17
- 0.3
18
- ],
19
- "seed": 7,
20
- "data": null,
21
- "out": "outputs/fisher"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/fisher/losses.json DELETED
@@ -1,162 +0,0 @@
1
- [
2
- 8.571112632751465,
3
- 7.303001880645752,
4
- 5.1533427238464355,
5
- 4.744162559509277,
6
- 4.073383331298828,
7
- 3.9271888732910156,
8
- 4.31433629989624,
9
- 3.0154306888580322,
10
- 2.3777942657470703,
11
- 3.170802116394043,
12
- 2.6646761894226074,
13
- 2.915005683898926,
14
- 2.8402624130249023,
15
- 3.812424421310425,
16
- 2.3469979763031006,
17
- 2.5703535079956055,
18
- 3.515812635421753,
19
- 2.982490062713623,
20
- 3.0468573570251465,
21
- 3.000063419342041,
22
- 3.406219482421875,
23
- 3.3296115398406982,
24
- 3.011011838912964,
25
- 2.480292797088623,
26
- 2.9582724571228027,
27
- 3.1977603435516357,
28
- 3.128955602645874,
29
- 2.2359578609466553,
30
- 2.5828840732574463,
31
- 3.4687106609344482,
32
- 2.096220016479492,
33
- 2.69463849067688,
34
- 3.3743786811828613,
35
- 2.262096881866455,
36
- 2.928584098815918,
37
- 2.6014180183410645,
38
- 2.602999448776245,
39
- 2.8589024543762207,
40
- 3.174992084503174,
41
- 2.7553186416625977,
42
- 2.3450777530670166,
43
- 2.7961537837982178,
44
- 3.3228542804718018,
45
- 2.9487850666046143,
46
- 2.7978155612945557,
47
- 3.455988883972168,
48
- 2.2441558837890625,
49
- 2.8949103355407715,
50
- 2.880878448486328,
51
- 2.186849594116211,
52
- 2.235743522644043,
53
- 1.8804774284362793,
54
- 3.455813407897949,
55
- 2.0829925537109375,
56
- 2.082059144973755,
57
- 2.530484914779663,
58
- 2.7628636360168457,
59
- 2.6144649982452393,
60
- 2.476773262023926,
61
- 2.4828391075134277,
62
- 2.4270236492156982,
63
- 2.7848620414733887,
64
- 3.1417713165283203,
65
- 2.309669256210327,
66
- 2.755452871322632,
67
- 3.49771785736084,
68
- 2.934539318084717,
69
- 2.7419092655181885,
70
- 2.101997137069702,
71
- 2.705397844314575,
72
- 2.4323384761810303,
73
- 2.167492389678955,
74
- 2.7036519050598145,
75
- 2.2807931900024414,
76
- 2.9349067211151123,
77
- 2.5758087635040283,
78
- 2.4565770626068115,
79
- 3.107597827911377,
80
- 2.366063356399536,
81
- 2.8201122283935547,
82
- 2.8875114917755127,
83
- 2.0656650066375732,
84
- 3.2820560932159424,
85
- 2.921267509460449,
86
- 3.381413698196411,
87
- 2.3997411727905273,
88
- 2.3265788555145264,
89
- 2.066448450088501,
90
- 3.3638381958007812,
91
- 1.8956438302993774,
92
- 2.981762409210205,
93
- 3.0908000469207764,
94
- 2.0562901496887207,
95
- 3.068679094314575,
96
- 2.1612884998321533,
97
- 2.5689961910247803,
98
- 2.6655631065368652,
99
- 2.81134295463562,
100
- 3.134366512298584,
101
- 2.2510604858398438,
102
- 3.04536509513855,
103
- 2.682065963745117,
104
- 2.325636386871338,
105
- 2.155775308609009,
106
- 2.218646764755249,
107
- 2.392900228500366,
108
- 3.41904878616333,
109
- 2.6010544300079346,
110
- 2.3730106353759766,
111
- 2.9705750942230225,
112
- 2.698889970779419,
113
- 2.8097193241119385,
114
- 2.1913466453552246,
115
- 2.81672739982605,
116
- 2.9725401401519775,
117
- 2.805398464202881,
118
- 2.403073787689209,
119
- 2.6580448150634766,
120
- 2.9282894134521484,
121
- 2.842071771621704,
122
- 2.3050999641418457,
123
- 2.810702323913574,
124
- 2.1849422454833984,
125
- 2.2562265396118164,
126
- 3.07672119140625,
127
- 2.0688652992248535,
128
- 2.294011116027832,
129
- 3.3593554496765137,
130
- 2.9014484882354736,
131
- 2.057595729827881,
132
- 2.7754175662994385,
133
- 3.2037341594696045,
134
- 2.950990676879883,
135
- 2.6158878803253174,
136
- 2.0368189811706543,
137
- 2.10182785987854,
138
- 2.1909384727478027,
139
- 2.7789814472198486,
140
- 2.8794353008270264,
141
- 2.876467227935791,
142
- 1.9936639070510864,
143
- 3.069582939147949,
144
- 2.346599817276001,
145
- 1.8762702941894531,
146
- 1.5599921941757202,
147
- 1.7584424018859863,
148
- 2.0794010162353516,
149
- 2.459878444671631,
150
- 3.011709213256836,
151
- 2.4862372875213623,
152
- 2.082012176513672,
153
- 2.2711989879608154,
154
- 2.4660708904266357,
155
- 2.0117135047912598,
156
- 2.49086332321167,
157
- 2.6844394207000732,
158
- 1.8233208656311035,
159
- 2.498573064804077,
160
- 2.1096994876861572,
161
- 1.8029230833053589
162
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/fisher/report.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "metrics": {
3
- "valid_dna": true,
4
- "unique_fraction": 0.875,
5
- "mean_gc": 0.78125,
6
- "mean_atat_match": 0.15625
7
- },
8
- "method": "fisher",
9
- "data": "synthetic DNA; not biological validation",
10
- "train_loss_first_20_mean": 3.8172749519348144,
11
- "train_loss_last_20_mean": 2.24412961602211,
12
- "validation_loss_one_mc_draw": 2.5719263553619385,
13
- "negative_coordinate_corrections": 283,
14
- "max_probability_sum_error": 2.384185791015625e-07,
15
- "finite_endpoint": true,
16
- "decode": "argmax"
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/fisher/samples.txt DELETED
@@ -1,8 +0,0 @@
1
- ACGA
2
- CCGC
3
- CCGC
4
- GCGA
5
- ACGC
6
- CCGT
7
- GCGC
8
- ACGT
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/gat/config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "method": "gat",
3
- "mode": "train-sample",
4
- "train_steps": 160,
5
- "teacher_steps": 160,
6
- "sample_steps": 40,
7
- "refine_steps": 40,
8
- "pairs": 128,
9
- "batch_size": 16,
10
- "samples": 8,
11
- "length": 4,
12
- "width": 32,
13
- "guidance": 0.0,
14
- "strength": 1.0,
15
- "preference": [
16
- 0.7,
17
- 0.3
18
- ],
19
- "seed": 7,
20
- "data": null,
21
- "out": "outputs/gat"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/gat/losses.json DELETED
@@ -1,162 +0,0 @@
1
- [
2
- 5.555057525634766,
3
- 5.890437602996826,
4
- 4.9087815284729,
5
- 4.1881232261657715,
6
- 4.83707857131958,
7
- 4.51339054107666,
8
- 4.665221214294434,
9
- 4.274393558502197,
10
- 4.344203948974609,
11
- 4.0454254150390625,
12
- 4.4479660987854,
13
- 4.175173759460449,
14
- 3.908479690551758,
15
- 4.424745559692383,
16
- 3.710341215133667,
17
- 3.0476884841918945,
18
- 3.789707899093628,
19
- 3.167095184326172,
20
- 4.319497108459473,
21
- 3.128598213195801,
22
- 3.988326072692871,
23
- 3.800382614135742,
24
- 2.937274932861328,
25
- 3.5654163360595703,
26
- 3.1350417137145996,
27
- 3.3353466987609863,
28
- 3.536527156829834,
29
- 3.8737754821777344,
30
- 3.6239640712738037,
31
- 3.4370455741882324,
32
- 3.745927095413208,
33
- 3.221271276473999,
34
- 2.7261011600494385,
35
- 3.674633026123047,
36
- 3.3985674381256104,
37
- 3.094015121459961,
38
- 3.678131103515625,
39
- 2.2317159175872803,
40
- 2.205465793609619,
41
- 2.597670078277588,
42
- 2.588956832885742,
43
- 2.7397661209106445,
44
- 2.59556245803833,
45
- 2.917344331741333,
46
- 2.5570318698883057,
47
- 2.386134147644043,
48
- 3.1508893966674805,
49
- 2.4510059356689453,
50
- 4.685295104980469,
51
- 2.9762532711029053,
52
- 2.8647146224975586,
53
- 1.7768700122833252,
54
- 2.915055274963379,
55
- 3.9934372901916504,
56
- 2.89289927482605,
57
- 3.744565010070801,
58
- 2.373737335205078,
59
- 3.3278493881225586,
60
- 2.8167989253997803,
61
- 2.7180516719818115,
62
- 3.4837515354156494,
63
- 3.799549102783203,
64
- 3.4675912857055664,
65
- 2.3154969215393066,
66
- 4.505186080932617,
67
- 1.955189824104309,
68
- 2.515925407409668,
69
- 2.2730512619018555,
70
- 2.814613103866577,
71
- 1.8026926517486572,
72
- 3.208705186843872,
73
- 3.4525582790374756,
74
- 3.1925339698791504,
75
- 2.355441093444824,
76
- 4.377381324768066,
77
- 2.403754711151123,
78
- 3.8744754791259766,
79
- 2.23490047454834,
80
- 2.883716106414795,
81
- 3.6779189109802246,
82
- 2.032773494720459,
83
- 2.265133857727051,
84
- 3.280043601989746,
85
- 2.532355308532715,
86
- 2.523271083831787,
87
- 2.462573766708374,
88
- 3.8266568183898926,
89
- 2.1587255001068115,
90
- 2.038233757019043,
91
- 3.216428279876709,
92
- 3.1186740398406982,
93
- 2.5141170024871826,
94
- 3.333552837371826,
95
- 3.366112232208252,
96
- 3.6347179412841797,
97
- 2.3267645835876465,
98
- 4.024384498596191,
99
- 3.129969358444214,
100
- 3.784872055053711,
101
- 2.7616593837738037,
102
- 3.108980417251587,
103
- 3.7265422344207764,
104
- 2.9501824378967285,
105
- 2.2087435722351074,
106
- 4.133711338043213,
107
- 3.426473617553711,
108
- 3.052323579788208,
109
- 3.112914562225342,
110
- 3.7782933712005615,
111
- 4.0156474113464355,
112
- 2.726518392562866,
113
- 3.0648770332336426,
114
- 3.1597461700439453,
115
- 2.0522677898406982,
116
- 4.124749660491943,
117
- 2.3789560794830322,
118
- 2.617194890975952,
119
- 3.1719017028808594,
120
- 3.822108745574951,
121
- 3.3801960945129395,
122
- 3.1706669330596924,
123
- 2.4255475997924805,
124
- 2.65407395362854,
125
- 3.5186941623687744,
126
- 3.1759512424468994,
127
- 3.3725812435150146,
128
- 3.144639492034912,
129
- 2.2421658039093018,
130
- 4.015059947967529,
131
- 2.498589277267456,
132
- 2.3411831855773926,
133
- 2.8789939880371094,
134
- 2.6798653602600098,
135
- 2.2761776447296143,
136
- 2.7247633934020996,
137
- 2.2538399696350098,
138
- 2.367486000061035,
139
- 3.8682806491851807,
140
- 3.0465571880340576,
141
- 2.8480899333953857,
142
- 2.8016717433929443,
143
- 2.4772744178771973,
144
- 2.2610678672790527,
145
- 3.1808559894561768,
146
- 2.6285760402679443,
147
- 2.3866126537323,
148
- 3.704378604888916,
149
- 1.7231093645095825,
150
- 2.2585153579711914,
151
- 2.0817971229553223,
152
- 2.890470266342163,
153
- 2.369269371032715,
154
- 3.0134172439575195,
155
- 2.607996702194214,
156
- 3.0741591453552246,
157
- 2.1917362213134766,
158
- 3.8198983669281006,
159
- 2.6407318115234375,
160
- 2.5884804725646973,
161
- 2.4910426139831543
162
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/gat/report.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "metrics": {
3
- "valid_dna": true,
4
- "unique_fraction": 0.75,
5
- "mean_gc": 0.375,
6
- "mean_atat_match": 0.125
7
- },
8
- "method": "gat",
9
- "data": "synthetic DNA; not biological validation",
10
- "train_loss_first_20_mean": 4.267070317268372,
11
- "train_loss_last_20_mean": 2.6595530688762663,
12
- "validation_loss_one_mc_draw": 3.0547287464141846
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/gat/samples.txt DELETED
@@ -1,8 +0,0 @@
1
- ACGT
2
- TCTA
3
- CGTA
4
- CGTA
5
- CATA
6
- TATA
7
- ACGT
8
- CCTA
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/gumbel/config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "method": "gumbel",
3
- "mode": "train-sample",
4
- "train_steps": 160,
5
- "teacher_steps": 160,
6
- "sample_steps": 40,
7
- "refine_steps": 40,
8
- "pairs": 128,
9
- "batch_size": 16,
10
- "samples": 8,
11
- "length": 4,
12
- "width": 32,
13
- "guidance": 0.0,
14
- "strength": 1.0,
15
- "preference": [
16
- 0.7,
17
- 0.3
18
- ],
19
- "seed": 7,
20
- "data": null,
21
- "out": "outputs/gumbel"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/gumbel/losses.json DELETED
@@ -1,162 +0,0 @@
1
- [
2
- 1.2242249250411987,
3
- 1.3620853424072266,
4
- 1.0061757564544678,
5
- 1.0545729398727417,
6
- 0.9724909067153931,
7
- 0.5293634533882141,
8
- 0.6660601496696472,
9
- 1.0677317380905151,
10
- 0.878416895866394,
11
- 0.9330573678016663,
12
- 1.0132296085357666,
13
- 0.8705434203147888,
14
- 0.6601288318634033,
15
- 0.6662362813949585,
16
- 0.7980155944824219,
17
- 0.8221703767776489,
18
- 0.6677682995796204,
19
- 0.5565563440322876,
20
- 0.8239631652832031,
21
- 0.915525496006012,
22
- 0.8262391686439514,
23
- 0.9338005185127258,
24
- 0.7041582465171814,
25
- 0.9623083472251892,
26
- 0.7411048412322998,
27
- 0.9122228622436523,
28
- 0.6384052038192749,
29
- 0.7176005244255066,
30
- 0.6149242520332336,
31
- 0.7930399775505066,
32
- 0.9014930725097656,
33
- 0.6472141742706299,
34
- 0.5843918323516846,
35
- 0.5959654450416565,
36
- 0.8754173517227173,
37
- 0.7718366980552673,
38
- 0.5473393797874451,
39
- 0.6955640912055969,
40
- 0.754619836807251,
41
- 0.5733585953712463,
42
- 0.8471091389656067,
43
- 0.7447681427001953,
44
- 0.7545447945594788,
45
- 0.6515666842460632,
46
- 0.7182407379150391,
47
- 0.5480296611785889,
48
- 0.614464521408081,
49
- 0.782268762588501,
50
- 0.6048372387886047,
51
- 0.6472717523574829,
52
- 0.5385202765464783,
53
- 0.6479076147079468,
54
- 0.6813259124755859,
55
- 0.6917023062705994,
56
- 0.4879384934902191,
57
- 0.5533413887023926,
58
- 0.707999050617218,
59
- 0.6003414392471313,
60
- 0.7006964683532715,
61
- 0.5734584331512451,
62
- 0.7012950778007507,
63
- 0.5581093430519104,
64
- 0.4966667890548706,
65
- 0.6264007687568665,
66
- 0.5599461793899536,
67
- 0.5360195636749268,
68
- 0.665524959564209,
69
- 0.6365910172462463,
70
- 0.578106164932251,
71
- 0.5579401254653931,
72
- 0.5634976029396057,
73
- 0.6342311501502991,
74
- 0.5109550952911377,
75
- 0.599521815776825,
76
- 0.6203869581222534,
77
- 0.611301839351654,
78
- 0.5039989352226257,
79
- 0.5459249019622803,
80
- 0.5482620000839233,
81
- 0.5299906730651855,
82
- 0.5089408159255981,
83
- 0.5460392236709595,
84
- 0.41642990708351135,
85
- 0.5682117938995361,
86
- 0.46522098779678345,
87
- 0.6535881757736206,
88
- 0.5205237865447998,
89
- 0.5230173468589783,
90
- 0.5246025919914246,
91
- 0.5621505975723267,
92
- 0.44565266370773315,
93
- 0.584469199180603,
94
- 0.5001013278961182,
95
- 0.553354024887085,
96
- 0.5152371525764465,
97
- 0.44525519013404846,
98
- 0.5020580291748047,
99
- 0.446787029504776,
100
- 0.44008758664131165,
101
- 0.386381596326828,
102
- 0.5054974555969238,
103
- 0.48175373673439026,
104
- 0.3925288915634155,
105
- 0.47026005387306213,
106
- 0.40446269512176514,
107
- 0.5167693495750427,
108
- 0.393154501914978,
109
- 0.4570925235748291,
110
- 0.42173269391059875,
111
- 0.35426291823387146,
112
- 0.4976067841053009,
113
- 0.4924037754535675,
114
- 0.47807833552360535,
115
- 0.4965772330760956,
116
- 0.33257365226745605,
117
- 0.29500123858451843,
118
- 0.40001818537712097,
119
- 0.36628803610801697,
120
- 0.3501744568347931,
121
- 0.24306155741214752,
122
- 0.4280138909816742,
123
- 0.33857619762420654,
124
- 0.4133177101612091,
125
- 0.31040486693382263,
126
- 0.3238377273082733,
127
- 0.37552645802497864,
128
- 0.40614137053489685,
129
- 0.3577098846435547,
130
- 0.3461991846561432,
131
- 0.3121543526649475,
132
- 0.38914811611175537,
133
- 0.42639264464378357,
134
- 0.3369901478290558,
135
- 0.4701955020427704,
136
- 0.36834174394607544,
137
- 0.2963407039642334,
138
- 0.23096537590026855,
139
- 0.3539124131202698,
140
- 0.38701286911964417,
141
- 0.4892623722553253,
142
- 0.3251381516456604,
143
- 0.35162293910980225,
144
- 0.3250449001789093,
145
- 0.34927764534950256,
146
- 0.3196697235107422,
147
- 0.28305667638778687,
148
- 0.4241291880607605,
149
- 0.41060760617256165,
150
- 0.4208475947380066,
151
- 0.4529426693916321,
152
- 0.24722036719322205,
153
- 0.43186840415000916,
154
- 0.34614986181259155,
155
- 0.35659974813461304,
156
- 0.20478856563568115,
157
- 0.3144701421260834,
158
- 0.4556642472743988,
159
- 0.38099414110183716,
160
- 0.31331413984298706,
161
- 0.3990325331687927
162
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/gumbel/report.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "metrics": {
3
- "valid_dna": true,
4
- "unique_fraction": 1.0,
5
- "mean_gc": 0.4375,
6
- "mean_atat_match": 0.3125
7
- },
8
- "method": "gumbel",
9
- "data": "synthetic DNA; not biological validation",
10
- "train_loss_first_20_mean": 0.8744158446788788,
11
- "train_loss_last_20_mean": 0.355621962249279,
12
- "validation_loss_one_mc_draw": 0.3075082004070282,
13
- "negative_coordinate_corrections": 468,
14
- "max_probability_sum_error": 1.1920928955078125e-07,
15
- "finite_endpoint": true,
16
- "decode": "argmax",
17
- "gumbel_scope": "beta=1, tau_max=4, decay=4; finite noisy endpoint and approximate data-independent base; no exact data endpoint claim"
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/gumbel/samples.txt DELETED
@@ -1,8 +0,0 @@
1
- TTAC
2
- CCCC
3
- TTGC
4
- AGCG
5
- CATT
6
- TTAT
7
- GTTG
8
- AAGA
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/mog-dfm/config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "method": "mog-dfm",
3
- "mode": "train-sample",
4
- "train_steps": 160,
5
- "teacher_steps": 160,
6
- "sample_steps": 40,
7
- "refine_steps": 40,
8
- "pairs": 128,
9
- "batch_size": 16,
10
- "samples": 8,
11
- "length": 4,
12
- "width": 32,
13
- "guidance": 0.0,
14
- "strength": 1.0,
15
- "preference": [
16
- 0.7,
17
- 0.3
18
- ],
19
- "seed": 7,
20
- "data": null,
21
- "out": "outputs/mog-dfm"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/mog-dfm/losses.json DELETED
@@ -1,162 +0,0 @@
1
- [
2
- 5.555057525634766,
3
- 5.890437602996826,
4
- 4.9087815284729,
5
- 4.1881232261657715,
6
- 4.83707857131958,
7
- 4.51339054107666,
8
- 4.665221214294434,
9
- 4.274393558502197,
10
- 4.344203948974609,
11
- 4.0454254150390625,
12
- 4.4479660987854,
13
- 4.175173759460449,
14
- 3.908479690551758,
15
- 4.424745559692383,
16
- 3.710341215133667,
17
- 3.0476884841918945,
18
- 3.789707899093628,
19
- 3.167095184326172,
20
- 4.319497108459473,
21
- 3.128598213195801,
22
- 3.988326072692871,
23
- 3.800382614135742,
24
- 2.937274932861328,
25
- 3.5654163360595703,
26
- 3.1350417137145996,
27
- 3.3353466987609863,
28
- 3.536527156829834,
29
- 3.8737754821777344,
30
- 3.6239640712738037,
31
- 3.4370455741882324,
32
- 3.745927095413208,
33
- 3.221271276473999,
34
- 2.7261011600494385,
35
- 3.674633026123047,
36
- 3.3985674381256104,
37
- 3.094015121459961,
38
- 3.678131103515625,
39
- 2.2317159175872803,
40
- 2.205465793609619,
41
- 2.597670078277588,
42
- 2.588956832885742,
43
- 2.7397661209106445,
44
- 2.59556245803833,
45
- 2.917344331741333,
46
- 2.5570318698883057,
47
- 2.386134147644043,
48
- 3.1508893966674805,
49
- 2.4510059356689453,
50
- 4.685295104980469,
51
- 2.9762532711029053,
52
- 2.8647146224975586,
53
- 1.7768700122833252,
54
- 2.915055274963379,
55
- 3.9934372901916504,
56
- 2.89289927482605,
57
- 3.744565010070801,
58
- 2.373737335205078,
59
- 3.3278493881225586,
60
- 2.8167989253997803,
61
- 2.7180516719818115,
62
- 3.4837515354156494,
63
- 3.799549102783203,
64
- 3.4675912857055664,
65
- 2.3154969215393066,
66
- 4.505186080932617,
67
- 1.955189824104309,
68
- 2.515925407409668,
69
- 2.2730512619018555,
70
- 2.814613103866577,
71
- 1.8026926517486572,
72
- 3.208705186843872,
73
- 3.4525582790374756,
74
- 3.1925339698791504,
75
- 2.355441093444824,
76
- 4.377381324768066,
77
- 2.403754711151123,
78
- 3.8744754791259766,
79
- 2.23490047454834,
80
- 2.883716106414795,
81
- 3.6779189109802246,
82
- 2.032773494720459,
83
- 2.265133857727051,
84
- 3.280043601989746,
85
- 2.532355308532715,
86
- 2.523271083831787,
87
- 2.462573766708374,
88
- 3.8266568183898926,
89
- 2.1587255001068115,
90
- 2.038233757019043,
91
- 3.216428279876709,
92
- 3.1186740398406982,
93
- 2.5141170024871826,
94
- 3.333552837371826,
95
- 3.366112232208252,
96
- 3.6347179412841797,
97
- 2.3267645835876465,
98
- 4.024384498596191,
99
- 3.129969358444214,
100
- 3.784872055053711,
101
- 2.7616593837738037,
102
- 3.108980417251587,
103
- 3.7265422344207764,
104
- 2.9501824378967285,
105
- 2.2087435722351074,
106
- 4.133711338043213,
107
- 3.426473617553711,
108
- 3.052323579788208,
109
- 3.112914562225342,
110
- 3.7782933712005615,
111
- 4.0156474113464355,
112
- 2.726518392562866,
113
- 3.0648770332336426,
114
- 3.1597461700439453,
115
- 2.0522677898406982,
116
- 4.124749660491943,
117
- 2.3789560794830322,
118
- 2.617194890975952,
119
- 3.1719017028808594,
120
- 3.822108745574951,
121
- 3.3801960945129395,
122
- 3.1706669330596924,
123
- 2.4255475997924805,
124
- 2.65407395362854,
125
- 3.5186941623687744,
126
- 3.1759512424468994,
127
- 3.3725812435150146,
128
- 3.144639492034912,
129
- 2.2421658039093018,
130
- 4.015059947967529,
131
- 2.498589277267456,
132
- 2.3411831855773926,
133
- 2.8789939880371094,
134
- 2.6798653602600098,
135
- 2.2761776447296143,
136
- 2.7247633934020996,
137
- 2.2538399696350098,
138
- 2.367486000061035,
139
- 3.8682806491851807,
140
- 3.0465571880340576,
141
- 2.8480899333953857,
142
- 2.8016717433929443,
143
- 2.4772744178771973,
144
- 2.2610678672790527,
145
- 3.1808559894561768,
146
- 2.6285760402679443,
147
- 2.3866126537323,
148
- 3.704378604888916,
149
- 1.7231093645095825,
150
- 2.2585153579711914,
151
- 2.0817971229553223,
152
- 2.890470266342163,
153
- 2.369269371032715,
154
- 3.0134172439575195,
155
- 2.607996702194214,
156
- 3.0741591453552246,
157
- 2.1917362213134766,
158
- 3.8198983669281006,
159
- 2.6407318115234375,
160
- 2.5884804725646973,
161
- 2.4910426139831543
162
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/mog-dfm/report.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "metrics": {
3
- "valid_dna": true,
4
- "unique_fraction": 0.875,
5
- "mean_gc": 0.8125,
6
- "mean_atat_match": 0.0625
7
- },
8
- "method": "mog-dfm",
9
- "data": "synthetic DNA; not biological validation",
10
- "train_loss_first_20_mean": 4.267070317268372,
11
- "train_loss_last_20_mean": 2.6595530688762663,
12
- "validation_loss_one_mc_draw": 3.0547287464141846,
13
- "filtered_candidates": 3210,
14
- "adaptive_steps": 42,
15
- "preference": [
16
- 0.7,
17
- 0.3
18
- ],
19
- "final_cone_angle_degrees": 73.28139809162991,
20
- "guarantee": "local weighted progress under the acute-cone assumptions"
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/mog-dfm/samples.txt DELETED
@@ -1,8 +0,0 @@
1
- ACGG
2
- GCGC
3
- CGCT
4
- CCTC
5
- GGGG
6
- CATA
7
- GCGC
8
- CGGG
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/rectified/config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "method": "rectified",
3
- "mode": "train-sample",
4
- "train_steps": 160,
5
- "teacher_steps": 160,
6
- "sample_steps": 40,
7
- "refine_steps": 40,
8
- "pairs": 128,
9
- "batch_size": 16,
10
- "samples": 8,
11
- "length": 4,
12
- "width": 32,
13
- "guidance": 0.0,
14
- "strength": 1.0,
15
- "preference": [
16
- 0.7,
17
- 0.3
18
- ],
19
- "seed": 7,
20
- "data": null,
21
- "out": "outputs/rectified"
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/rectified/losses.json DELETED
@@ -1,162 +0,0 @@
1
- [
2
- 1.5004026889801025,
3
- 1.3279709815979004,
4
- 1.020445704460144,
5
- 0.9433400630950928,
6
- 0.8730323910713196,
7
- 0.8370198011398315,
8
- 0.828363299369812,
9
- 0.7445297241210938,
10
- 0.7042967677116394,
11
- 0.7865955829620361,
12
- 0.7114711403846741,
13
- 0.7578641772270203,
14
- 0.7066575884819031,
15
- 0.8381931185722351,
16
- 0.7460746169090271,
17
- 0.7295529842376709,
18
- 0.8562743663787842,
19
- 0.7675602436065674,
20
- 0.6833122968673706,
21
- 0.7502613067626953,
22
- 0.7138526439666748,
23
- 0.7552366256713867,
24
- 0.7716754674911499,
25
- 0.701257586479187,
26
- 0.8012855648994446,
27
- 0.7691758275032043,
28
- 0.7751699090003967,
29
- 0.5887867212295532,
30
- 0.6236982941627502,
31
- 0.7256749868392944,
32
- 0.5828669667243958,
33
- 0.6786181926727295,
34
- 0.7846888303756714,
35
- 0.5736732482910156,
36
- 0.6665273308753967,
37
- 0.644498348236084,
38
- 0.5881228446960449,
39
- 0.6510074138641357,
40
- 0.690257728099823,
41
- 0.6035992503166199,
42
- 0.5631512403488159,
43
- 0.5767524838447571,
44
- 0.6770502328872681,
45
- 0.7123513221740723,
46
- 0.631034791469574,
47
- 0.6635925769805908,
48
- 0.5014064311981201,
49
- 0.6941777467727661,
50
- 0.6142820119857788,
51
- 0.48644065856933594,
52
- 0.4690500497817993,
53
- 0.46637943387031555,
54
- 0.7518098950386047,
55
- 0.49232983589172363,
56
- 0.3956705331802368,
57
- 0.5027762651443481,
58
- 0.587986946105957,
59
- 0.619992733001709,
60
- 0.5430957078933716,
61
- 0.5696991086006165,
62
- 0.501618504524231,
63
- 0.5913504958152771,
64
- 0.5609534382820129,
65
- 0.45804500579833984,
66
- 0.5298258662223816,
67
- 0.6507817506790161,
68
- 0.574570894241333,
69
- 0.5613725781440735,
70
- 0.3827498257160187,
71
- 0.6147360801696777,
72
- 0.5094749927520752,
73
- 0.4917214512825012,
74
- 0.5207288265228271,
75
- 0.4132007956504822,
76
- 0.5481823682785034,
77
- 0.4948666989803314,
78
- 0.4673762321472168,
79
- 0.6916881203651428,
80
- 0.43736565113067627,
81
- 0.4895283281803131,
82
- 0.6169437170028687,
83
- 0.41678938269615173,
84
- 0.6408990621566772,
85
- 0.6173636317253113,
86
- 0.591915488243103,
87
- 0.3778156638145447,
88
- 0.4527539014816284,
89
- 0.3762066066265106,
90
- 0.6339781284332275,
91
- 0.3565376102924347,
92
- 0.5479102730751038,
93
- 0.5159654021263123,
94
- 0.4224727749824524,
95
- 0.5880125164985657,
96
- 0.3577631711959839,
97
- 0.41638559103012085,
98
- 0.5254880785942078,
99
- 0.4846354126930237,
100
- 0.6233035922050476,
101
- 0.34998732805252075,
102
- 0.6874790191650391,
103
- 0.48790356516838074,
104
- 0.4745773673057556,
105
- 0.38737213611602783,
106
- 0.43984824419021606,
107
- 0.4269067347049713,
108
- 0.5833062529563904,
109
- 0.4814833998680115,
110
- 0.42202267050743103,
111
- 0.6122362613677979,
112
- 0.5279317498207092,
113
- 0.47669070959091187,
114
- 0.4828556478023529,
115
- 0.6017410159111023,
116
- 0.5857915878295898,
117
- 0.5456337332725525,
118
- 0.45868223905563354,
119
- 0.4599453806877136,
120
- 0.574993371963501,
121
- 0.4864501357078552,
122
- 0.3898826241493225,
123
- 0.6481937170028687,
124
- 0.39759117364883423,
125
- 0.4148366451263428,
126
- 0.5928701758384705,
127
- 0.37306398153305054,
128
- 0.446571409702301,
129
- 0.6392943263053894,
130
- 0.562612771987915,
131
- 0.4197731912136078,
132
- 0.5282881259918213,
133
- 0.6784601211547852,
134
- 0.5052616000175476,
135
- 0.49076318740844727,
136
- 0.3642507791519165,
137
- 0.42254331707954407,
138
- 0.41095465421676636,
139
- 0.5811480283737183,
140
- 0.5557343363761902,
141
- 0.5879122614860535,
142
- 0.40378907322883606,
143
- 0.649993360042572,
144
- 0.5146540999412537,
145
- 0.39203402400016785,
146
- 0.2682815194129944,
147
- 0.3100827634334564,
148
- 0.3964778184890747,
149
- 0.4988245964050293,
150
- 0.6458528637886047,
151
- 0.46725594997406006,
152
- 0.3653281033039093,
153
- 0.4387623965740204,
154
- 0.44214093685150146,
155
- 0.45757776498794556,
156
- 0.48578232526779175,
157
- 0.5535528659820557,
158
- 0.4033154547214508,
159
- 0.528259813785553,
160
- 0.4303647577762604,
161
- 0.36250683665275574
162
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lecture_5/verified_examples/rectified/report.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "metrics": {
3
- "valid_dna": true,
4
- "unique_fraction": 0.875,
5
- "mean_gc": 0.75,
6
- "mean_atat_match": 0.125
7
- },
8
- "method": "rectified",
9
- "data": "synthetic DNA; not biological validation",
10
- "train_loss_first_20_mean": 0.855660942196846,
11
- "train_loss_last_20_mean": 0.4507418662309647,
12
- "validation_loss_one_mc_draw": 0.4995970129966736,
13
- "negative_coordinate_corrections": 733,
14
- "max_probability_sum_error": 1.1920928955078125e-07,
15
- "finite_endpoint": true,
16
- "decode": "argmax"
17
- }