Model card summary; English only; scripts renamed (speed_check / demo_collapse)
Browse files- README.md +14 -4
- bench_collapse.py → demo_collapse.py +1 -1
README.md
CHANGED
|
@@ -14,7 +14,17 @@ tags:
|
|
| 14 |
|
| 15 |
**Code only — no model weights.**
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
## In plain words
|
| 20 |
|
|
@@ -75,7 +85,7 @@ for step in range(1000):
|
|
| 75 |
tethergate_step([gate], step, lr=1e-3, wd=20.0, ramp_start=200, tau=200.0) # AFTER opt.step()
|
| 76 |
```
|
| 77 |
|
| 78 |
-
`python tethergate.py` runs a minimal demo; `example.py` gates two residual adapters; `
|
| 79 |
|
| 80 |
## Parameters and how to choose them
|
| 81 |
|
|
@@ -111,14 +121,14 @@ for step in range(1000):
|
|
| 111 |
|
| 112 |
```bash
|
| 113 |
python test_tethergate.py # unit tests, CPU, seconds
|
| 114 |
-
python
|
| 115 |
```
|
| 116 |
|
| 117 |
How it works in detail: [TECHNICAL.md](TECHNICAL.md).
|
| 118 |
|
| 119 |
## Files
|
| 120 |
|
| 121 |
-
`tethergate.py` (module and demo) · `test_tethergate.py` · `
|
| 122 |
|
| 123 |
## Licence
|
| 124 |
|
|
|
|
| 14 |
|
| 15 |
**Code only — no model weights.**
|
| 16 |
|
| 17 |
+
## Model card summary
|
| 18 |
+
|
| 19 |
+
| | |
|
| 20 |
+
|---|---|
|
| 21 |
+
| **What this repository is** | A single-file PyTorch module: a learned gate for a network branch that the optimiser cannot push to zero. **No model weights.** |
|
| 22 |
+
| **Developed by** | Jakub Ćwirlej |
|
| 23 |
+
| **Framework / hardware** | Pure PyTorch; CPU and GPU |
|
| 24 |
+
| **Status** | Experimental: used in our own training runs, early observations promising; no published results |
|
| 25 |
+
| **Intended use** | Research on gated branches (adapters, mixture-of-experts style paths, auxiliary modules) whose gates tend to collapse during training |
|
| 26 |
+
| **Out of scope** | Commercial use (licence); drop-in use without checking the parameters on your own model (see Parameters and Pitfalls) |
|
| 27 |
+
| **Licence** | CC BY-NC 4.0 |
|
| 28 |
|
| 29 |
## In plain words
|
| 30 |
|
|
|
|
| 85 |
tethergate_step([gate], step, lr=1e-3, wd=20.0, ramp_start=200, tau=200.0) # AFTER opt.step()
|
| 86 |
```
|
| 87 |
|
| 88 |
+
`python tethergate.py` runs a minimal demo; `example.py` gates two residual adapters; `demo_collapse.py` is a toy test of gate collapse (no gate / free gate / TetherGate, CPU, seconds).
|
| 89 |
|
| 90 |
## Parameters and how to choose them
|
| 91 |
|
|
|
|
| 121 |
|
| 122 |
```bash
|
| 123 |
python test_tethergate.py # unit tests, CPU, seconds
|
| 124 |
+
python demo_collapse.py # toy collapse test
|
| 125 |
```
|
| 126 |
|
| 127 |
How it works in detail: [TECHNICAL.md](TECHNICAL.md).
|
| 128 |
|
| 129 |
## Files
|
| 130 |
|
| 131 |
+
`tethergate.py` (module and demo) · `test_tethergate.py` · `demo_collapse.py` (a toy demonstration of a plain gate collapsing vs TetherGate; not a benchmark) · `example.py` · `TECHNICAL.md` · `LICENSE`
|
| 132 |
|
| 133 |
## Licence
|
| 134 |
|
bench_collapse.py → demo_collapse.py
RENAMED
|
@@ -11,7 +11,7 @@ gate also starves the branch of gradient. Variants:
|
|
| 11 |
tether : TetherGate (floor 1.0 for `ramp_start` steps, then decay; spring towards g_target)
|
| 12 |
s = mean |branch(x)| per token (detached), the same for both gated variants.
|
| 13 |
|
| 14 |
-
python
|
| 15 |
"""
|
| 16 |
import argparse
|
| 17 |
|
|
|
|
| 11 |
tether : TetherGate (floor 1.0 for `ramp_start` steps, then decay; spring towards g_target)
|
| 12 |
s = mean |branch(x)| per token (detached), the same for both gated variants.
|
| 13 |
|
| 14 |
+
python demo_collapse.py [--steps 3000] [--seeds 0 1 2]
|
| 15 |
"""
|
| 16 |
import argparse
|
| 17 |
|