fix(hebbian): random weight init to escape zero local minimum

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-18 00:03:26 +02:00
parent e600204c84
commit b945bb1ac5
2 changed files with 3 additions and 1 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
import binary_encoding
import std/math
import std/random
const
N_IN* = TOTAL_BITS # 870
@@ -31,7 +32,8 @@ type
active*: bool
proc initHebbianNet*(): HebbianNet =
discard # zero-init by default
for w in result.W.mitems:
w = rand(0.2) - 0.1
proc forward*(net: HebbianNet, input: BinaryVector): OutputVector =
for j in 0..<N_OUT: