Skip to content

Commit 7289dbb

Browse files
committed
Adds benchmark visuals, governance metadata, and model card
Improves documentation and project transparency by introducing generated benchmark charts and an illustrative circadian dynamics GIF for the README. Establishes ownership and governance metadata, including a model card detailing evaluation metrics and limitations. Supports reproducible results and clearer project governance for users and contributors.
1 parent 6ecfcff commit 7289dbb

10 files changed

Lines changed: 481 additions & 20 deletions

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default owner for all files
2+
* @OptimumAF

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,22 @@ for versioning even while in research-stage development.
2525
- Multi-seed benchmark runner:
2626
- `scripts/run_multiseed_resnet_benchmark.py`
2727
- JSON and CSV export support for reproducible cross-seed comparison.
28+
- README visual generation pipeline:
29+
- `scripts/generate_readme_figures.py`
30+
- generated PNG benchmark charts under `docs/figures/`
31+
- illustrative circadian adaptation GIF (`docs/figures/circadian_sleep_dynamics.gif`)
32+
- Ownership and governance metadata:
33+
- `.github/CODEOWNERS`
34+
- `docs/model-card.md`
35+
- `docs/figures/README.md`
2836

2937
### Changed
3038

3139
- Repositioned repository messaging to Circadian Predictive Coding as the primary focus.
3240
- Updated `README.md` with:
3341
- circadian-first project framing
3442
- reproducible benchmark commands
43+
- badges, mermaid circadian loop diagram, benchmark visuals, and results snapshot tables
3544
- governance and citation references
3645
- Updated `ARCHITECTURE.md` with clearer module boundaries and circadian-centric design intent.
3746
- Updated `CONTRIBUTING.md` with concrete contribution workflow and quality gates.

README.md

Lines changed: 67 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
11
# Circadian Predictive Coding
22

3-
Circadian Predictive Coding is a research-focused repository for biologically inspired neural learning with:
3+
[![CI](https://github.com/OptimumAF/Circadian-Predictive-Coding/actions/workflows/ci.yml/badge.svg)](https://github.com/OptimumAF/Circadian-Predictive-Coding/actions/workflows/ci.yml)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5+
[![Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/downloads/)
6+
[![Latest Release](https://img.shields.io/github/v/release/OptimumAF/Circadian-Predictive-Coding)](https://github.com/OptimumAF/Circadian-Predictive-Coding/releases)
47

5-
- chemical-gated plasticity
6-
- sleep-phase structural adaptation (split/prune)
7-
- direct comparison against traditional backpropagation and traditional predictive coding
8+
Circadian Predictive Coding is a research-first repository focused on biologically inspired learning where models adapt their own structure over wake and sleep cycles.
9+
10+
## Why This Repo
11+
12+
This project is built around one central idea:
13+
14+
- **Circadian Predictive Coding** should be compared rigorously against
15+
- traditional backpropagation
16+
- traditional predictive coding
17+
18+
The baseline models stay in the repo as stable references, while circadian behavior is the primary innovation surface.
19+
20+
## Circadian Loop
821

922
The circadian model is the primary focus of this project. Backprop and predictive coding baselines are kept to ensure fair comparison and reproducible evaluation.
1023

24+
```mermaid
25+
flowchart LR
26+
A[Wake Training] --> B[Chemical Accumulation]
27+
B --> C[Plasticity Gating]
28+
C --> D{Sleep Trigger}
29+
D -- No --> A
30+
D -- Yes --> E[Sleep Consolidation]
31+
E --> F[Split / Prune Adaptation]
32+
F --> G[Replay + Homeostasis]
33+
G --> H[Optional Rollback Guard]
34+
H --> A
35+
```
36+
1137
## Core Idea
1238

1339
The circadian algorithm models wake and sleep phases:
@@ -25,6 +51,36 @@ This lets model capacity adapt over time instead of staying fixed.
2551
- Function-preserving split behavior and guarded sleep rollback
2652
- Multi-seed benchmark runner with JSON/CSV output
2753

54+
## Visual Results
55+
56+
### Multi-seed CIFAR-100 Snapshot (3 seeds, subset benchmark)
57+
58+
![Accuracy Chart](docs/figures/benchmark_accuracy.png)
59+
![Training Speed Chart](docs/figures/benchmark_train_speed.png)
60+
![Inference Latency Chart](docs/figures/benchmark_inference_latency_p95.png)
61+
62+
### Circadian Dynamics (Illustrative)
63+
64+
![Circadian Sleep Dynamics](docs/figures/circadian_sleep_dynamics.gif)
65+
66+
## Results Snapshot
67+
68+
### Multi-seed subset benchmark (`benchmark_multiseed_cifar100_summary.csv`)
69+
70+
| Model | Accuracy Mean | Train SPS Mean | Inference P95 (ms) |
71+
|---|---:|---:|---:|
72+
| BackpropResNet50 | 0.6901 | 1775.3 | 17.34 |
73+
| PredictiveCodingResNet50 | 0.6810 | 1732.1 | 17.74 |
74+
| CircadianPredictiveCodingResNet50 | 0.6715 | 1643.6 | 18.71 |
75+
76+
### Hard full CIFAR-100 run (single-seed, 48 epochs, 2026-02-27)
77+
78+
| Model | Accuracy | Train SPS | Inference SPS | Notes |
79+
|---|---:|---:|---:|---|
80+
| BackpropResNet50 | 0.706 | 1350.7 | 4672.4 | fixed head |
81+
| PredictiveCodingResNet50 | 0.723 | 2093.4 | 4839.0 | fixed head |
82+
| CircadianPredictiveCodingResNet50 | 0.734 | 2059.9 | 4831.4 | hidden 384->394, splits=12, prunes=2, rollbacks=7 |
83+
2884
## Repository Layout
2985

3086
```text
@@ -39,13 +95,12 @@ tests/ # Unit/integration tests
3995
docs/
4096
adr/ # Architecture decision records
4197
modules/ # Module responsibility docs
98+
figures/ # Generated and static figures for documentation
4299
scripts/ # Reproducible benchmark scripts
43100
```
44101

45102
## Quickstart
46103

47-
PowerShell:
48-
49104
```powershell
50105
python -m venv .venv
51106
.\.venv\Scripts\Activate.ps1
@@ -64,21 +119,15 @@ For NVIDIA GPUs (example CUDA wheels):
64119
python -m pip install --upgrade --force-reinstall torch torchvision --index-url https://download.pytorch.org/whl/cu128
65120
```
66121

67-
## Running Experiments
122+
## Main Commands
68123

69-
Toy baseline comparison:
124+
Toy baseline:
70125

71126
```powershell
72127
python predictive_coding_experiment.py
73128
```
74129

75-
In-depth toy comparison (multi-seed, multi-noise):
76-
77-
```powershell
78-
python predictive_coding_experiment.py --mode indepth --samples 400 --epochs 160 --noise-levels 0.6,0.8,1.0 --seed-list 3,7,11,19,23 --sleep-interval 40
79-
```
80-
81-
ResNet-50 benchmark (all 3 models):
130+
ResNet benchmark (all 3 models):
82131

83132
```powershell
84133
python resnet50_benchmark.py --dataset-name cifar100 --classes 100 --dataset-train-subset-size 20000 --dataset-test-subset-size 5000 --epochs 12 --device cuda
@@ -90,19 +139,16 @@ Multi-seed benchmark export:
90139
python scripts/run_multiseed_resnet_benchmark.py --dataset-name cifar100 --seeds 7,13,29 --dataset-train-subset-size 20000 --dataset-test-subset-size 5000 --epochs 12 --device cuda --output-prefix benchmark_multiseed_cifar100
91140
```
92141

93-
## Reproducing The Current Strong Circadian Regime
94-
95-
This command runs a harder full CIFAR-100 setup where circadian adaptation is active:
142+
Regenerate README charts:
96143

97144
```powershell
98-
python resnet50_benchmark.py --dataset-name cifar100 --classes 100 --dataset-train-subset-size 0 --dataset-test-subset-size 0 --epochs 48 --device cuda --target-accuracy -1 --backbone-weights imagenet --backprop-freeze-backbone --batch-size 64 --image-size 96 --eval-batches 2 --inference-batches 20 --warmup-batches 5 --circ-force-sleep --circ-sleep-interval 2 --circ-enable-sleep-rollback --circ-sleep-rollback-tolerance 0.001 --circ-sleep-rollback-metric cross_entropy --circ-sleep-rollback-eval-batches 2 --circ-min-hidden-dim 320 --circ-max-hidden-dim 768 --circ-prune-min-age-steps 1200 --circ-sleep-warmup-steps 10 --circ-adaptive-split-percentile 82 --circ-adaptive-prune-percentile 8 --circ-split-hysteresis-margin 0.01 --circ-prune-hysteresis-margin 0.02 --circ-max-split-per-sleep 1 --circ-max-prune-per-sleep 1 --circ-sleep-split-only-until-fraction 0.70 --circ-sleep-prune-only-after-fraction 0.97 --circ-sleep-max-change-fraction 0.01 --circ-split-noise-scale 0.002 --circ-homeostatic-downscale-factor 0.999 --circ-homeostasis-target-input-norm 1.2 --circ-homeostasis-target-output-norm 1.0 --circ-homeostasis-strength 0.25 --circ-lr 0.028 --circ-steps 14 --circ-inference-lr 0.12
145+
python scripts/generate_readme_figures.py --summary-csv benchmark_multiseed_cifar100_summary.csv --output-dir docs/figures
99146
```
100147

101148
## Quality Commands
102149

103150
```powershell
104151
ruff check .
105-
ruff format .
106152
mypy src tests scripts
107153
pytest -q
108154
```
@@ -117,6 +163,7 @@ pytest -q
117163
- Code of conduct: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
118164
- Governance: [GOVERNANCE.md](GOVERNANCE.md)
119165
- Support process: [SUPPORT.md](SUPPORT.md)
166+
- Model Card: [docs/model-card.md](docs/model-card.md)
120167

121168
## Citation
122169

docs/figures/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Figures
2+
3+
This folder stores visual assets used by `README.md`.
4+
5+
## Generated Artifacts
6+
7+
- `benchmark_accuracy.png`
8+
- `benchmark_train_speed.png`
9+
- `benchmark_inference_latency_p95.png`
10+
- `circadian_sleep_dynamics.gif`
11+
12+
## Regeneration
13+
14+
Run:
15+
16+
```powershell
17+
python scripts/generate_readme_figures.py --summary-csv benchmark_multiseed_cifar100_summary.csv --output-dir docs/figures
18+
```
19+
20+
The GIF is illustrative and intended for communication in the README.
14.1 KB
Loading
13.9 KB
Loading
12.5 KB
Loading
84.5 KB
Loading

docs/model-card.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Model Card: Circadian Predictive Coding
2+
3+
## Summary
4+
5+
Circadian Predictive Coding is a predictive-coding-based learner with sleep-phase structural plasticity.
6+
It tracks per-neuron chemical usage, modulates plasticity during wake, and applies split/prune consolidation during sleep.
7+
8+
## Intended Use
9+
10+
- Research and educational experimentation with biologically inspired learning dynamics.
11+
- Controlled benchmarks against backpropagation and traditional predictive coding.
12+
13+
## Not Intended For
14+
15+
- Safety-critical production decisions.
16+
- Unreviewed deployment in medical, legal, or financial decision pipelines.
17+
18+
## Model Family
19+
20+
- Base: predictive coding with iterative hidden-state inference.
21+
- Extension: circadian dynamics:
22+
- chemical accumulation and decay
23+
- plasticity gating
24+
- adaptive sleep triggers
25+
- structural split/prune
26+
- optional rollback and homeostatic controls
27+
28+
## Training Data
29+
30+
- Toy two-cluster synthetic dataset (NumPy experiments).
31+
- Synthetic and torchvision-backed vision datasets (ResNet benchmark workflow), including CIFAR-10/CIFAR-100.
32+
33+
## Evaluation
34+
35+
Primary comparison metrics:
36+
37+
- Test accuracy
38+
- Cross-entropy / energy
39+
- Training throughput (`samples/s`)
40+
- Inference latency (`mean`, `p95`) and throughput
41+
- Circadian adaptation telemetry (splits, prunes, hidden dimension trajectory, rollbacks)
42+
43+
## Known Limitations
44+
45+
- Benchmark conclusions are sensitive to sleep hyperparameters.
46+
- Circadian adaptation can underperform if split/prune schedules are too aggressive.
47+
- Current implementation focuses on head-level circadian adaptation in ResNet benchmarks.
48+
49+
## Ethical Considerations
50+
51+
- No personal data is required by default benchmark workflows.
52+
- Public benchmark claims should include dataset, seeds, and configuration details for reproducibility.
53+
54+
## Maintenance Status
55+
56+
Active research repository; APIs and defaults may evolve.
57+
Use release tags for stable references in external projects.

0 commit comments

Comments
 (0)