last changes
This commit is contained in:
@@ -12,6 +12,24 @@ def tanh(x): return math.tanh(x)
|
||||
|
||||
|
||||
class Neuron(Actor):
|
||||
"""
|
||||
Neuron actor implementing a weighted-sum neuron with an activation function
|
||||
and optional recurrent inputs.
|
||||
|
||||
The Neuron receives input vectors from upstream neurons, accumulates them
|
||||
according to its weight configuration, applies an activation function,
|
||||
and forwards the resulting output to downstream actors.
|
||||
|
||||
It supports:
|
||||
- feed-forward and recurrent connections
|
||||
- bias handling
|
||||
- asynchronous message-based execution
|
||||
- weight backup, restoration, and stochastic perturbation (mutation)
|
||||
- cycle-based updates for recurrent networks
|
||||
|
||||
This actor is designed to be used inside a cortex/agent actor network,
|
||||
where synchronization and evolution are coordinated externally.
|
||||
"""
|
||||
def __init__(self, nid, cx_pid, af_name, input_idps, output_pids, bias: Optional[float] = None):
|
||||
super().__init__(f"Neuron-{nid}")
|
||||
self.nid = nid
|
||||
|
||||
Reference in New Issue
Block a user