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:
Binary file not shown.
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user