stdpneuron 0.1.7__tar.gz → 0.1.9__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.7 → stdpneuron-0.1.9}/PKG-INFO +1 -1
- {stdpneuron-0.1.7 → stdpneuron-0.1.9}/src/stdpneuron/__about__.py +1 -1
- {stdpneuron-0.1.7 → stdpneuron-0.1.9}/src/stdpneuron/brain.py +7 -4
- {stdpneuron-0.1.7 → stdpneuron-0.1.9}/LICENSE.txt +0 -0
- {stdpneuron-0.1.7 → stdpneuron-0.1.9}/README.md +0 -0
- {stdpneuron-0.1.7 → stdpneuron-0.1.9}/pyproject.toml +0 -0
- {stdpneuron-0.1.7 → stdpneuron-0.1.9}/src/stdpneuron/__init__.py +0 -0
- {stdpneuron-0.1.7 → stdpneuron-0.1.9}/tests/__init__.py +0 -0
|
@@ -15,6 +15,7 @@ class NeuronMass:
|
|
|
15
15
|
self.bias = [5] * self.total_cons
|
|
16
16
|
self.pr = 0
|
|
17
17
|
self.outputs = [0] * self.n_neurons
|
|
18
|
+
self.last_outputs = [0] * self.n_neurons
|
|
18
19
|
self.v_decay = v_decay
|
|
19
20
|
self.t_decay = t_decay
|
|
20
21
|
def save_model(self, name):
|
|
@@ -51,6 +52,8 @@ class NeuronMass:
|
|
|
51
52
|
self.connections_in[i*self.n_cons+j] = random.randint(0, self.n_neurons-1)
|
|
52
53
|
# esta función genera conexiones neuronales aleatorias, bruh
|
|
53
54
|
def tick(self):
|
|
55
|
+
self.last_outputs = self.outputs[:]
|
|
56
|
+
self.outputs = [0] * self.n_neurons
|
|
54
57
|
# PROCESAR ACTIVACIÓN DE NEURONAS
|
|
55
58
|
for i in range(self.n_neurons):
|
|
56
59
|
cons_ids = []
|
|
@@ -58,8 +61,8 @@ class NeuronMass:
|
|
|
58
61
|
for j in range(self.total_cons):
|
|
59
62
|
if self.connections_in[j] == i: # es decir, esta conexión entra en la neurona q estamos mirando?
|
|
60
63
|
cons_ids.append(j)
|
|
61
|
-
delta_voltage += self.bias[j]*self.
|
|
62
|
-
self.temperature[j] +=
|
|
64
|
+
delta_voltage += self.bias[j]*self.last_outputs[self.connections_out[j]] * self.voltage[self.connections_out[j]]
|
|
65
|
+
self.temperature[j] += delta_voltage
|
|
63
66
|
self.voltage[i] += delta_voltage
|
|
64
67
|
if self.voltage[i] > self.threeholds[i]:
|
|
65
68
|
self.outputs[i] = 1
|
|
@@ -74,9 +77,9 @@ class NeuronMass:
|
|
|
74
77
|
self.bias[i] += self.plasticity[i] * (self.temperature[i])
|
|
75
78
|
|
|
76
79
|
else:
|
|
77
|
-
self.bias[i] *= self.plasticity[i] * 0.8
|
|
80
|
+
self.bias[i] *= self.plasticity[i] * 0.8 * self.temperature[i]
|
|
78
81
|
|
|
79
82
|
|
|
80
|
-
self.bias[i] += self.pr * self.plasticity[i] * self.temperature[i] *
|
|
83
|
+
self.bias[i] += self.pr * self.plasticity[i] * self.temperature[i] * 1
|
|
81
84
|
self.bias[i] = max(-5.0, min(5.0, self.bias[i]))
|
|
82
85
|
self.temperature[i] *= self.t_decay
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|