pyerualjetwork 5.41__tar.gz → 5.44__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 (31) hide show
  1. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/PKG-INFO +1 -1
  2. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/__init__.py +1 -1
  3. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/model_ops.py +71 -30
  4. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork.egg-info/PKG-INFO +1 -1
  5. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/setup.py +1 -1
  6. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/README.md +0 -0
  7. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cpu/__init__.py +0 -0
  8. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cpu/activation_functions.py +0 -0
  9. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cpu/data_ops.py +0 -0
  10. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cpu/loss_functions.py +0 -0
  11. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cpu/metrics.py +0 -0
  12. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cpu/visualizations.py +0 -0
  13. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cuda/__init__.py +0 -0
  14. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cuda/activation_functions.py +0 -0
  15. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cuda/data_ops.py +0 -0
  16. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cuda/loss_functions.py +0 -0
  17. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cuda/metrics.py +0 -0
  18. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/cuda/visualizations.py +0 -0
  19. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/ene.py +0 -0
  20. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/fitness_functions.py +0 -0
  21. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/help.py +0 -0
  22. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/issue_solver.py +0 -0
  23. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/memory_ops.py +0 -0
  24. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/nn.py +0 -0
  25. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/old_cpu_model_ops.py +0 -0
  26. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/old_cuda_model_ops.py +0 -0
  27. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork/ui.py +0 -0
  28. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork.egg-info/SOURCES.txt +0 -0
  29. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork.egg-info/dependency_links.txt +0 -0
  30. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/pyerualjetwork.egg-info/top_level.txt +0 -0
  31. {pyerualjetwork-5.41 → pyerualjetwork-5.44}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 5.41
3
+ Version: 5.44
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.41"
45
+ __version__ = "5.44"
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
@@ -45,27 +45,72 @@ import pandas as pd
45
45
  from collections import namedtuple
46
46
 
47
47
  def get_model_template():
48
-
48
+ """
49
+ Creates and returns a named tuple template for a model structure.
50
+
51
+ This function defines a `Model` named tuple with standard fields used
52
+ to represent various components of a machine learning model.
53
+ All fields are initialized to `None`.
54
+
55
+ Returns:
56
+ Model: A named tuple with the following fields initialized to None:
57
+ -> weights: Model weights.
58
+ -> predictions: Raw class predictions.
59
+ -> accuracy: Model evaluation metric (e.g., accuracy).
60
+ -> activations: Activation functions used in the model.
61
+ -> scaler_params: Parameters used for feature scaling.
62
+ -> softmax_predictions: Output probabilities after softmax.
63
+ -> model_type: A string indicating the type of model.
64
+ -> weights_type: The format or data type of the weights.
65
+ -> weights_format: Structural format of the weights.
66
+ -> model_version: A string or identifier for versioning.
67
+ -> model_df: DataFrame holding model-related data.
68
+ -> activation_potentiation: Only for PTNN models.
69
+ """
49
70
  Model = namedtuple("Model", [
50
- "weights",
51
- "predictions",
52
- "accuracy",
53
- "activations",
54
- "scaler_params",
55
- "softmax_predictions",
56
- "model_type",
57
- "weights_type",
58
- "weights_format",
59
- "model_version",
60
- "model_df",
61
- "activation_potentiation"
71
+ "weights",
72
+ "predictions",
73
+ "accuracy",
74
+ "activations",
75
+ "scaler_params",
76
+ "softmax_predictions",
77
+ "model_type",
78
+ "weights_type",
79
+ "weights_format",
80
+ "model_version",
81
+ "model_df",
82
+ "activation_potentiation"
62
83
  ])
63
-
84
+
64
85
  template_model = Model(None, None, None, None, None, None, None, None, None, None, None, None)
65
86
 
66
87
  return template_model
67
88
 
68
89
 
90
+ def build_model(W, activations, model_type, activation_potentiation=None):
91
+ """
92
+ Builds a model using the template and specified components.
93
+
94
+ Args:
95
+ W (any): The weight parameters of the model.
96
+ activations (any): The activation functions to be used.
97
+ model_type (str): A string specifying the model architecture (PLAN, MLP or PTNN).
98
+ activation_potentiation (optional): An optional parameter only for PTNN models.
99
+
100
+ Returns:
101
+ Model: A named tuple representing the constructed model, with relevant fields filled in.
102
+ """
103
+ template_model = get_model_template()
104
+ model = template_model._replace(
105
+ weights=W,
106
+ activations=activations,
107
+ model_type=model_type,
108
+ activation_potentiation=activation_potentiation
109
+ )
110
+
111
+ return model
112
+
113
+
69
114
  def save_model(model,
70
115
  model_name,
71
116
  model_path='',
@@ -386,22 +431,18 @@ def load_model(model_name,
386
431
  if WeightType == 'mat':
387
432
  W = W['w']
388
433
 
389
- Model = get_model_template()
390
-
391
- model = Model(
392
- W,
393
- None,
394
- acc,
395
- activations,
396
- scaler_params,
397
- None,
398
- model_type,
399
- WeightType,
400
- WeightFormat,
401
- device_version,
402
- df,
403
- activation_potentiation
404
- )
434
+ template_model = get_model_template()
435
+
436
+ model = template_model._replace(weights=W,
437
+ accuracy=acc,
438
+ activations=activations,
439
+ scaler_params=scaler_params,
440
+ weights_type=WeightType,
441
+ weights_format=WeightFormat,
442
+ model_version=device_version,
443
+ model_df=df,
444
+ model_type=model_type,
445
+ activation_potentiation=activation_potentiation)
405
446
 
406
447
  return model
407
448
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 5.41
3
+ Version: 5.44
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.41",
9
+ version="5.44",
10
10
  author="Hasan Can Beydili",
11
11
  author_email="tchasancan@gmail.com",
12
12
  description=(
File without changes
File without changes