pyerualjetwork 4.1.8b8__py3-none-any.whl → 4.1.9b0__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.
@@ -48,7 +48,7 @@ for package_name in package_names:
48
48
 
49
49
  print(f"PyerualJetwork is ready to use with {err} errors")
50
50
 
51
- __version__ = "4.1.8b8"
51
+ __version__ = "4.1.9b"
52
52
  __update__ = "* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES\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"
53
53
 
54
54
  def print_version(__version__):
pyerualjetwork/plan.py CHANGED
@@ -16,6 +16,7 @@ PYERUALJETWORK document: https://github.com/HCB06/PyerualJetwork/blob/main/Welco
16
16
  import numpy as np
17
17
  from colorama import Fore
18
18
  import math
19
+ import random
19
20
 
20
21
  ### LIBRARY IMPORTS ###
21
22
  from .ui import loading_bars, initialize_loading_bar
@@ -176,7 +177,7 @@ def learner(x_train, y_train, optimizer, x_test=None, y_test=None, strategy='acc
176
177
  neural_web_history=False, show_current_activations=False, auto_normalization=True,
177
178
  neurons_history=False, early_stop=False, loss='categorical_crossentropy', show_history=False,
178
179
  interval=33.33, target_acc=None, target_loss=None, except_this=None,
179
- only_this=None, start_this_act=None, start_this_W=None, target_fitness='max', dtype=np.float32):
180
+ only_this=None, start_this_act=None, start_this_W=None, target_fitness='max', pop_size=None, dtype=np.float32):
180
181
  """
181
182
  Optimizes the activation functions for a neural network by leveraging train data to find
182
183
  the most accurate combination of activation potentiation for the given dataset using genetic algorithm NEAT (Neuroevolution of Augmenting Topologies). But modifided for PLAN version. Created by me: PLANEAT.
@@ -281,6 +282,13 @@ def learner(x_train, y_train, optimizer, x_test=None, y_test=None, strategy='acc
281
282
  if gen is None:
282
283
  gen = len(activation_potentiation)
283
284
 
285
+ if pop_size is not None and pop_size > len(activation_potentiation):
286
+ for i in range(pop_size - len(activation_potentiation)):
287
+ rand_index = random.randint(0, len(activation_potentiation)-1)
288
+ activation_potentiation.append(all_activations()[rand_index])
289
+
290
+ elif pop_size is not None and pop_size < len(activation_potentiation): raise ValueError(f"'pop_size' must be greater then activation_potentiation list length. But your act pot list length: {len(activation_potentiation)}")
291
+
284
292
  if strategy != 'accuracy' and strategy != 'f1' and strategy != 'recall' and strategy != 'precision': raise ValueError("Strategy parameter only be 'accuracy' or 'f1' or 'recall' or 'precision'.")
285
293
 
286
294
  if start_this_act is None and len(activation_potentiation) % 2 != 0: raise ValueError("Activation length must be even number. Please use 'except_this' parameter and except some activation. For example: except_this=['linear']")
@@ -642,7 +642,6 @@ def evaluate(
642
642
  Returns:
643
643
  tuple: Model (list).
644
644
  """
645
- from memory_operations import transfer_to_cpu, transfer_to_gpu
646
645
 
647
646
  if memory == 'gpu':
648
647
  x_test = transfer_to_gpu(x_test, dtype=dtype)
@@ -358,7 +358,7 @@ def plot_evaluate(x_test, y_test, y_preds, acc_list, W, activation_potentiation)
358
358
  fpr, tpr, thresholds = roc_curve(y_true, y_preds)
359
359
 
360
360
  roc_auc = cp.trapz(tpr, fpr)
361
- axs[1, 0].plot(fpr, tpr, color='darkorange', lw=2, label=f'ROC curve (area = {roc_auc:.2f})')
361
+ axs[1, 0].plot(fpr.get(), tpr.get(), color='darkorange', lw=2, label=f'ROC curve (area = {roc_auc:.2f})')
362
362
  axs[1, 0].plot([0, 1], [0, 1], color='navy', lw=2, linestyle='--')
363
363
  axs[1, 0].set_xlim([0.0, 1.0])
364
364
  axs[1, 0].set_ylim([0.0, 1.05])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 4.1.8b8
3
+ Version: 4.1.9b0
4
4
  Summary: PyerualJetwork is a machine learning library written in Python for professionals, incorporating advanced, unique, new, and modern techniques.
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -1,4 +1,4 @@
1
- pyerualjetwork/__init__.py,sha256=yLAnyJhLj2rr99TNrfahjlm_wXoBPhNtJZ_LwI0Wqt4,2177
1
+ pyerualjetwork/__init__.py,sha256=EtPPgs8XzwZUjvP5QH-GZ6s-QvjoKmYTTQ923URcGgk,2176
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=ZM24BuPsIAtI0a_Exr4HgCjmlb285wEeO8juFY9sJr0,14680
@@ -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=hnhR8dtoICNJWIwGgJ65-LN3GYN_DYH4LMe6YpZVbnI,12967
13
13
  pyerualjetwork/model_operations_cuda.py,sha256=XnKKq54ZLaqCm-NaJ6d8IToACKcKg2Ttq6moowVRRWo,13365
14
- pyerualjetwork/plan.py,sha256=5znxbnGO-3aL_SRDMRNNrDPJs_6hgU8yGiFnwPy69EY,34320
15
- pyerualjetwork/plan_cuda.py,sha256=l90LFEraFEsryZnuqxd1C-d8TDIlMnb5mzgVzSOEP7w,36051
14
+ pyerualjetwork/plan.py,sha256=1omZw3azcn4MM7SFgpnvow4oOBp3l1skc49eJoUK1pY,34872
15
+ pyerualjetwork/plan_cuda.py,sha256=KoKjsoWTLM-q07G1Gy0-LYXGlp15Fno6JqHz-Jzi_yE,35983
16
16
  pyerualjetwork/planeat.py,sha256=VtWtWndbKoFNYTWd1EsyKBV4Vp5U6cc7uWDgQ4WjHqo,40248
17
17
  pyerualjetwork/planeat_cuda.py,sha256=fSn28ZbxctPvBjpKgtv_uGwwUdTEXkBizy76mMlZYJ0,40237
18
18
  pyerualjetwork/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
19
19
  pyerualjetwork/visualizations.py,sha256=QaYSIyVkJZ8NqpBKArQKkI1y37nCQo_KIM98IMssnRc,28766
20
- pyerualjetwork/visualizations_cuda.py,sha256=9qw46Y4bo67l0nVVF1FSNS8ksyzbIAJdaPDFOhN5J8Y,29188
21
- pyerualjetwork-4.1.8b8.dist-info/METADATA,sha256=XoD9Pa3QKwU_t6FSuY0bGNg-2p-J2xM0oagjSzs6a9g,7795
22
- pyerualjetwork-4.1.8b8.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
- pyerualjetwork-4.1.8b8.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
24
- pyerualjetwork-4.1.8b8.dist-info/RECORD,,
20
+ pyerualjetwork/visualizations_cuda.py,sha256=F60vQ92AXlMgBka3InXnOtGoM25vQJAlBIU2AlYTwks,29200
21
+ pyerualjetwork-4.1.9b0.dist-info/METADATA,sha256=OgdChVct5X3byFsrA1wWOp_hn3EFL4GiQW23MEGlLXQ,7795
22
+ pyerualjetwork-4.1.9b0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
23
+ pyerualjetwork-4.1.9b0.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
24
+ pyerualjetwork-4.1.9b0.dist-info/RECORD,,