You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,16 @@ All notable changes to OdyssNet will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
7
+
## [2.5.0] — 2026-04-30
8
+
9
+
### Added
10
+
-**Spatial Hebbian Plasticity**: Introduced a co-activation learning mechanism (classic Hebbian) alongside the existing STDP-style learning.
11
+
-**`hebb_mode` functionality (`hebb_type`)**: `hebb_type` is now repurposed to act as the mechanism toggle: `None` (disabled), `"temporal"`, `"spatial"`, or `"both"`.
12
+
-**`hebb_res`**: Controls the structural resolution (`"global"`, `"neuron"`, `"synapse"`). Defaults to `"neuron"`.
13
+
14
+
### Changed
15
+
-**BREAKING**: Replaced single-path Hebbian parameters with path-specific prefixes (`t_hebb_factor` and `s_hebb_factor`, etc.). Existing checkpoints utilizing `hebb_factor` will need to be loaded with `strict=False` and re-trained, or manually patched, as we have prioritized a clean architecture over legacy support.
Copy file name to clipboardExpand all lines: CITATION.cff
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ authors:
5
5
given-names: "Cahit"
6
6
email: "cksoftwaresystems@gmail.com"
7
7
title: "OdyssNet: The Trainable Dynamic System & Zero-Hidden Architecture"
8
-
version: 2.4.0
8
+
version: 2.5.0
9
9
date-released: 2025-12-12
10
10
url: "https://github.com/theomgdev/OdyssNet"
11
11
abstract: "OdyssNet is a chaotic, fully connected neural network architecture that proves temporal depth (thinking steps) can replace spatial depth (hidden layers). It solves non-linear problems like MNIST with Zero Hidden Layers by utilizing Trainable Chaos."
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,17 +155,17 @@ For tasks requiring high input/output dimensionality (like vision or LLMs) witho
155
155
model = OdyssNet(num_neurons=10, ..., vocab_size=(784, 10))
156
156
```
157
157
158
-
### F. Heterogeneous Synaptic Plasticity (`hebb_type`)
159
-
For tasks where **online synaptic plasticity** may help — e.g., fast-adaptation, continual learning, or tasks with shifting statistics — enable one of the three resolution levels:
158
+
### F. Heterogeneous Synaptic Plasticity (`hebb_type` & `hebb_res`)
159
+
For tasks where **online synaptic plasticity** may help — e.g., fast-adaptation, continual learning, or tasks with shifting statistics — enable `hebb_type` (`"temporal"`, `"spatial"`, or `"both"`) and choose one of the three resolution levels:
160
160
161
-
|`hebb_type`| Extra Params | When to use |
161
+
|`hebb_res`| Extra Params per path| When to use |
162
162
|---|---|---|
163
163
|`"global"`| +2 | Quick experiments; uniform plasticity across all synapses. |
***What it does:** At each step the network accumulates temporal cross-neuron correlations $C_t = h_t \otimes h_{t-1}$ and applies them as $W_\text{eff} = W + (f_h \odot C_t)$ (where $f_h$ is `hebb_factor`). Both `hebb_factor` and `hebb_decay` are **learnable** — the network discovers how plastic each synapse should be.
168
-
***State:** Correlations are persisted via buffers (`hebb_state_W`, `hebb_state_mem`) across intra-sequence forward calls and are explicitly cleared on `reset_state()` between sequences.
167
+
***What it does:** At each step the network accumulates correlations (temporal $C_t = h_t \otimes h_{t-1}$ and/or spatial $C_s = h_t \otimes h_t$) depending on `hebb_type`. It applies them to the weights. Both factors and decays (`t_hebb_factor`, `s_hebb_factor`, etc.) are **learnable** — the network discovers how plastic each synapse should be.
168
+
***State:** Correlations are persisted via buffers (`t_hebb_state_W`, `s_hebb_state_mem`, etc.) across intra-sequence forward calls and are explicitly cleared on `reset_state()` between sequences.
169
169
***Best Use Case (Generation / Sequential Building):** Hebbian shines in tasks where step T relies heavily on expanding or completing a pattern from step T-1. It provides a powerful **short-term working memory** between steps, acting as a dynamic shortcut that fast-tracks sequence generation.
170
170
***When *not* to use it (Classification / Independent Features):** Avoid Hebbian in classification tasks where each step processes distinct, independent chunks of information (e.g. sequential MNIST classification). In these tasks, inter-step short-term memory acts as "overfit noise".
171
171
***Compatibility:** Fully compatible with `gradient_checkpointing=True`.
@@ -178,7 +178,8 @@ model = OdyssNet(
178
178
input_ids=[0, 1],
179
179
output_ids=[31],
180
180
activation='tanh',
181
-
hebb_type='synapse', # Per-synapse plasticity
181
+
hebb_type='both',
182
+
hebb_res='synapse', # Per-synapse plasticity
182
183
device='cuda',
183
184
)
184
185
@@ -188,12 +189,13 @@ model = OdyssNet(
188
189
input_ids=list(range(8)),
189
190
output_ids=list(range(56, 64)),
190
191
activation='tanh',
191
-
hebb_type='neuron', # Per-neuron plasticity
192
+
hebb_type='temporal',
193
+
hebb_res='neuron', # Per-neuron plasticity
192
194
device='cuda',
193
195
)
194
196
195
197
# Quick experiment — global plasticity
196
-
model = OdyssNet(..., hebb_type='global')
198
+
model = OdyssNet(..., hebb_type='spatial', hebb_res='global')
197
199
198
200
# Default: Prodigy optimizer — auto-calibrates LR, no tuning needed
@@ -158,7 +158,7 @@ Uncontrolled feedback loops lead to explosion. OdyssNet engineers the chaos to f
158
158
***StepNorm** acts as gravity, keeping energy bounded.
159
159
***Tanh** filters meaningful signals while maintaining signal symmetry.
160
160
***Prodigy Optimizer (default)**: Auto-calibrates the learning rate continuously — no manual tuning required. Pass an explicit `lr` to use AdamW instead.
161
-
***Heterogeneous Synaptic Plasticity**: When `hebb_type` is set, temporal correlations $h_t \otimes h_{t-1}$ are accumulated each step and injected as $W_\text{eff} = W + (f_h \odot C_t)$ — where `hebb_factor` can be a global scalar, a per-neuron vector, or a full per-synapse matrix. All variants are learnable, letting the network discover how plastic each pathway should be.
161
+
***Heterogeneous Synaptic Plasticity**: When `hebb_type` is set, correlations (temporal $h_t \otimes h_{t-1}$ or spatial $h_t \otimes h_t$) are accumulated each step and injected — where factors like `t_hebb_factor` can be a global scalar, a per-neuron vector, or a full per-synapse matrix. All variants are learnable, letting the network discover how plastic each pathway should be.
162
162
***The Latch Experiment** proved OdyssNet can create a stable attractor to hold a decision forever against noise.
***Uzay-Zaman Dönüşümü:** Milyonlarca parametrenin yerini birkaç "Düşünme Adımı" alıyor.
37
37
***Katmansız Mimari:** Tek bir $N \times N$ matris. Gizli katman yok.
38
38
***Eğitilebilir Kaos:** Kaotik sinyalleri dizginlemek için **StepNorm** ve **Tanh** kullanır.
39
-
***Heterojen Sinaptik Plastisitesi:** İsteğe bağlı çevrimiçi Hebbian öğrenmesi (`hebb_type='synapse'|'neuron'|'global'`) — ağ zamansal nöron korelasyonlarını biriktirir ve global, nöron başına veya sinaps başına çözünürlükte tamamen türevlenebilir logit parametreleri (`hebb_factor`, `hebb_decay`) aracılığıyla *ne kadar hızlı öğreneceğini* öğrenir.
39
+
***Heterojen Sinaptik Plastisitesi:** İsteğe bağlı çevrimiçi Hebbian öğrenmesi (`hebb_type='temporal'|'spatial'|'both'`, `hebb_res='synapse'|'neuron'|'global'`) — ağ korelasyonları biriktirir ve global, nöron başına veya sinaps başına çözünürlükte tamamen türevlenebilir logit parametreleri (`t_hebb_factor`, `s_hebb_decay`, vb.) aracılığıyla *ne kadar hızlı öğreneceğini* öğrenir.
40
40
***Transplant ile Beceri Transferi:** Öğrenilmiş zamansal beceriler model boyutları arasında taşınabilir ve yeni görevlerde yeniden kullanılabilir.
41
41
***Canlı Dinamikler:****İrade** (Mandal), **Ritim** (Kronometre) ve **Rezonans** (Sinüs Dalgası) gösterir.
42
42
@@ -159,7 +159,7 @@ Kontrolsüz geri besleme döngüleri patlamaya yol açar. OdyssNet kaosun mühen
159
159
***StepNorm** yerçekimi gibi davranır, enerjiyi sınırlı tutar.
160
160
***Tanh** anlamlı sinyalleri filtreler ve sinyal simetrisini korur.
161
161
***Prodigy Optimizer (varsayılan):** Öğrenme hızını sürekli olarak otomatik kalibre eder — manuel ayar gerekmez. Açık bir `lr` değeri geçildiğinde AdamW kullanılır.
162
-
***Heterojen Sinaptik Plastisitesi:**`hebb_type` ayarlandığında her adımda zamansal korelasyonlar $h_t \otimes h_{t-1}$ biriktirilir ve $W_\text{eff} = W + (f_h \odot C_t)$ olarak enjekte edilir — `hebb_factor` global bir skaler, nöron başına vektör veya tam sinaps başına matris olabilir. Tüm çeşitler öğrenilebilir olduğundan ağ, her sinaptik yolun ne kadar plastik olması gerektiğini keşfeder.
162
+
***Heterojen Sinaptik Plastisitesi:**`hebb_type` ayarlandığında her adımda korelasyonlar (zamansal $h_t \otimes h_{t-1}$ veya uzamsal $h_t \otimes h_t$) biriktirilir ve enjekte edilir — `t_hebb_factor` gibi faktörler global bir skaler, nöron başına vektör veya tam sinaps başına matris olabilir. Tüm çeşitler öğrenilebilir olduğundan ağ, her sinaptik yolun ne kadar plastik olması gerektiğini keşfeder.
163
163
***Mandal Deneyi** OdyssNet'in gürültüye karşı bir kararı sonsuza kadar tutmak için kararlı bir çekici oluşturabileceğini kanıtladı.
hebb_type=None, # Toggle: None, 'temporal', 'spatial', or 'both'
36
+
hebb_res='neuron', # Plasticity resolution: 'global', 'neuron', or 'synapse'
36
37
debug=False, # NaN/Inf diagnosis — raises RuntimeError at the first offending operation
37
38
)
38
39
```
@@ -66,22 +67,24 @@ model = OdyssNet(
66
67
*`'continuous'`: Initializes only Linear Projection. Use for float-only inputs (e.g., vision, audio). Saves VRAM.
67
68
*`tie_embeddings` (bool):
68
69
* If `True`, ties the input embedding weights to the output decoder weights, saving significant VRAM and parameter count (Symmetric `vocab_size` only). Default is `False`.
69
-
*`hebb_type` (str or None): Controls the structural resolution of **Heterogeneous Synaptic Plasticity**. Default is `None` (plasticity disabled).
70
+
*`hebb_type` (str or None): Controls the active mechanism for **Heterogeneous Synaptic Plasticity**. Default is `None` (plasticity disabled).
71
+
*`'temporal'`: STDP-style learning; correlates current state $h_t$ with previous state $h_{t-1}$.
72
+
*`'spatial'`: Co-activation learning (classic Hebbian); correlates current state $h_t$ with itself $h_t$ (neurons firing simultaneously).
73
+
*`'both'`: Combines both temporal and spatial mechanisms.
74
+
*`hebb_res` (str): Controls the structural resolution of plasticity. Default is `'neuron'`.
70
75
71
-
|`hebb_type`| Parameter Shape | Extra Params | Mechanics |
76
+
|`hebb_res`| Parameter Shape | Extra Params per Path| Mechanics |
72
77
|---|---|---|---|
73
-
|`None`| — | 0 | Disabled. |
74
78
|`"global"`| scalar `()`| +2 | Uniform plasticity — the whole network is equally plastic. |
75
79
|`"neuron"`| vector `(N,)`| +2N | Per-neuron plasticity — each neuron learns its own adaptation rate. |
76
80
|`"synapse"`| matrix `(N, N)`| +2N² | Per-synapse plasticity — each connection has its own factor and decay. |
77
81
78
-
* Two learnable logit parameters are created according to the resolution:
* During each forward pass the model accumulates temporal cross-neuron correlations $C_t = h_t \otimes h_{t-1}$ and applies them as $W_\text{eff} = W + (f_h \odot C_t)$ (where $f_h$ is `hebb_factor`), with $\odot$ element-wise multiplication broadcast to the chosen resolution.
82
-
* The Hebbian state is persisted across forward calls via registered buffers (`hebb_state_W`, `hebb_state_mem`) and is cleared by `reset_state()`.
83
-
* Both `hebb_factor` and `hebb_decay` are fully differentiable — gradients flow into them via the recurrent computation so the network **learns how to learn** online.
84
-
***Memory cost**: `"global"` adds negligible overhead; `"neuron"` adds $O(N)$; `"synapse"` triples total parameter count to $3N^2$.
82
+
* For each active path (`t_` for temporal, `s_` for spatial), two learnable logit parameters are created according to the resolution:
* During each forward pass the model accumulates correlations (temporal $h_t \otimes h_{t-1}$ and/or spatial $h_t \otimes h_t$) and applies them to the effective weights.
86
+
* The Hebbian states are persisted across forward calls via registered buffers (`t_hebb_state_W`, `s_hebb_state_W`, etc.) and are cleared by `reset_state()`.
87
+
* Both factors and decays are fully differentiable — gradients flow into them via the recurrent computation so the network **learns how to learn** online.
85
88
*`gate` (None, str, or list[str]): Optional parametric gating mechanism. Default is `None`, which resolves to `['none', 'none', 'identity']`.
86
89
*`None`: Default configuration with memory identity gate enabled, others disabled.
87
90
*`str` (e.g., `'sigmoid'`): Applies the same gate activation to all three branches `[encoder_decoder, core, memory]`.
0 commit comments