stdpneuron 0.1.1__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {stdpneuron-0.1.1 → stdpneuron-0.1.3}/PKG-INFO +1 -1
- {stdpneuron-0.1.1 → stdpneuron-0.1.3}/src/stdpneuron/__about__.py +1 -1
- {stdpneuron-0.1.1 → stdpneuron-0.1.3}/src/stdpneuron/brain.py +5 -2
- {stdpneuron-0.1.1 → stdpneuron-0.1.3}/LICENSE.txt +0 -0
- {stdpneuron-0.1.1 → stdpneuron-0.1.3}/README.md +0 -0
- {stdpneuron-0.1.1 → stdpneuron-0.1.3}/pyproject.toml +0 -0
- {stdpneuron-0.1.1 → stdpneuron-0.1.3}/src/stdpneuron/__init__.py +0 -0
- {stdpneuron-0.1.1 → stdpneuron-0.1.3}/tests/__init__.py +0 -0
|
@@ -48,7 +48,7 @@ class NeuronMass:
|
|
|
48
48
|
for i in range(self.n_neurons):
|
|
49
49
|
for j in range(self.n_cons):
|
|
50
50
|
self.connections_out[i*self.n_cons+j] = i
|
|
51
|
-
self.connections_in[i*self.n_cons+j] = random.randint(0, self.n_neurons)
|
|
51
|
+
self.connections_in[i*self.n_cons+j] = random.randint(0, self.n_neurons-1)
|
|
52
52
|
# esta función genera conexiones neuronales aleatorias, bruh
|
|
53
53
|
def tick(self):
|
|
54
54
|
# PROCESAR ACTIVACIÓN DE NEURONAS
|
|
@@ -63,6 +63,7 @@ class NeuronMass:
|
|
|
63
63
|
self.voltage[i] += delta_voltage
|
|
64
64
|
if self.voltage[i] > self.threeholds[i]:
|
|
65
65
|
self.outputs[i] = 1
|
|
66
|
+
self.voltage[i] = 0
|
|
66
67
|
else:
|
|
67
68
|
self.outputs[i] = 0
|
|
68
69
|
self.voltage[i] *= self.v_decay
|
|
@@ -72,9 +73,11 @@ class NeuronMass:
|
|
|
72
73
|
neuron_out = self.connections_out[i]
|
|
73
74
|
if self.outputs[neuron_in] == 1:
|
|
74
75
|
self.bias[i] += self.plasticity[i] * (self.temperature[i])
|
|
76
|
+
|
|
75
77
|
else:
|
|
76
78
|
self.bias[i] -= self.plasticity[i] * self.temperature[i]
|
|
79
|
+
|
|
77
80
|
|
|
78
81
|
self.bias[i] += self.pr * self.plasticity[i] * self.temperature[i]
|
|
79
|
-
|
|
82
|
+
self.bias[i] = max(-5.0, min(5.0, self.bias[i]))
|
|
80
83
|
self.temperature[i] *= self.t_decay
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|