pyerualjetwork 4.3.8.dev6__py3-none-any.whl → 4.3.8.dev8__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.3.8dev6"
1
+ __version__ = "4.3.8dev8"
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__):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 4.3.8.dev6
3
+ Version: 4.3.8.dev8
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=olCEbcpfxR8QpQvxMzMKJtKcpSevTnsDX7lI96-QHyY,643
1
+ pyerualjetwork/__init__.py,sha256=zfc7DhJ830NhikbydkRIIf0Kbji_veR8aEskZeY6XEo,643
2
2
  pyerualjetwork/activation_functions.py,sha256=AR91fQV2W2rc-Qb4Yp7b8ucYpGjwyQUewO-M-lyEMs8,7729
3
3
  pyerualjetwork/activation_functions_cuda.py,sha256=ztIw6rMR4t1289_TPIGYwE6qarl_YbSOGj5Ep3rUMqs,11803
4
4
  pyerualjetwork/data_operations.py,sha256=Flteouu6rfSo2uHMqBHuzO02dXmbNa-I5qWmUpGTZ5Y,14760
@@ -18,7 +18,7 @@ pyerualjetwork/planeat_cuda.py,sha256=QNHCQLkR0MNFqyN2iHAtC7cbf8qZiD3p_54YH3lnMF
18
18
  pyerualjetwork/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
19
19
  pyerualjetwork/visualizations.py,sha256=VL00sX2DZz83F__PyEJH9s1LizuXpOBzWjnoSjMJIJ0,28770
20
20
  pyerualjetwork/visualizations_cuda.py,sha256=KbMhfsLlxujy_i3QrwCf734Q-k6d7Zn_7CEbm3gzK9w,29186
21
- pyerualjetwork_afterburner/__init__.py,sha256=ziEOwTxIO9tl2N63bre_zkIPjmpQ-3iCuRNkFJO0YS4,655
21
+ pyerualjetwork_afterburner/__init__.py,sha256=rurrD8ySN0khMCA992NnKKgZYs01mFhyZprHSE-7ROw,655
22
22
  pyerualjetwork_afterburner/activation_functions.py,sha256=bKf00lsuuLJNO-4vVp4OqBi4zJ-qZ8L3v-vl52notkY,7721
23
23
  pyerualjetwork_afterburner/activation_functions_cuda.py,sha256=5y1Ti3GDfDteQDCUmODwe7tAyDAUlDTKmIikChQ8d6g,7772
24
24
  pyerualjetwork_afterburner/data_operations.py,sha256=Flteouu6rfSo2uHMqBHuzO02dXmbNa-I5qWmUpGTZ5Y,14760
@@ -34,11 +34,11 @@ pyerualjetwork_afterburner/model_operations_cuda.py,sha256=NT01BK5nrDYE7H1x3KnSI
34
34
  pyerualjetwork_afterburner/plan.py,sha256=EOXngujG7DQRf3cooFigKB7heQsEoK96JtrcKivT_pE,22449
35
35
  pyerualjetwork_afterburner/plan_cuda.py,sha256=fg5YunEuBE7sK6q9paP_yAGONr9x0e19oF0J0DucejM,23380
36
36
  pyerualjetwork_afterburner/planeat.py,sha256=Lq5R0aMS4UIdZdbUKsKDv5g0WLwYryomR3IQYb8vAa4,37573
37
- pyerualjetwork_afterburner/planeat_cuda.py,sha256=XS-latsokCvxvUbbGRALen35w3JJQJoIWIeFFtTl_7w,39942
37
+ pyerualjetwork_afterburner/planeat_cuda.py,sha256=IS1d36f7d3aRcGH_7ne3gEnG67MAOyYFs2jnHBT-coI,39672
38
38
  pyerualjetwork_afterburner/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
39
39
  pyerualjetwork_afterburner/visualizations.py,sha256=1SKMZaJ80OD2qHUyMxW1IOv8zwmxzMPxclfbeq1Xr4g,28772
40
40
  pyerualjetwork_afterburner/visualizations_cuda.py,sha256=KbMhfsLlxujy_i3QrwCf734Q-k6d7Zn_7CEbm3gzK9w,29186
41
- pyerualjetwork-4.3.8.dev6.dist-info/METADATA,sha256=Kg8zdJAToUWOeWr9cBYG_wDFzLykd6BTn_diSLmgaQc,8384
42
- pyerualjetwork-4.3.8.dev6.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
43
- pyerualjetwork-4.3.8.dev6.dist-info/top_level.txt,sha256=uK64ge08QQoPuXM3aiRVPgiQQtl8Fxm2-HieIut5Lwo,42
44
- pyerualjetwork-4.3.8.dev6.dist-info/RECORD,,
41
+ pyerualjetwork-4.3.8.dev8.dist-info/METADATA,sha256=GefOazSptWtgfbBRqQfm8S1MwAGh_kuaHu0MydzllUE,8384
42
+ pyerualjetwork-4.3.8.dev8.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
43
+ pyerualjetwork-4.3.8.dev8.dist-info/top_level.txt,sha256=uK64ge08QQoPuXM3aiRVPgiQQtl8Fxm2-HieIut5Lwo,42
44
+ pyerualjetwork-4.3.8.dev8.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
- __version__ = "4.3.8dev6-afterburner"
1
+ __version__ = "4.3.8dev8-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__):
@@ -298,30 +298,38 @@ def evolver(weights,
298
298
  mutated_W = cp.copy(bad_weights)
299
299
  mutated_act = bad_activations.copy()
300
300
 
301
- with mp.Pool() as pool:
302
- process_func = partial(process_single, policy=policy, best_weight=best_weight,
303
- best_activations=best_activations, good_weights=good_weights,
304
- good_activations=good_activations, bad_weights=bad_weights,
305
- bad_activations=bad_activations, best_fitness=best_fitness,
306
- normalized_fitness=normalized_fitness, child_W=child_W,
307
- child_act=child_act, mutated_W=mutated_W, mutated_act=mutated_act,
308
- cross_over_mode=cross_over_mode,
309
- activation_selection_add_prob=activation_selection_add_prob,
310
- activation_selection_change_prob=activation_selection_change_prob,
311
- activation_selection_threshold=activation_selection_threshold,
312
- bad_genomes_selection_prob=bad_genomes_selection_prob,
313
- fitness_bias=fitness_bias,
314
- epsilon=epsilon,
315
- bad_genomes_mutation_prob=bad_genomes_mutation_prob,
316
- activation_mutate_prob=activation_mutate_prob,
317
- activation_mutate_add_prob=activation_mutate_add_prob,
318
- activation_mutate_delete_prob=activation_mutate_delete_prob,
319
- activation_mutate_change_prob=activation_mutate_change_prob,
320
- weight_mutate_prob=weight_mutate_prob,
321
- weight_mutate_threshold=weight_mutate_threshold,
322
- activation_mutate_threshold=activation_mutate_threshold)
323
-
324
- pool.map(process_func, range(len(bad_weights)))
301
+ if __name__ == '__main__':
302
+ with mp.Pool() as pool:
303
+ process_func = partial(process_single, policy=policy, best_weight=best_weight,
304
+ best_activations=best_activations, good_weights=good_weights,
305
+ good_activations=good_activations, bad_weights=bad_weights,
306
+ bad_activations=bad_activations, best_fitness=best_fitness,
307
+ normalized_fitness=normalized_fitness, child_W=child_W,
308
+ child_act=child_act, mutated_W=mutated_W, mutated_act=mutated_act,
309
+ cross_over_mode=cross_over_mode,
310
+ activation_selection_add_prob=activation_selection_add_prob,
311
+ activation_selection_change_prob=activation_selection_change_prob,
312
+ activation_selection_threshold=activation_selection_threshold,
313
+ bad_genomes_selection_prob=bad_genomes_selection_prob,
314
+ fitness_bias=fitness_bias,
315
+ epsilon=epsilon,
316
+ bad_genomes_mutation_prob=bad_genomes_mutation_prob,
317
+ activation_mutate_prob=activation_mutate_prob,
318
+ activation_mutate_add_prob=activation_mutate_add_prob,
319
+ activation_mutate_delete_prob=activation_mutate_delete_prob,
320
+ activation_mutate_change_prob=activation_mutate_change_prob,
321
+ weight_mutate_prob=weight_mutate_prob,
322
+ weight_mutate_threshold=weight_mutate_threshold,
323
+ activation_mutate_threshold=activation_mutate_threshold)
324
+
325
+ with mp.Pool() as pool:
326
+ results = pool.map(process_func, range(len(bad_weights)))
327
+
328
+ for i, new_child_W, new_child_act, new_mutated_W, new_mutated_act in results:
329
+ child_W[i] = new_child_W
330
+ child_act[i] = new_child_act
331
+ mutated_W[i] = new_mutated_W
332
+ mutated_act[i] = new_mutated_act
325
333
 
326
334
  child_W[0] = best_weight
327
335
  child_act[0] = best_activations
@@ -366,39 +374,47 @@ def evolver(weights,
366
374
  return weights, activation_potentiations
367
375
 
368
376
 
369
- def process_single(i, policy, best_weight, best_activations, good_weights, good_activations,
370
- bad_weights, bad_activations, best_fitness, normalized_fitness, child_W, child_act,
371
- mutated_W, mutated_act, cross_over_mode,
372
- activation_selection_add_prob, activation_selection_change_prob,
373
- activation_selection_threshold, bad_genomes_selection_prob, fitness_bias,
374
- epsilon, bad_genomes_mutation_prob, activation_mutate_prob,
375
- activation_mutate_add_prob, activation_mutate_delete_prob,
376
- activation_mutate_change_prob, weight_mutate_prob, weight_mutate_threshold,
377
- activation_mutate_threshold):
377
+ def process_single(i, policy, best_weight, best_activations,
378
+ good_weights, good_activations,
379
+ bad_weights, bad_activations,
380
+ best_fitness, normalized_fitness,
381
+ cross_over_mode,
382
+ activation_selection_add_prob, activation_selection_change_prob,
383
+ activation_selection_threshold,
384
+ bad_genomes_selection_prob, fitness_bias,
385
+ epsilon, bad_genomes_mutation_prob,
386
+ activation_mutate_prob, activation_mutate_add_prob,
387
+ activation_mutate_delete_prob, activation_mutate_change_prob,
388
+ weight_mutate_prob, weight_mutate_threshold,
389
+ activation_mutate_threshold):
390
+
378
391
  if policy == 'aggressive':
379
392
  first_parent_W = best_weight
380
393
  first_parent_act = best_activations
381
394
  elif policy == 'explorer':
382
395
  first_parent_W = good_weights[i]
383
396
  first_parent_act = good_activations[i]
384
- else:
397
+ else:
385
398
  raise ValueError("policy parameter must be: 'aggressive' or 'explorer'")
386
399
 
387
- second_parent_W, second_parent_act, s_i = second_parent_selection(good_weights, bad_weights, good_activations, bad_activations, bad_genomes_selection_prob)
388
- child_W[i], child_act[i] = cross_over(first_parent_W,
389
- second_parent_W,
390
- first_parent_act,
391
- second_parent_act,
392
- cross_over_mode=cross_over_mode,
393
- activation_selection_add_prob=activation_selection_add_prob,
394
- activation_selection_change_prob=activation_selection_change_prob,
395
- activation_selection_threshold=activation_selection_threshold,
396
- bad_genomes_selection_prob=bad_genomes_selection_prob,
397
- first_parent_fitness=best_fitness,
398
- fitness_bias=fitness_bias,
399
- second_parent_fitness=normalized_fitness[s_i],
400
- epsilon=epsilon
401
- )
400
+ second_parent_W, second_parent_act, s_i = second_parent_selection(
401
+ good_weights, bad_weights, good_activations, bad_activations, bad_genomes_selection_prob)
402
+
403
+ new_child_W, new_child_act = cross_over(
404
+ first_parent_W,
405
+ second_parent_W,
406
+ first_parent_act,
407
+ second_parent_act,
408
+ cross_over_mode=cross_over_mode,
409
+ activation_selection_add_prob=activation_selection_add_prob,
410
+ activation_selection_change_prob=activation_selection_change_prob,
411
+ activation_selection_threshold=activation_selection_threshold,
412
+ bad_genomes_selection_prob=bad_genomes_selection_prob,
413
+ first_parent_fitness=best_fitness,
414
+ fitness_bias=fitness_bias,
415
+ second_parent_fitness=normalized_fitness[s_i],
416
+ epsilon=epsilon
417
+ )
402
418
 
403
419
  mutation_prob = random.uniform(0, 1)
404
420
  if mutation_prob > bad_genomes_mutation_prob:
@@ -410,18 +426,22 @@ def process_single(i, policy, best_weight, best_activations, good_weights, good_
410
426
  genome_act = bad_activations[i]
411
427
  fitness_index = i
412
428
 
413
- mutated_W[i], mutated_act[i] = mutation(genome_W,
414
- genome_act,
415
- activation_mutate_prob=activation_mutate_prob,
416
- activation_add_prob=activation_mutate_add_prob,
417
- activation_delete_prob=activation_mutate_delete_prob,
418
- activation_change_prob=activation_mutate_change_prob,
419
- weight_mutate_prob=weight_mutate_prob,
420
- weight_mutate_threshold=weight_mutate_threshold,
421
- genome_fitness=normalized_fitness[fitness_index],
422
- activation_mutate_threshold=activation_mutate_threshold,
423
- epsilon=epsilon
424
- )
429
+ new_mutated_W, new_mutated_act = mutation(
430
+ genome_W,
431
+ genome_act,
432
+ activation_mutate_prob=activation_mutate_prob,
433
+ activation_add_prob=activation_mutate_add_prob,
434
+ activation_delete_prob=activation_mutate_delete_prob,
435
+ activation_change_prob=activation_mutate_change_prob,
436
+ weight_mutate_prob=weight_mutate_prob,
437
+ weight_mutate_threshold=weight_mutate_threshold,
438
+ genome_fitness=normalized_fitness[fitness_index],
439
+ activation_mutate_threshold=activation_mutate_threshold,
440
+ epsilon=epsilon
441
+ )
442
+
443
+ return (i, new_child_W, new_child_act, new_mutated_W, new_mutated_act)
444
+
425
445
 
426
446
  def evaluate(x_population, weights, activation_potentiations):
427
447
  """