pyerualjetwork 4.2.5__py3-none-any.whl → 4.2.6b1__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.
@@ -1,4 +1,4 @@
1
- __version__ = "4.2.5"
1
+ __version__ = "4.2.6b1"
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__):
pyerualjetwork/planeat.py CHANGED
@@ -15,6 +15,7 @@ ANAPLAN document: https://github.com/HCB06/Anaplan/blob/main/Welcome_to_Anaplan/
15
15
  import numpy as np
16
16
  import random
17
17
  import math
18
+ import copy
18
19
 
19
20
  ### LIBRARY IMPORTS ###
20
21
  from .plan import feed_forward
@@ -82,8 +83,7 @@ def evolver(weights,
82
83
  strategy='normal_selective',
83
84
  target_fitness='max',
84
85
  bad_genomes_mutation_prob=None,
85
- activation_mutate_prob=0.5,
86
- save_best_genome=True,
86
+ activation_mutate_prob=0.5,
87
87
  fitness_bias=None,
88
88
  cross_over_mode='tpm',
89
89
  activation_mutate_add_prob=0.5,
@@ -150,9 +150,6 @@ def evolver(weights,
150
150
  activation_mutate_prob (float, optional): The probability of applying mutation to the activation functions.
151
151
  Must be in the range [0, 1]. Default is 0.5 (50%).
152
152
 
153
- save_best_genom (bool, optional): If True, ensures that the best genomes are saved and not mutated
154
- or altered during reproduction. Default is True.
155
-
156
153
  cross_over_mode (str, optional): Specifies the crossover method to use. Options:
157
154
  - 'tpm': Two-Point Matrix Crossover.
158
155
  Default is 'tpm'.
@@ -274,6 +271,7 @@ def evolver(weights,
274
271
 
275
272
  if target_fitness == 'max': sort_indices = np.argsort(fitness)
276
273
  elif target_fitness == 'min': sort_indices = np.argsort(-fitness)
274
+ else: raise ValueError("target_fitness value just be 'max' or 'min'")
277
275
 
278
276
  fitness = fitness[sort_indices]
279
277
  weights = weights[sort_indices]
@@ -284,11 +282,11 @@ def evolver(weights,
284
282
 
285
283
  good_weights = weights[slice_center:]
286
284
  bad_weights = weights[:slice_center]
287
- best_weight = good_weights[-1]
285
+ best_weight = np.copy(good_weights[-1])
288
286
 
289
287
  good_activations = list(activation_potentiations[slice_center:])
290
288
  bad_activations = list(activation_potentiations[:slice_center])
291
- best_activations = good_activations[-1]
289
+ best_activations = copy.deepcopy(good_activations[-1])
292
290
 
293
291
 
294
292
  ### PLANEAT IS APPLIED ACCORDING TO THE SPECIFIED POLICY, STRATEGY, AND PROBABILITY CONFIGURATION:
@@ -302,10 +300,10 @@ def evolver(weights,
302
300
  epsilon = np.finfo(float).eps
303
301
 
304
302
  child_W = np.copy(bad_weights)
305
- child_act = bad_activations.copy()
303
+ child_act = copy.deepcopy(bad_activations)
306
304
 
307
305
  mutated_W = np.copy(bad_weights)
308
- mutated_act = bad_activations.copy()
306
+ mutated_act = copy.deepcopy(bad_activations)
309
307
 
310
308
  for i in range(len(bad_weights)):
311
309
 
@@ -363,9 +361,8 @@ def evolver(weights,
363
361
 
364
362
  if bar_status: progress.update(1)
365
363
 
366
- if save_best_genome:
367
- child_W[-1] = best_weight
368
- child_act[-1] = best_activations
364
+ child_W[0] = best_weight
365
+ child_act[0] = best_activations
369
366
 
370
367
  weights = np.vstack((child_W, mutated_W))
371
368
  activation_potentiations = child_act + mutated_act
@@ -395,13 +392,13 @@ def evolver(weights,
395
392
 
396
393
 
397
394
  print("*** Performance ***")
398
- print(" MAX FITNESS: ", str(round(max(fitness), 2)))
395
+ print(" MAX FITNESS: ", str(round(max(fitness) if target_fitness == 'max' else min(fitness), 2)))
399
396
  print(" MEAN FITNESS: ", str(round(np.mean(fitness), 2)))
400
- print(" MIN FITNESS: ", str(round(min(fitness), 2)) + '\n')
397
+ print(" MIN FITNESS: ", str(round(min(fitness)) if target_fitness == 'max' else max(fitness), 2) + '\n')
401
398
 
402
- print(" BEST GENOME ACTIVATION LENGTH: ", str(len(activation_potentiations[-1])))
403
- print(" BEST GENOME INDEX: ", str(len(weights)-1))
404
- print(" NOTE: Genomes are always sorted from the least successful to the most successful according to their performance ranking. Therefore, the genome at the last index is the king of the previous generation. " + '\n')
399
+ print(" BEST GENOME ACTIVATION LENGTH: ", str(len(best_activations)))
400
+ print(" BEST GENOME INDEX: ", str(0))
401
+ print(" NOTE: The returned genome at the first index is the best of the previous generation." + '\n')
405
402
 
406
403
 
407
404
  return weights, activation_potentiations
@@ -16,6 +16,7 @@ import cupy as cp
16
16
  import numpy as np
17
17
  import random
18
18
  import math
19
+ import copy
19
20
 
20
21
 
21
22
  ### LIBRARY IMPORTS ###
@@ -85,7 +86,6 @@ def evolver(weights,
85
86
  target_fitness='max',
86
87
  bad_genomes_mutation_prob=None,
87
88
  activation_mutate_prob=0.5,
88
- save_best_genome=True,
89
89
  fitness_bias=None,
90
90
  cross_over_mode='tpm',
91
91
  activation_mutate_add_prob=0.5,
@@ -152,9 +152,6 @@ def evolver(weights,
152
152
  activation_mutate_prob (float, optional): The probability of applying mutation to the activation functions.
153
153
  Must be in the range [0, 1]. Default is 0.5 (50%).
154
154
 
155
- save_best_genome (bool, optional): If True, ensures that the best genomes are saved and not mutated
156
- or altered during reproduction. Default is True.
157
-
158
155
  cross_over_mode (str, optional): Specifies the crossover method to use. Options:
159
156
  - 'tpm': Two-Point Matrix Crossover.
160
157
  Default is 'tpm'.
@@ -274,6 +271,7 @@ def evolver(weights,
274
271
 
275
272
  if target_fitness == 'max': sort_indices = cp.argsort(fitness)
276
273
  elif target_fitness == 'min': sort_indices = cp.argsort(-fitness)
274
+ else: raise ValueError("target_fitness value just be 'max' or 'min'")
277
275
 
278
276
  fitness = fitness[sort_indices]
279
277
  weights = weights[sort_indices]
@@ -284,11 +282,11 @@ def evolver(weights,
284
282
 
285
283
  good_weights = weights[slice_center:]
286
284
  bad_weights = weights[:slice_center]
287
- best_weight = good_weights[-1]
285
+ best_weight = cp.copy(good_weights[-1])
288
286
 
289
287
  good_activations = list(activation_potentiations[slice_center:])
290
288
  bad_activations = list(activation_potentiations[:slice_center])
291
- best_activations = good_activations[-1]
289
+ best_activations = copy.deepcopy(good_activations[-1])
292
290
 
293
291
 
294
292
  ### PLANEAT IS APPLIED ACCORDING TO THE SPECIFIED POLICY, STRATEGY, AND PROBABILITY CONFIGURATION:
@@ -302,10 +300,10 @@ def evolver(weights,
302
300
  epsilon = cp.finfo(float).eps
303
301
 
304
302
  child_W = cp.copy(bad_weights)
305
- child_act = bad_activations.copy()
303
+ child_act = copy.deepcopy(bad_activations)
306
304
 
307
305
  mutated_W = cp.copy(bad_weights)
308
- mutated_act = bad_activations.copy()
306
+ mutated_act = copy.deepcopy(bad_activations)
309
307
 
310
308
 
311
309
  for i in range(len(bad_weights)):
@@ -364,9 +362,8 @@ def evolver(weights,
364
362
 
365
363
  if bar_status: progress.update(1)
366
364
 
367
- if save_best_genome:
368
- child_W[-1] = best_weight
369
- child_act[-1] = best_activations
365
+ child_W[0] = best_weight
366
+ child_act[0] = best_activations
370
367
 
371
368
  weights = cp.vstack((child_W, mutated_W))
372
369
  activation_potentiations = child_act + mutated_act
@@ -394,13 +391,13 @@ def evolver(weights,
394
391
  print(" ACTIVATION SELECTION RATE (THRESHOLD VALUE FOR SINGLE CROSS OVER):", str(activation_selection_rate) + '\n')
395
392
 
396
393
  print("*** Performance ***")
397
- print(" MAX REWARD: ", str(cp.round(max(fitness), 2)))
398
- print(" MEAN REWARD: ", str(cp.round(cp.mean(fitness), 2)))
399
- print(" MIN REWARD: ", str(cp.round(min(fitness), 2)) + '\n')
394
+ print(" MAX FITNESS: ", str(cp.round(max(fitness) if target_fitness == 'max' else min(fitness), 2)))
395
+ print(" MEAN FITNESS: ", str(cp.round(cp.mean(fitness), 2)))
396
+ print(" MIN FITNESS: ", str(cp.round(min(fitness) if target_fitness == 'max' else max(fitness), 2)) + '\n')
400
397
 
401
398
  print(" BEST GENOME ACTIVATION LENGTH: ", str(len(activation_potentiations)))
402
- print(" BEST GENOME INDEX: ", str(len(weights)-1))
403
- print(" NOTE: Genomes are always sorted from the least successful to the most successful according to their performance ranking. Therefore, the genome at the last index is the king of the previous generation. " + '\n')
399
+ print(" BEST GENOME INDEX: ", str(0))
400
+ print(" NOTE: The returned genome at the first index is the best of the previous generation." + '\n')
404
401
 
405
402
 
406
403
  return weights, activation_potentiations
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 4.2.5
3
+ Version: 4.2.6b1
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
@@ -38,7 +38,6 @@ GitHub Page: https://github.com/HCB06/PyerualJetwork
38
38
  Optimized for Visual Studio Code
39
39
 
40
40
  requires=[
41
- 'setuptools==75.6.0',
42
41
  'scipy==1.13.1',
43
42
  'tqdm==4.66.4',
44
43
  'seaborn==0.13.2',
@@ -52,8 +51,6 @@ GitHub Page: https://github.com/HCB06/PyerualJetwork
52
51
  ]
53
52
 
54
53
  matplotlib, seaborn, networkx (optional).
55
- PyerualJetwork checks and install all dependencies with optional ones for every runing.
56
- If your version is higher or lower, PyerualJetwork automaticly delete other versions and installs this versions.
57
54
 
58
55
  ##############################
59
56
 
@@ -61,7 +58,7 @@ ABOUT PYERUALJETWORK:
61
58
 
62
59
  PyerualJetwork is a machine learning library written in Python for professionals, incorporating advanced, unique, new, and modern techniques with optimized GPU acceleration. Its most important component is the PLAN (Potentiation Learning Artificial Neural Network) https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4862342. (THIS ARTICLE IS FIRST VERSION OF PLAN.) MODERN VERSION OF PLAN: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PLAN/PLAN.pdf
63
60
  Both the PLAN algorithm and the PyerualJetwork library were created by Author, and all rights are reserved by Author.
64
- PyerualJetwork is free to use for commercial business and individual users. PyerualJetwork is written in fully functional programming with non-oop elements. PyerualJetwork consists of many functions that complement each other, which facilitates the learning process and debugging during use.
61
+ PyerualJetwork is free to use for commercial business and individual users.
65
62
  As of 12/21/2024, the library includes PLAN and PLANEAT module, but other machine learning modules are expected to be added in the future.
66
63
 
67
64
  PyerualJetwork ready for both eager execution(like PyTorch) and static graph(like Tensorflow) concepts because PyerualJetwork using only functions.
@@ -1,4 +1,4 @@
1
- pyerualjetwork/__init__.py,sha256=fV7YBz3b2FZMKUupZAxBk4wWAI7DPML7Xst0KZaosFA,639
1
+ pyerualjetwork/__init__.py,sha256=2ptsYxeF5I7fBMiVaPiz1IvDHgbuLch-ANuiLsreL_8,641
2
2
  pyerualjetwork/activation_functions.py,sha256=WWOdMd5pI6ZKe-ieKCIsKAYPQODHuXYxx7tzhA5xjes,11767
3
3
  pyerualjetwork/activation_functions_cuda.py,sha256=KmXJ5Cdig46XAMYakXFPEOlxSxtFJjD21-i3nGtxPjE,11807
4
4
  pyerualjetwork/data_operations.py,sha256=pb5CqJ0Th6fCjTNMCtqQMiwH3KezTxAijacglsKUxmY,14730
@@ -13,12 +13,12 @@ pyerualjetwork/model_operations.py,sha256=RKqnh7-MByFosxqme4q4jC1lOndX26O-OVXYV6
13
13
  pyerualjetwork/model_operations_cuda.py,sha256=XnKKq54ZLaqCm-NaJ6d8IToACKcKg2Ttq6moowVRRWo,13365
14
14
  pyerualjetwork/plan.py,sha256=UzCTFCA9cTv9ITCtsqfJ1g02rCMyescoIV6j1amvYGw,32134
15
15
  pyerualjetwork/plan_cuda.py,sha256=hpXZl3h7B1qAVYW-gZebwKMZd4-ftAZ-u05teOJjsno,33525
16
- pyerualjetwork/planeat.py,sha256=4XcmQhMHXA6hUWsDZXC2T3I18BeSP4V-GmPYToGR0kg,39638
17
- pyerualjetwork/planeat_cuda.py,sha256=xaDqH0kWwkmjx-YrBIuLoE1G26qk6rjuOvkH8oRWqyI,39598
16
+ pyerualjetwork/planeat.py,sha256=Z1GkhcD-zIQrSy8HY6ywT4xz6hM7HTKVJewMaFl9_k0,39471
17
+ pyerualjetwork/planeat_cuda.py,sha256=-uRgs4fQ0Zk7urDKDqvuWcsE5RJ6tXghGgt_pdcwPl4,39445
18
18
  pyerualjetwork/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
19
19
  pyerualjetwork/visualizations.py,sha256=1SKMZaJ80OD2qHUyMxW1IOv8zwmxzMPxclfbeq1Xr4g,28772
20
20
  pyerualjetwork/visualizations_cuda.py,sha256=KbMhfsLlxujy_i3QrwCf734Q-k6d7Zn_7CEbm3gzK9w,29186
21
- pyerualjetwork-4.2.5.dist-info/METADATA,sha256=jKYtON123TeRvm_ZF_Be0Jjki4e7pc-JLCWk6bnkfMQ,7912
22
- pyerualjetwork-4.2.5.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
- pyerualjetwork-4.2.5.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
24
- pyerualjetwork-4.2.5.dist-info/RECORD,,
21
+ pyerualjetwork-4.2.6b1.dist-info/METADATA,sha256=UV_m504Bd7zwKJ0WadzUeSdFqhPRsxm5jniDDDhEl1w,7454
22
+ pyerualjetwork-4.2.6b1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
+ pyerualjetwork-4.2.6b1.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
24
+ pyerualjetwork-4.2.6b1.dist-info/RECORD,,