pyerualjetwork 5.21b3__tar.gz → 5.22__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 (30) hide show
  1. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/PKG-INFO +1 -1
  2. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/__init__.py +1 -1
  3. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/activation_functions_cuda.py +12 -5
  4. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/neu_cpu.py +5 -5
  5. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/neu_cuda.py +4 -4
  6. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork.egg-info/PKG-INFO +1 -1
  7. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/setup.py +1 -1
  8. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/README.md +0 -0
  9. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/activation_functions_cpu.py +0 -0
  10. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/data_operations_cpu.py +0 -0
  11. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/data_operations_cuda.py +0 -0
  12. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/ene_cpu.py +0 -0
  13. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/ene_cuda.py +0 -0
  14. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/fitness_functions.py +0 -0
  15. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/help.py +0 -0
  16. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/issue_solver.py +0 -0
  17. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/loss_functions_cpu.py +0 -0
  18. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/loss_functions_cuda.py +0 -0
  19. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/memory_operations.py +0 -0
  20. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/metrics_cpu.py +0 -0
  21. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/metrics_cuda.py +0 -0
  22. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/model_operations_cpu.py +0 -0
  23. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/model_operations_cuda.py +0 -0
  24. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/ui.py +0 -0
  25. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/visualizations_cpu.py +0 -0
  26. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork/visualizations_cuda.py +0 -0
  27. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork.egg-info/SOURCES.txt +0 -0
  28. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork.egg-info/dependency_links.txt +0 -0
  29. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/pyerualjetwork.egg-info/top_level.txt +0 -0
  30. {pyerualjetwork-5.21b3 → pyerualjetwork-5.22}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 5.21b3
3
+ Version: 5.22
4
4
  Summary: PyereualJetwork is a GPU-accelerated machine learning library in Python for professionals and researchers. It features PLAN, MLP, Deep Learning training, and ENE (Eugenic NeuroEvolution) for genetic optimization, applicable to genetic algorithms or Reinforcement Learning (RL). The library includes data pre-processing, visualizations, model saving/loading, prediction, evaluation, training, and detailed or simplified memory management.
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -42,7 +42,7 @@ PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welco
42
42
  - Contact: tchasancan@gmail.com
43
43
  """
44
44
 
45
- __version__ = "5.21b3"
45
+ __version__ = "5.22"
46
46
  __update__ = """* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES
47
47
  * PyerualJetwork Homepage: https://github.com/HCB06/PyerualJetwork/tree/main
48
48
  * PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf
@@ -1,4 +1,5 @@
1
1
  import cupy as cp
2
+ import numpy as np
2
3
  from scipy.special import expit, softmax
3
4
  import warnings
4
5
 
@@ -198,10 +199,16 @@ def apply_activation(Input, activation_list):
198
199
  'spiral': spiral_activation,
199
200
  'circular': circular_activation
200
201
  }
202
+
203
+ try:
204
+
205
+ valid_mask = cp.array([act in activation_functions for act in activation_list])
206
+ valid_activations = np.array(activation_list)[valid_mask.get()]
201
207
 
202
- valid_mask = cp.array([act in activation_functions for act in activation_list])
203
- valid_activations = cp.array(activation_list)[valid_mask]
204
-
205
- activation_outputs = cp.array([activation_functions[act](origin_input) for act in valid_activations])
208
+ activation_outputs = cp.array([activation_functions[act](origin_input) for act in valid_activations])
206
209
 
207
- return cp.sum(activation_outputs, axis=0)
210
+ return cp.sum(activation_outputs, axis=0)
211
+
212
+ except Exception as e:
213
+ warnings.warn(f"Error in activation processing: {str(e)}", RuntimeWarning)
214
+ return Input
@@ -340,17 +340,17 @@ def learn(x_train, y_train, optimizer, gen, pop_size, fit_start=True, batch_size
340
340
 
341
341
  if fitness >= best_fitness:
342
342
 
343
- best_fitness = fitness
344
- best_acc = acc
345
- best_loss = train_loss
343
+ best_fitness = copy.copy(fitness)
344
+ best_acc = copy.copy(acc)
345
+ best_loss = copy.copy(train_loss)
346
346
  best_weight = np.copy(weight_pop[j]) if model_type == 'PLAN' else copy.deepcopy(weight_pop[j])
347
- best_model = model
347
+ best_model = copy.deepcopy(model)
348
348
 
349
349
  final_activations = act_pop[j].copy() if isinstance(act_pop[j], list) else act_pop[j]
350
350
  if model_type == 'PLAN': final_activations = [final_activations[0]] if len(set(final_activations)) == 1 else final_activations # removing if all same
351
351
 
352
352
  if batch_size == 1:
353
- postfix_dict[f"{data} Accuracy"] = np.round(best_acc, 4)
353
+ postfix_dict[f"{data} Accuracy"] = np.round(best_acc)
354
354
  postfix_dict[f"{data} Loss"] = np.round(train_loss, 4)
355
355
  progress.set_postfix(postfix_dict)
356
356
 
@@ -351,11 +351,11 @@ def learn(x_train, y_train, optimizer, gen, pop_size, fit_start=True, batch_size
351
351
 
352
352
  if fitness >= best_fitness:
353
353
 
354
- best_fitness = fitness
355
- best_acc = acc
356
- best_loss = train_loss
354
+ best_fitness = copy.copy(fitness)
355
+ best_acc = copy.copy(acc)
356
+ best_loss = copy.copy(train_loss)
357
357
  best_weight = cp.copy(weight_pop[j]) if model_type == 'PLAN' else copy.deepcopy(weight_pop[j])
358
- best_model = model
358
+ best_model = copy.deepcopy(model)
359
359
 
360
360
  final_activations = act_pop[j].copy() if isinstance(act_pop[j], list) else act_pop[j]
361
361
  if model_type == 'PLAN': final_activations = [final_activations[0]] if len(set(final_activations)) == 1 else final_activations # removing if all same
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 5.21b3
3
+ Version: 5.22
4
4
  Summary: PyereualJetwork is a GPU-accelerated machine learning library in Python for professionals and researchers. It features PLAN, MLP, Deep Learning training, and ENE (Eugenic NeuroEvolution) for genetic optimization, applicable to genetic algorithms or Reinforcement Learning (RL). The library includes data pre-processing, visualizations, model saving/loading, prediction, evaluation, training, and detailed or simplified memory management.
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
6
6
  # Setting Up
7
7
  setup(
8
8
  name="pyerualjetwork",
9
- version="5.21b3",
9
+ version="5.22",
10
10
  author="Hasan Can Beydili",
11
11
  author_email="tchasancan@gmail.com",
12
12
  description=(
File without changes
File without changes