evonet 0.1.0.dev19__tar.gz → 0.1.0.dev21__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.
Files changed (27) hide show
  1. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/PKG-INFO +1 -1
  2. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/mutation.py +3 -54
  3. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet.egg-info/PKG-INFO +1 -1
  4. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/pyproject.toml +1 -1
  5. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/LICENSE +0 -0
  6. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/README.md +0 -0
  7. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/__init__.py +0 -0
  8. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/activation.py +0 -0
  9. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/connection.py +0 -0
  10. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/core.py +0 -0
  11. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/core_mit_plot_simple.py +0 -0
  12. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/enums.py +0 -0
  13. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/io.py +0 -0
  14. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/layer.py +0 -0
  15. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/neuron.py +0 -0
  16. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/serialization.py +0 -0
  17. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/utils.py +0 -0
  18. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet/visualize.py +0 -0
  19. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet.egg-info/SOURCES.txt +0 -0
  20. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet.egg-info/dependency_links.txt +0 -0
  21. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet.egg-info/requires.txt +0 -0
  22. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/evonet.egg-info/top_level.txt +0 -0
  23. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/setup.cfg +0 -0
  24. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/tests/test_activation.py +0 -0
  25. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/tests/test_core.py +0 -0
  26. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/tests/test_nnet_io_and_forward.py +0 -0
  27. {evonet-0.1.0.dev19 → evonet-0.1.0.dev21}/tests/test_recurrent_dynamics.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evonet
3
- Version: 0.1.0.dev19
3
+ Version: 0.1.0.dev21
4
4
  Summary: Evolvable neural network core for integration with EvoLib
5
5
  Author-email: EvoLib <evolib@dismail.de>
6
6
  License: MIT License
@@ -312,7 +312,7 @@ def add_random_neuron(
312
312
  return new_neuron
313
313
 
314
314
 
315
- def remove_random_neuron(net: Nnet) -> None:
315
+ def remove_random_neuron(net: Nnet) -> bool:
316
316
  """
317
317
  Remove a randomly selected hidden neuron from the network.
318
318
 
@@ -320,7 +320,7 @@ def remove_random_neuron(net: Nnet) -> None:
320
320
  """
321
321
  hidden_neurons = [n for n in net.get_all_neurons() if n.role == NeuronRole.HIDDEN]
322
322
  if not hidden_neurons:
323
- return
323
+ return False
324
324
 
325
325
  neuron = random.choice(hidden_neurons)
326
326
 
@@ -336,55 +336,4 @@ def remove_random_neuron(net: Nnet) -> None:
336
336
  layer.neurons.remove(neuron)
337
337
  break
338
338
 
339
-
340
- def split_connection(
341
- net: Nnet, activation: str = "tanh", noise: float = 0.1
342
- ) -> Neuron | None:
343
- """
344
- Insert a neuron in the middle of an existing connection.
345
-
346
- The old connection is removed, and two new ones are created:
347
- - from source → new neuron
348
- - from new neuron → target
349
-
350
- Args:
351
- net (Nnet): The target network.
352
- activation (str): Activation function for the new neuron.
353
- noise (float): Optional noise applied to new weights.
354
-
355
- Returns:
356
- Neuron: Added neuron, or None
357
- """
358
-
359
- all_connections = net.get_all_connections()
360
- if not all_connections:
361
- return None
362
-
363
- conn = random.choice(all_connections)
364
- src, dst = conn.source, conn.target
365
-
366
- insert_idx = None
367
- for idx, layer in enumerate(net.layers):
368
- if src in layer.neurons:
369
- insert_idx = idx + 1
370
- break
371
-
372
- if insert_idx is None or insert_idx >= len(net.layers):
373
- return None
374
-
375
- new_neuron = net.add_neuron(
376
- layer_idx=insert_idx,
377
- role=NeuronRole.HIDDEN,
378
- activation=activation,
379
- connection_init="none",
380
- )[0]
381
-
382
- # Set new connections
383
- src.outgoing.remove(conn)
384
- dst.incoming.remove(conn)
385
-
386
- weight = 1.0 + np.random.normal(0, noise)
387
- net.add_connection(src, new_neuron, weight=weight)
388
- net.add_connection(new_neuron, dst, weight=conn.weight)
389
-
390
- return new_neuron
339
+ return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: evonet
3
- Version: 0.1.0.dev19
3
+ Version: 0.1.0.dev21
4
4
  Summary: Evolvable neural network core for integration with EvoLib
5
5
  Author-email: EvoLib <evolib@dismail.de>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "evonet"
7
- version = "0.1.0.dev19"
7
+ version = "0.1.0.dev21"
8
8
  description = "Evolvable neural network core for integration with EvoLib"
9
9
  authors = [
10
10
  { name = "EvoLib", email = "evolib@dismail.de" }
File without changes
File without changes
File without changes
File without changes