pyerualjetwork 4.2.6b4__py3-none-any.whl → 4.2.6b5__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.6b4"
1
+ __version__ = "4.2.6b5"
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
@@ -80,8 +80,7 @@ def evolver(weights,
80
80
  policy='aggressive',
81
81
  bad_genomes_selection_prob=None,
82
82
  bar_status=True,
83
- strategy='normal_selective',
84
- target_fitness='max',
83
+ strategy='normal_selective',
85
84
  bad_genomes_mutation_prob=None,
86
85
  activation_mutate_prob=0.5,
87
86
  fitness_bias=None,
@@ -139,8 +138,6 @@ def evolver(weights,
139
138
 
140
139
  Default: 'aggressive'.
141
140
 
142
- target_fitness (str, optional): Target fitness strategy for PLANEAT optimization. ('max' maximizes fitness, 'min' minimizes fitness.) Default: 'max'.
143
-
144
141
  fitness_bias (float, optional): Fitness bias must be a probability value between 0 and 1 that determines the effect of fitness on the crossover process. Default: Determined by the `strategy`.
145
142
 
146
143
  bad_genomes_mutation_prob (float, optional): The probability of applying mutation to the bad genomes.
@@ -267,11 +264,9 @@ def evolver(weights,
267
264
  raise ValueError("genome population size must be even number. for example: not 99, make 100 or 98.")
268
265
 
269
266
 
270
- ### FITNESS IS SORTED IN ASCENDING (OR DESCENDING) ORDER, AND THE WEIGHT AND ACTIVATIONS OF EACH GENOME ARE SORTED ACCORDING TO THIS ORDER:
267
+ ### FITNESS IS SORTED IN ASCENDING ORDER, AND THE WEIGHT AND ACTIVATIONS OF EACH GENOME ARE SORTED ACCORDING TO THIS ORDER:
271
268
 
272
- if target_fitness == 'max': sort_indices = np.argsort(fitness)
273
- elif target_fitness == 'min': sort_indices = np.argsort(-fitness)
274
- else: raise ValueError("target_fitness value just be 'max' or 'min'")
269
+ sort_indices = np.argsort(fitness)
275
270
 
276
271
  fitness = fitness[sort_indices]
277
272
  weights = weights[sort_indices]
@@ -294,7 +289,7 @@ def evolver(weights,
294
289
  bar_format = loading_bars()[0]
295
290
 
296
291
  if bar_status: progress = initialize_loading_bar(len(bad_weights), desc="GENERATION: " + str(what_gen), bar_format=bar_format, ncols=50)
297
- normalized_fitness = abs(normalization(fitness, dtype=dtype))
292
+ normalized_fitness = normalization(fitness, dtype=dtype)
298
293
 
299
294
  best_fitness = normalized_fitness[-1]
300
295
  epsilon = np.finfo(float).eps
@@ -392,9 +387,9 @@ def evolver(weights,
392
387
 
393
388
 
394
389
  print("*** Performance ***")
395
- print(" MAX FITNESS: ", str(round(max(fitness) if target_fitness == 'max' else min(fitness), 2)))
390
+ print(" MAX FITNESS: ", str(round(max(fitness), 2)))
396
391
  print(" MEAN FITNESS: ", str(round(np.mean(fitness), 2)))
397
- print(" MIN FITNESS: ", str(round(min(fitness) if target_fitness == 'max' else max(fitness), 2)) + '\n')
392
+ print(" MIN FITNESS: ", str(round(min(fitness), 2)) + '\n')
398
393
 
399
394
  print(" BEST GENOME ACTIVATION LENGTH: ", str(len(best_activations)))
400
395
  print(" BEST GENOME INDEX: ", str(0))
@@ -723,6 +718,8 @@ def mutation(weight,
723
718
  row_end = weight.shape[0]
724
719
  col_end = weight.shape[1]
725
720
 
721
+ max_threshold = row_end * col_end
722
+
726
723
  threshold = threshold * genome_fitness
727
724
  performance_control = 0
728
725
  new_threshold = threshold
@@ -734,7 +731,7 @@ def mutation(weight,
734
731
 
735
732
  weight[selected_row, selected_col] = random.uniform(-1, 1)
736
733
 
737
- if row_end * col_end > new_threshold:
734
+ if max_threshold > new_threshold:
738
735
  new_threshold += threshold
739
736
  performance_control += 1
740
737
  pass
@@ -742,7 +739,7 @@ def mutation(weight,
742
739
  else:
743
740
  break
744
741
 
745
- if performance_control == row_end * col_end:
742
+ if performance_control == max_threshold:
746
743
  break
747
744
 
748
745
  activation_mutate_prob = 1 - activation_mutate_prob
@@ -82,8 +82,7 @@ def evolver(weights,
82
82
  policy='aggressive',
83
83
  bad_genomes_selection_prob=None,
84
84
  bar_status=True,
85
- strategy='normal_selective',
86
- target_fitness='max',
85
+ strategy='normal_selective',
87
86
  bad_genomes_mutation_prob=None,
88
87
  activation_mutate_prob=0.5,
89
88
  fitness_bias=None,
@@ -141,8 +140,6 @@ def evolver(weights,
141
140
 
142
141
  Default: 'aggressive'.
143
142
 
144
- target_fitness (str, optional): Target fitness strategy for PLANEAT optimization. ('max' maximizes fitness, 'min' minimizes fitness.) Default: 'max'.
145
-
146
143
  fitness_bias (float, optional): Fitness bias must be a probability value between 0 and 1 that determines the effect of fitness on the crossover process. Default: Determined by the `strategy`.
147
144
 
148
145
  bad_genomes_mutation_prob (float, optional): The probability of applying mutation to the bad genomes.
@@ -267,11 +264,9 @@ def evolver(weights,
267
264
  else:
268
265
  raise ValueError("genome population size must be even number. for example: not 99, make 100 or 98.")
269
266
 
270
- ### FITNESS LIST IS SORTED IN ASCENDING (OR DESCENDING) ORDER, AND THE WEIGHT AND ACTIVATIONS OF EACH GENOME ARE SORTED ACCORDING TO THIS ORDER:
267
+ ### FITNESS LIST IS SORTED IN ASCENDING ORDER, AND THE WEIGHT AND ACTIVATIONS OF EACH GENOME ARE SORTED ACCORDING TO THIS ORDER:
271
268
 
272
- if target_fitness == 'max': sort_indices = cp.argsort(fitness)
273
- elif target_fitness == 'min': sort_indices = cp.argsort(-fitness)
274
- else: raise ValueError("target_fitness value just be 'max' or 'min'")
269
+ sort_indices = cp.argsort(fitness)
275
270
 
276
271
  fitness = fitness[sort_indices]
277
272
  weights = weights[sort_indices]
@@ -294,7 +289,7 @@ def evolver(weights,
294
289
  bar_format = loading_bars()[0]
295
290
 
296
291
  if bar_status: progress = initialize_loading_bar(len(bad_weights), desc="GENERATION: " + str(what_gen), bar_format=bar_format, ncols=50)
297
- normalized_fitness = abs(normalization(fitness, dtype=dtype))
292
+ normalized_fitness = normalization(fitness, dtype=dtype)
298
293
 
299
294
  best_fitness = normalized_fitness[-1]
300
295
  epsilon = cp.finfo(float).eps
@@ -391,9 +386,9 @@ def evolver(weights,
391
386
  print(" ACTIVATION SELECTION RATE (THRESHOLD VALUE FOR SINGLE CROSS OVER):", str(activation_selection_rate) + '\n')
392
387
 
393
388
  print("*** Performance ***")
394
- print(" MAX FITNESS: ", str(cp.round(max(fitness) if target_fitness == 'max' else min(fitness), 2)))
389
+ print(" MAX FITNESS: ", str(cp.round(max(fitness), 2)))
395
390
  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')
391
+ print(" MIN FITNESS: ", str(cp.round(min(fitness), 2)) + '\n')
397
392
 
398
393
  print(" BEST GENOME ACTIVATION LENGTH: ", str(len(best_activations)))
399
394
  print(" BEST GENOME INDEX: ", str(0))
@@ -728,6 +723,8 @@ def mutation(weight,
728
723
  row_end = weight.shape[0]
729
724
  col_end = weight.shape[1]
730
725
 
726
+ max_threshold = row_end * col_end
727
+
731
728
  threshold = threshold * genome_fitness
732
729
  new_threshold = threshold
733
730
  performance_control = 0
@@ -739,7 +736,7 @@ def mutation(weight,
739
736
 
740
737
  weight[selected_row, selected_col] = random.uniform(-1, 1)
741
738
 
742
- if row_end * col_end > new_threshold:
739
+ if max_threshold > new_threshold:
743
740
  new_threshold += threshold
744
741
  performance_control += 1
745
742
  pass
@@ -747,7 +744,7 @@ def mutation(weight,
747
744
  else:
748
745
  break
749
746
 
750
- if performance_control >= row_end * col_end:
747
+ if performance_control >= max_threshold:
751
748
  break
752
749
 
753
750
  activation_mutate_prob = 1 - activation_mutate_prob
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 4.2.6b4
3
+ Version: 4.2.6b5
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
@@ -1,4 +1,4 @@
1
- pyerualjetwork/__init__.py,sha256=cIpTTofdkjdawzPao9akwNsuJiiwxZY_hN0yqnnGotM,641
1
+ pyerualjetwork/__init__.py,sha256=WJx_mse0F24olFu7UTTdp1hmwoBuxOT9H-yiWFYMT7E,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=4EDpzVJYYy4eQxzhExb0N_8Rm7nbCgbtcFiJUqniVe8,39471
17
- pyerualjetwork/planeat_cuda.py,sha256=r2wh_d0otzbBtoac5lmSrQ4NRRcEBI6smkepZttpfoU,39437
16
+ pyerualjetwork/planeat.py,sha256=0MqHcL0hSV7YjXWvtb76E28dISDdhh07y9nBplGO9OQ,39021
17
+ pyerualjetwork/planeat_cuda.py,sha256=mt-24cck832ivBV4p365h35k3gQ8Vh34Frqky24ux_A,38986
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.6b4.dist-info/METADATA,sha256=eo7p5H-9hn8bOtfwvgtdrNbyDcQmZxcJu4L0b0noBVM,7454
22
- pyerualjetwork-4.2.6b4.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
- pyerualjetwork-4.2.6b4.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
24
- pyerualjetwork-4.2.6b4.dist-info/RECORD,,
21
+ pyerualjetwork-4.2.6b5.dist-info/METADATA,sha256=GHv-_EjAeoOxF2840CHn7lpa7S0p5sKqxpeCwbBtzJg,7454
22
+ pyerualjetwork-4.2.6b5.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
+ pyerualjetwork-4.2.6b5.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
24
+ pyerualjetwork-4.2.6b5.dist-info/RECORD,,