pyerualjetwork 4.3.2.2b0__py3-none-any.whl → 4.3.4__py3-none-any.whl

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/__init__.py +11 -0
  2. pyerualjetwork/activation_functions.py +290 -0
  3. pyerualjetwork/activation_functions_cuda.py +340 -0
  4. pyerualjetwork/data_operations.py +406 -0
  5. pyerualjetwork/data_operations_cuda.py +461 -0
  6. pyerualjetwork/help.py +17 -0
  7. pyerualjetwork/loss_functions.py +21 -0
  8. pyerualjetwork/loss_functions_cuda.py +21 -0
  9. pyerualjetwork/memory_operations.py +298 -0
  10. pyerualjetwork/metrics.py +190 -0
  11. pyerualjetwork/metrics_cuda.py +163 -0
  12. pyerualjetwork/model_operations.py +408 -0
  13. pyerualjetwork/model_operations_cuda.py +421 -0
  14. pyerualjetwork/plan.py +627 -0
  15. pyerualjetwork/plan_cuda.py +648 -0
  16. pyerualjetwork/planeat.py +825 -0
  17. pyerualjetwork/planeat_cuda.py +834 -0
  18. pyerualjetwork/ui.py +22 -0
  19. pyerualjetwork/visualizations.py +823 -0
  20. pyerualjetwork/visualizations_cuda.py +825 -0
  21. {pyerualjetwork-4.3.2.2b0.dist-info → pyerualjetwork-4.3.4.dist-info}/METADATA +28 -13
  22. pyerualjetwork-4.3.4.dist-info/RECORD +44 -0
  23. {pyerualjetwork-4.3.2.2b0.dist-info → pyerualjetwork-4.3.4.dist-info}/top_level.txt +1 -0
  24. pyerualjetwork_afterburner/__init__.py +1 -1
  25. pyerualjetwork_afterburner/activation_functions.py +7 -8
  26. pyerualjetwork_afterburner/activation_functions_cuda.py +5 -6
  27. pyerualjetwork_afterburner/data_operations_cuda.py +2 -2
  28. pyerualjetwork_afterburner/plan_cuda.py +7 -6
  29. pyerualjetwork_afterburner/planeat_cuda.py +2 -3
  30. pyerualjetwork-4.3.2.2b0.dist-info/RECORD +0 -24
  31. {pyerualjetwork-4.3.2.2b0.dist-info → pyerualjetwork-4.3.4.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 4.3.2.2b0
3
+ Version: 4.3.4
4
4
  Summary: PyerualJetwork is a machine learning library supported with GPU(CUDA) acceleration written in Python for professionals and researchers including with PLAN algorithm, PLANEAT algorithm (genetic optimization). Also includes data pre-process and memory manegament
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -23,18 +23,33 @@ PyPi Page: https://pypi.org/project/pyerualjetwork/
23
23
  GitHub Page: https://github.com/HCB06/PyerualJetwork
24
24
 
25
25
 
26
- pip install pyerualjetwork==x.x.x (means it is a normal package)
27
- pip install pyerualjetwork==x.x.x.x (last x means it is a afterburner package)
28
-
29
- from pyerualjetwork import plan
30
- from pyerualjetwork import planeat
31
- from pyerualjetwork import data_operations
32
- from pyerualjetwork import model_operations
33
-
34
- from pyerualjetwork import plan_cuda
35
- from pyerualjetwork import planeat_cuda
36
- from pyerualjetwork import data_operations_cuda
37
- from pyerualjetwork import model_operations_cuda
26
+ pip install pyerualjetwork
27
+
28
+ 'use this if your data small or memory management is a problem :'
29
+
30
+ from pyerualjetwork import plan
31
+ from pyerualjetwork import planeat
32
+ from pyerualjetwork import data_operations
33
+ from pyerualjetwork import model_operations
34
+
35
+ from pyerualjetwork import plan_cuda
36
+ from pyerualjetwork import planeat_cuda
37
+ from pyerualjetwork import data_operations_cuda
38
+ from pyerualjetwork import model_operations_cuda
39
+
40
+ 'use this if your data large or memory management is not a problem : _afterburner package (afterburner package comes with powerful paralellism,
41
+ afterburner with cuda modules offers super-fast training but some memory managemant features and visualization features discarded.
42
+ Specially designed for LLM training and other massive model training)'
43
+
44
+ from pyerualjetwork_afterburner import plan
45
+ from pyerualjetwork_afterburner import planeat
46
+ from pyerualjetwork_afterburner import data_operations
47
+ from pyerualjetwork_afterburner import model_operations
48
+
49
+ from pyerualjetwork_afterburner import plan_cuda
50
+ from pyerualjetwork_afterburner import planeat_cuda
51
+ from pyerualjetwork_afterburner import data_operations_cuda
52
+ from pyerualjetwork_afterburner import model_operations_cuda
38
53
 
39
54
  Optimized for Visual Studio Code
40
55
 
@@ -0,0 +1,44 @@
1
+ pyerualjetwork/__init__.py,sha256=UZL2J9uCXFaBgNKiBN79R0oWCaQxDkK6SWour_AgCWQ,639
2
+ pyerualjetwork/activation_functions.py,sha256=AR91fQV2W2rc-Qb4Yp7b8ucYpGjwyQUewO-M-lyEMs8,7729
3
+ pyerualjetwork/activation_functions_cuda.py,sha256=ztIw6rMR4t1289_TPIGYwE6qarl_YbSOGj5Ep3rUMqs,11803
4
+ pyerualjetwork/data_operations.py,sha256=Flteouu6rfSo2uHMqBHuzO02dXmbNa-I5qWmUpGTZ5Y,14760
5
+ pyerualjetwork/data_operations_cuda.py,sha256=UpoJoFhIwTU4xg9dVuLAxLAT4CkRaGsxvtJG9j1xrNo,17629
6
+ pyerualjetwork/help.py,sha256=nQ_YbYA2RtuafhuvkreNpX0WWL1I_nzlelwCtvei0_Y,775
7
+ pyerualjetwork/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
8
+ pyerualjetwork/loss_functions_cuda.py,sha256=C93IZJcrOpT6HMK9x1O4AHJWXYTkN5WZiqdssPbvAPk,617
9
+ pyerualjetwork/memory_operations.py,sha256=I7QiZ--xSyRkFF0wcckPwZV7K9emEvyx5aJ3DiRHZFI,13468
10
+ pyerualjetwork/metrics.py,sha256=q7MkhnZDRbCjFBDDfUgrl8lBYnUT_1ro1LxeBq105pI,6077
11
+ pyerualjetwork/metrics_cuda.py,sha256=73h9GC7XwmnFCVzFEEiPQfF8CwHIz2wsCbxpZrJtYgw,5061
12
+ pyerualjetwork/model_operations.py,sha256=RKqnh7-MByFosxqme4q4jC1lOndX26O-OVXYV6ZxoEE,12965
13
+ pyerualjetwork/model_operations_cuda.py,sha256=XnKKq54ZLaqCm-NaJ6d8IToACKcKg2Ttq6moowVRRWo,13365
14
+ pyerualjetwork/plan.py,sha256=9dYxGCIEyQoUyo1s8X6RHshFNKekXteQqtQ2lm_Khb8,31893
15
+ pyerualjetwork/plan_cuda.py,sha256=jraw3-QqweiptwZOhRQxApsAqkVWMf4pmdeMWt0v7Sc,33253
16
+ pyerualjetwork/planeat.py,sha256=uRX-hDywGOai6hHhbYrmcRodNZOg4WCQeJWZbdMlZs8,39470
17
+ pyerualjetwork/planeat_cuda.py,sha256=QNHCQLkR0MNFqyN2iHAtC7cbf8qZiD3p_54YH3lnMFA,39529
18
+ pyerualjetwork/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
19
+ pyerualjetwork/visualizations.py,sha256=VL00sX2DZz83F__PyEJH9s1LizuXpOBzWjnoSjMJIJ0,28770
20
+ pyerualjetwork/visualizations_cuda.py,sha256=KbMhfsLlxujy_i3QrwCf734Q-k6d7Zn_7CEbm3gzK9w,29186
21
+ pyerualjetwork_afterburner/__init__.py,sha256=XfhHAEboCZ5NGlC1bMkuPdWJHvTyrQ-bZGkZUd0qi90,651
22
+ pyerualjetwork_afterburner/activation_functions.py,sha256=bKf00lsuuLJNO-4vVp4OqBi4zJ-qZ8L3v-vl52notkY,7721
23
+ pyerualjetwork_afterburner/activation_functions_cuda.py,sha256=5y1Ti3GDfDteQDCUmODwe7tAyDAUlDTKmIikChQ8d6g,7772
24
+ pyerualjetwork_afterburner/data_operations.py,sha256=Flteouu6rfSo2uHMqBHuzO02dXmbNa-I5qWmUpGTZ5Y,14760
25
+ pyerualjetwork_afterburner/data_operations_cuda.py,sha256=nn8fXBRZrdJWqcXlQqebaBMXkR3LyGfUwlzQ-26R8yo,17624
26
+ pyerualjetwork_afterburner/help.py,sha256=nQ_YbYA2RtuafhuvkreNpX0WWL1I_nzlelwCtvei0_Y,775
27
+ pyerualjetwork_afterburner/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
28
+ pyerualjetwork_afterburner/loss_functions_cuda.py,sha256=C93IZJcrOpT6HMK9x1O4AHJWXYTkN5WZiqdssPbvAPk,617
29
+ pyerualjetwork_afterburner/memory_operations.py,sha256=I7QiZ--xSyRkFF0wcckPwZV7K9emEvyx5aJ3DiRHZFI,13468
30
+ pyerualjetwork_afterburner/metrics.py,sha256=q7MkhnZDRbCjFBDDfUgrl8lBYnUT_1ro1LxeBq105pI,6077
31
+ pyerualjetwork_afterburner/metrics_cuda.py,sha256=73h9GC7XwmnFCVzFEEiPQfF8CwHIz2wsCbxpZrJtYgw,5061
32
+ pyerualjetwork_afterburner/model_operations.py,sha256=MCSCNYiiICRVZITobtS3ZIWmH5Q9gjyELuH32sAdgg4,12649
33
+ pyerualjetwork_afterburner/model_operations_cuda.py,sha256=NT01BK5nrDYE7H1x3KnSI8gmx0QTGGB0mP_LqEb1uuU,13157
34
+ pyerualjetwork_afterburner/plan.py,sha256=Gxv8ii4brTYMzzFZBP-X6kkwc6w6vtTPiMmqVOAqoq8,21972
35
+ pyerualjetwork_afterburner/plan_cuda.py,sha256=7R9alPqSOXpL_3vmVbQJFUVIOj5SjltIo0necj76AjE,22751
36
+ pyerualjetwork_afterburner/planeat.py,sha256=Lq5R0aMS4UIdZdbUKsKDv5g0WLwYryomR3IQYb8vAa4,37573
37
+ pyerualjetwork_afterburner/planeat_cuda.py,sha256=KnU54osvwrMVvdO4fww7BqFBoq0I8c2YcZOVHD8l69g,37494
38
+ pyerualjetwork_afterburner/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
39
+ pyerualjetwork_afterburner/visualizations.py,sha256=1SKMZaJ80OD2qHUyMxW1IOv8zwmxzMPxclfbeq1Xr4g,28772
40
+ pyerualjetwork_afterburner/visualizations_cuda.py,sha256=KbMhfsLlxujy_i3QrwCf734Q-k6d7Zn_7CEbm3gzK9w,29186
41
+ pyerualjetwork-4.3.4.dist-info/METADATA,sha256=0NPm5VKPBK7A6Pc5VTWF7oZOdBC1q_-vFcMpsFkAc74,8248
42
+ pyerualjetwork-4.3.4.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
43
+ pyerualjetwork-4.3.4.dist-info/top_level.txt,sha256=uK64ge08QQoPuXM3aiRVPgiQQtl8Fxm2-HieIut5Lwo,42
44
+ pyerualjetwork-4.3.4.dist-info/RECORD,,
@@ -1 +1,2 @@
1
+ pyerualjetwork
1
2
  pyerualjetwork_afterburner
@@ -1,4 +1,4 @@
1
- __version__ = "4.3.2.2b0-afterburner"
1
+ __version__ = "4.3.4-afterburner"
2
2
  __update__ = "* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES\n* PyerualJetwork Homepage: https://github.com/HCB06/PyerualJetwork/tree/main\n* PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf\n* YouTube tutorials: https://www.youtube.com/@HasanCanBeydili"
3
3
 
4
4
  def print_version(__version__):
@@ -277,15 +277,14 @@ def apply_activation(Input, activation_list):
277
277
  }
278
278
 
279
279
  try:
280
- valid_activations = [act for act in activation_list if act in activation_functions]
281
-
282
- activation_outputs = np.stack([activation_functions[act](origin_input)
283
- for act in valid_activations])
284
280
 
285
- result = Input + np.sum(activation_outputs, axis=0)
286
-
287
- return result
281
+ valid_mask = np.array([act in activation_functions for act in activation_list])
282
+ valid_activations = np.array(activation_list)[valid_mask]
283
+
284
+ activation_outputs = np.array([activation_functions[act](origin_input) for act in valid_activations])
285
+
286
+ return Input + np.sum(activation_outputs, axis=0)
288
287
 
289
288
  except Exception as e:
290
289
  warnings.warn(f"Error in activation processing: {str(e)}", RuntimeWarning)
291
- return Input
290
+ return Input
@@ -276,14 +276,13 @@ def apply_activation(Input, activation_list):
276
276
  }
277
277
 
278
278
  try:
279
- valid_activations = [act for act in activation_list if act in activation_functions]
280
279
 
281
- activation_outputs = cp.stack([activation_functions[act](origin_input)
282
- for act in valid_activations])
280
+ valid_mask = cp.array([act in activation_functions for act in activation_list])
281
+ valid_activations = cp.array(activation_list)[valid_mask]
283
282
 
284
- result = Input + cp.sum(activation_outputs, axis=0)
285
-
286
- return result
283
+ activation_outputs = cp.array([activation_functions[act](origin_input) for act in valid_activations])
284
+
285
+ return Input + cp.sum(activation_outputs, axis=0)
287
286
 
288
287
  except Exception as e:
289
288
  warnings.warn(f"Error in activation processing: {str(e)}", RuntimeWarning)
@@ -17,7 +17,7 @@ def encode_one_hot(y_train, y_test=None, summary=False):
17
17
  tuple: One-hot encoded y_train and (if given) y_test.
18
18
  """
19
19
 
20
- from .memory_operations import optimize_labels, transfer_to_cpu
20
+ from memory_operations import optimize_labels, transfer_to_cpu
21
21
 
22
22
  y_train = optimize_labels(y_train, one_hot_encoded=False, cuda=True)
23
23
  y_test = optimize_labels(y_test, one_hot_encoded=False, cuda=True)
@@ -401,7 +401,7 @@ def standard_scaler(x_train=None, x_test=None, scaler_params=None, dtype=cp.floa
401
401
 
402
402
  return scaled_data # sample data scaled
403
403
 
404
-
404
+
405
405
  def normalization(
406
406
  Input, # num: Input data to be normalized.
407
407
  dtype=cp.float32
@@ -23,7 +23,7 @@ from .data_operations_cuda import normalization
23
23
  from .loss_functions_cuda import binary_crossentropy, categorical_crossentropy
24
24
  from .activation_functions_cuda import apply_activation, all_activations
25
25
  from .metrics_cuda import metrics
26
- from .model_operations_cuda import get_acc, get_preds, get_preds_softmax
26
+ from model_operations_cuda import get_acc, get_preds, get_preds_softmax
27
27
  from .memory_operations import transfer_to_gpu, transfer_to_cpu, optimize_labels
28
28
  from .visualizations_cuda import (
29
29
  draw_neural_web,
@@ -151,11 +151,12 @@ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=Non
151
151
 
152
152
  """
153
153
 
154
- from .planeat_cuda import define_genomes
154
+ from planeat_cuda import define_genomes
155
155
 
156
156
  data = 'Train'
157
157
 
158
- activation_potentiation = all_activations()
158
+ activation_potentiation = all_activations()
159
+
159
160
  activation_potentiation_len = len(activation_potentiation)
160
161
 
161
162
  y_train = optimize_labels(y_train, cuda=True)
@@ -164,13 +165,13 @@ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=Non
164
165
  x_train = transfer_to_gpu(x_train, dtype=dtype)
165
166
  y_train = transfer_to_gpu(y_train, dtype=y_train.dtype)
166
167
 
167
- from .data_operations_cuda import batcher
168
+ from data_operations_cuda import batcher
168
169
 
169
170
  elif memory == 'cpu':
170
171
  x_train = transfer_to_cpu(x_train, dtype=dtype)
171
172
  y_train = transfer_to_cpu(y_train, dtype=y_train.dtype)
172
173
 
173
- from .data_operations import batcher
174
+ from data_operations import batcher
174
175
 
175
176
  else:
176
177
  raise ValueError("memory parameter must be 'cpu' or 'gpu'.")
@@ -228,7 +229,7 @@ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=Non
228
229
  W = fit(x_train_batch, y_train_batch, activation_potentiation=act_pop[-1], dtype=dtype)
229
230
  weight_pop.append(W)
230
231
 
231
- model = evaluate(x_train_batch, y_train_batch, W=weight_pop[j])
232
+ model = evaluate(x_train_batch, y_train_batch, W=weight_pop[j], activation_potentiation=act_pop[j])
232
233
  acc = model[get_acc()]
233
234
 
234
235
  if strategy == 'accuracy': target_pop.append(acc)
@@ -721,9 +721,8 @@ def mutation(weight,
721
721
  max_threshold = len(activations)
722
722
 
723
723
  new_threshold = threshold
724
-
725
- except_this = ['spiral', 'circular']
726
- all_acts = [item for item in all_activations() if item not in except_this] # SPIRAL AND CIRCULAR ACTIVATION DISCARDED
724
+
725
+ all_acts = all_activations()
727
726
 
728
727
  activation_add_prob = 1 - activation_add_prob
729
728
  activation_delete_prob = 1 - activation_delete_prob
@@ -1,24 +0,0 @@
1
- pyerualjetwork_afterburner/__init__.py,sha256=PWlgYDHv0-7II5khz9y5meQi0PdWYwsuQ7-pEcCijqM,655
2
- pyerualjetwork_afterburner/activation_functions.py,sha256=2bv7o4EPEFr8cSKq7KI04HhMUyxgBpe8soGvN98Mazg,7740
3
- pyerualjetwork_afterburner/activation_functions_cuda.py,sha256=Ua606lsj9LQahfLi6oZMkSyzyPT7ySrvC6qfACNCbL8,7781
4
- pyerualjetwork_afterburner/data_operations.py,sha256=Flteouu6rfSo2uHMqBHuzO02dXmbNa-I5qWmUpGTZ5Y,14760
5
- pyerualjetwork_afterburner/data_operations_cuda.py,sha256=UpoJoFhIwTU4xg9dVuLAxLAT4CkRaGsxvtJG9j1xrNo,17629
6
- pyerualjetwork_afterburner/help.py,sha256=nQ_YbYA2RtuafhuvkreNpX0WWL1I_nzlelwCtvei0_Y,775
7
- pyerualjetwork_afterburner/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
8
- pyerualjetwork_afterburner/loss_functions_cuda.py,sha256=C93IZJcrOpT6HMK9x1O4AHJWXYTkN5WZiqdssPbvAPk,617
9
- pyerualjetwork_afterburner/memory_operations.py,sha256=I7QiZ--xSyRkFF0wcckPwZV7K9emEvyx5aJ3DiRHZFI,13468
10
- pyerualjetwork_afterburner/metrics.py,sha256=q7MkhnZDRbCjFBDDfUgrl8lBYnUT_1ro1LxeBq105pI,6077
11
- pyerualjetwork_afterburner/metrics_cuda.py,sha256=73h9GC7XwmnFCVzFEEiPQfF8CwHIz2wsCbxpZrJtYgw,5061
12
- pyerualjetwork_afterburner/model_operations.py,sha256=MCSCNYiiICRVZITobtS3ZIWmH5Q9gjyELuH32sAdgg4,12649
13
- pyerualjetwork_afterburner/model_operations_cuda.py,sha256=NT01BK5nrDYE7H1x3KnSI8gmx0QTGGB0mP_LqEb1uuU,13157
14
- pyerualjetwork_afterburner/plan.py,sha256=Gxv8ii4brTYMzzFZBP-X6kkwc6w6vtTPiMmqVOAqoq8,21972
15
- pyerualjetwork_afterburner/plan_cuda.py,sha256=usyL-rWfczko8MQ-tmgMyt7UrKoH7IG3FX3edBiq-vc,22716
16
- pyerualjetwork_afterburner/planeat.py,sha256=Lq5R0aMS4UIdZdbUKsKDv5g0WLwYryomR3IQYb8vAa4,37573
17
- pyerualjetwork_afterburner/planeat_cuda.py,sha256=dZdKrrhdnoTjcF8Uv23Y4UvlOfizazNyx9v6QsdpIoo,37621
18
- pyerualjetwork_afterburner/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
19
- pyerualjetwork_afterburner/visualizations.py,sha256=1SKMZaJ80OD2qHUyMxW1IOv8zwmxzMPxclfbeq1Xr4g,28772
20
- pyerualjetwork_afterburner/visualizations_cuda.py,sha256=KbMhfsLlxujy_i3QrwCf734Q-k6d7Zn_7CEbm3gzK9w,29186
21
- pyerualjetwork-4.3.2.2b0.dist-info/METADATA,sha256=Tf7obBQU6PrXFUY6BYqV1LxQ5qfajCqzoaCCwXiigMY,7580
22
- pyerualjetwork-4.3.2.2b0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
- pyerualjetwork-4.3.2.2b0.dist-info/top_level.txt,sha256=FvvHDLjU_nUaZ9aHFWrPl-qPcJG_B3TFbrLNWg_TTBg,27
24
- pyerualjetwork-4.3.2.2b0.dist-info/RECORD,,