pyerualjetwork 4.3.9.dev1__py3-none-any.whl → 4.3.9.dev2__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.9dev1"
1
+ __version__ = "4.3.9dev2"
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__):
@@ -10,22 +10,30 @@ def diversity_score(population):
10
10
  individuals in the population
11
11
  :return: The function returns the diversity score,
12
12
  which is a measure of how spread out or diverse the population is in terms of their characteristics.
13
-
14
13
  """
15
-
16
14
  if len(population) < 2:
17
15
  return 0
18
-
16
+
19
17
  distances = pdist(population, metric='euclidean')
20
18
 
19
+ if np.isnan(distances).any() or np.any(distances == 0):
20
+ distances = np.maximum(distances, 1e-10)
21
21
  avg_distance = np.mean(distances)
22
-
22
+
23
+ if population.shape[1] == 0:
24
+ return 0
25
+
23
26
  max_possible_distance = np.sqrt(population.shape[1])
27
+
28
+ if max_possible_distance == 0:
29
+ max_possible_distance = 1e-10
30
+
24
31
  diversity = avg_distance / max_possible_distance
25
32
 
26
33
  return diversity
27
34
 
28
35
 
36
+
29
37
  def hybrid_accuracy_confidence(y_true, y_pred, diversity_score, accuracy, alpha=2, beta=1.5, lambda_div=0.05):
30
38
  """
31
39
  The function calculates a fitness score based on accuracy, margin loss, and diversity score using
pyerualjetwork/plan.py CHANGED
@@ -266,7 +266,7 @@ def learner(x_train, y_train, optimizer, fitness, fit_start=True, gen=None, batc
266
266
  print(f", Current Activations={final_activations}", end='')
267
267
 
268
268
  if batch_size == 1:
269
- postfix_dict[f"{data} Fitness"] = fit_score
269
+ postfix_dict[f"{data} Fitness"] = np.round(fit_score, 4)
270
270
  progress.set_postfix(postfix_dict)
271
271
  best_fit = fit_score
272
272
 
@@ -305,7 +305,7 @@ def learner(x_train, y_train, optimizer, fitness, fit_start=True, gen=None, batc
305
305
  print(f'Fitness Value: ', fit_score, '\n')
306
306
 
307
307
  postfix_dict[f"{data} Accuracy"] = np.round(train_model[get_acc()], 4)
308
- postfix_dict[f"{data} Fitness"] = best_fit
308
+ postfix_dict[f"{data} Fitness"] = np.round(best_fit, 4)
309
309
  progress.set_postfix(postfix_dict)
310
310
  # Display final visualizations
311
311
  display_visualizations_for_learner(viz_objects, best_weights, data, best_acc,
@@ -325,7 +325,7 @@ def learner(x_train, y_train, optimizer, fitness, fit_start=True, gen=None, batc
325
325
  print(f'Fitness Value: ', fit_score, '\n')
326
326
 
327
327
  postfix_dict[f"{data} Accuracy"] = np.round(train_model[get_acc()], 4)
328
- postfix_dict[f"{data} Fitness"] = best_fit
328
+ postfix_dict[f"{data} Fitness"] = np.round(best_fit, 4)
329
329
  progress.set_postfix(postfix_dict)
330
330
 
331
331
  best_acc_per_gen_list.append(train_model[get_acc()])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 4.3.9.dev1
3
+ Version: 4.3.9.dev2
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,9 +1,9 @@
1
- pyerualjetwork/__init__.py,sha256=TkG_18QqarnCsZ99v_XYRuWoDYGIh2dQErq5tUwJtNU,643
1
+ pyerualjetwork/__init__.py,sha256=9eOTCzpFVUX9DY_9CL8Cw_Z88H6-tD0Jnw8a-gKKiWg,643
2
2
  pyerualjetwork/activation_functions.py,sha256=bKf00lsuuLJNO-4vVp4OqBi4zJ-qZ8L3v-vl52notkY,7721
3
3
  pyerualjetwork/activation_functions_cuda.py,sha256=5y1Ti3GDfDteQDCUmODwe7tAyDAUlDTKmIikChQ8d6g,7772
4
4
  pyerualjetwork/data_operations.py,sha256=Flteouu6rfSo2uHMqBHuzO02dXmbNa-I5qWmUpGTZ5Y,14760
5
5
  pyerualjetwork/data_operations_cuda.py,sha256=ZcjmLXE1-HVwedextYdJZ1rgrns1OfSekzFpr1a9m6o,17625
6
- pyerualjetwork/fitness_functions.py,sha256=EkBCRWr70Y1yG0bc4styDUDkVxLwJ0wjirLKPh74-9U,3835
6
+ pyerualjetwork/fitness_functions.py,sha256=0tj1Ri8x8PXR9cuZF_PaUF3mjgsys0IRAEKklipKxZA,4064
7
7
  pyerualjetwork/help.py,sha256=nQ_YbYA2RtuafhuvkreNpX0WWL1I_nzlelwCtvei0_Y,775
8
8
  pyerualjetwork/loss_functions_cuda.py,sha256=C93IZJcrOpT6HMK9x1O4AHJWXYTkN5WZiqdssPbvAPk,617
9
9
  pyerualjetwork/memory_operations.py,sha256=I7QiZ--xSyRkFF0wcckPwZV7K9emEvyx5aJ3DiRHZFI,13468
@@ -11,14 +11,14 @@ pyerualjetwork/metrics.py,sha256=q7MkhnZDRbCjFBDDfUgrl8lBYnUT_1ro1LxeBq105pI,607
11
11
  pyerualjetwork/metrics_cuda.py,sha256=73h9GC7XwmnFCVzFEEiPQfF8CwHIz2wsCbxpZrJtYgw,5061
12
12
  pyerualjetwork/model_operations.py,sha256=MCSCNYiiICRVZITobtS3ZIWmH5Q9gjyELuH32sAdgg4,12649
13
13
  pyerualjetwork/model_operations_cuda.py,sha256=NT01BK5nrDYE7H1x3KnSI8gmx0QTGGB0mP_LqEb1uuU,13157
14
- pyerualjetwork/plan.py,sha256=p8OX4Qo3vxtKU74eO68I61ZHrKBju1p8sk4Pv6x8e2w,20413
14
+ pyerualjetwork/plan.py,sha256=vps6EHyHoFWBlp3g5BF3ygD4vIkFvvRsmB7xS0IJ70E,20452
15
15
  pyerualjetwork/plan_cuda.py,sha256=DCKWStOZhBq-NYKA2BQTKe3YgvDYuGtujtIr56ZBjiw,24477
16
16
  pyerualjetwork/planeat.py,sha256=OxwSjfSFPwh7kVrhnuAkr8Lrk73GB-Wk2ajUFIfZcbQ,37556
17
17
  pyerualjetwork/planeat_cuda.py,sha256=aTdBmhJeIKC58pssODtqVsdOtJP7W6TRmVyGHp7k_CM,37612
18
18
  pyerualjetwork/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
19
19
  pyerualjetwork/visualizations.py,sha256=08O5uEewuYiovZRX1uHWEHjn19LcnhndWYvqVN74xs0,28290
20
20
  pyerualjetwork/visualizations_cuda.py,sha256=PYRqj4QYUbuYMYcNwO8yaTPB-jK7E6kZHhTrAi0lwPU,28749
21
- pyerualjetwork-4.3.9.dev1.dist-info/METADATA,sha256=q2sjP-KKIkuv4idsaFXFY1MUu041vHy2jpvIoFmoLI0,7479
22
- pyerualjetwork-4.3.9.dev1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
- pyerualjetwork-4.3.9.dev1.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
24
- pyerualjetwork-4.3.9.dev1.dist-info/RECORD,,
21
+ pyerualjetwork-4.3.9.dev2.dist-info/METADATA,sha256=Z0nThYRtlJKsScG6ZRZYdPcBPU_GfIcxtE8oz1nFVRI,7479
22
+ pyerualjetwork-4.3.9.dev2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
+ pyerualjetwork-4.3.9.dev2.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
24
+ pyerualjetwork-4.3.9.dev2.dist-info/RECORD,,