stdpneuron 0.1.8__tar.gz → 0.1.10__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: stdpneuron
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Summary: idk
5
5
  Project-URL: Documentation, https://github.com/Guille-ux/stdpneuron#readme
6
6
  Project-URL: Issues, https://github.com/Guille-ux/stdpneuron/issues
@@ -1,4 +1,4 @@
1
1
  # SPDX-FileCopyrightText: 2026-present Guille-ux <guilleleiratemes@gmail.com>
2
2
  #
3
3
  # SPDX-License-Identifier: MIT
4
- __version__ = "0.1.8"
4
+ __version__ = "0.1.10"
@@ -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,14 +61,15 @@ 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.outputs[self.connections_out[j]] * self.voltage[self.connections_out[j]]
62
- self.temperature[j] += delta_voltage
64
+ delta_voltage += self.bias[j]*self.last_outputs[self.connections_out[j]] * self.voltage[self.connections_out[j]]
65
+ self.temperature[j] += self.bias[j]*self.last_outputs[self.connections_out[j]] * self.voltage[self.connections_out[j]]
63
66
  self.voltage[i] += delta_voltage
64
67
  if self.voltage[i] > self.threeholds[i]:
65
68
  self.outputs[i] = 1
69
+ self.voltage[i] = 0
66
70
  else:
67
71
  self.outputs[i] = 0
68
- self.voltage[i] *= self.v_decay
72
+ #self.voltage[i] *= self.v_decay
69
73
  # CALCULAR CAMBIOS EN LAS CONEXIONES Y APLICARLOS
70
74
  for i in range(self.total_cons):
71
75
  neuron_in = self.connections_in[i]
@@ -74,7 +78,7 @@ class NeuronMass:
74
78
  self.bias[i] += self.plasticity[i] * (self.temperature[i])
75
79
 
76
80
  else:
77
- self.bias[i] *= self.plasticity[i] * 0.8 * self.temperature[i]
81
+ self.bias[i] *= self.plasticity[i] * 0.8
78
82
 
79
83
 
80
84
  self.bias[i] += self.pr * self.plasticity[i] * self.temperature[i] * 1
File without changes
File without changes
File without changes