pyerualjetwork 5.45b0__py3-none-any.whl → 5.47__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.
@@ -42,7 +42,7 @@ PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welco
42
42
  - Contact: tchasancan@gmail.com
43
43
  """
44
44
 
45
- __version__ = "5.45b0"
45
+ __version__ = "5.47"
46
46
  __update__ = """* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES
47
47
  * PyerualJetwork Homepage: https://github.com/HCB06/PyerualJetwork/tree/main
48
48
  * PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf
@@ -275,7 +275,7 @@ def draw_activations(x_train, activation):
275
275
  return x_train
276
276
 
277
277
 
278
- def plot_evaluate(x_test, y_test, y_preds, model, cuda=False):
278
+ def plot_evaluate(x_test, y_test, y_preds, model, acc, cuda=False):
279
279
 
280
280
  if not cuda:
281
281
  from .metrics import metrics, confusion_matrix, roc_curve
@@ -287,8 +287,6 @@ def plot_evaluate(x_test, y_test, y_preds, model, cuda=False):
287
287
 
288
288
  from ..model_ops import predict_from_memory
289
289
 
290
- acc = model.accuracy
291
-
292
290
  y_true = decode_one_hot(y_test)
293
291
  y_preds = decode_one_hot(y_preds)
294
292
 
pyerualjetwork/nn.py CHANGED
@@ -95,14 +95,13 @@ def plan_fit(
95
95
  Returns:
96
96
  numpyarray: (Weight matrix).
97
97
  """
98
-
98
+
99
+ from .cpu.data_ops import normalization
99
100
  if not cuda:
100
- from .cpu.data_ops import normalization
101
- from .cpu.activation_functions import apply_activation
101
+ from cpu.activation_functions import apply_activation
102
102
  array_type = np
103
103
 
104
104
  else:
105
- from .cuda.data_ops import normalization
106
105
  from .cuda.activation_functions import apply_activation
107
106
  array_type = cp
108
107
 
@@ -119,7 +118,7 @@ def plan_fit(
119
118
 
120
119
  weight += y_train.T @ x_train if not cuda else cp.array(y_train).T @ cp.array(x_train)
121
120
 
122
- return normalization(weight, dtype=dtype)
121
+ return normalization(weight.get() if cuda else weight,dtype=dtype)
123
122
 
124
123
 
125
124
  def learn(x_train, y_train, optimizer, template_model, gen, pop_size, fit_start=True, batch_size=1,
@@ -314,7 +313,7 @@ def learn(x_train, y_train, optimizer, template_model, gen, pop_size, fit_start=
314
313
  # TRANSFORMATION PLAN TO MLP FOR PTNN (in later generations)
315
314
  if model_type == 'PLAN' and transfer_learning:
316
315
  if i == gen_copy[0]:
317
-
316
+
318
317
  model_type = 'PTNN'
319
318
  neurons = neurons_copy
320
319
 
@@ -608,9 +607,9 @@ def learn(x_train, y_train, optimizer, template_model, gen, pop_size, fit_start=
608
607
  def evaluate(
609
608
  x_test,
610
609
  y_test,
610
+ model=None,
611
611
  model_type=None,
612
612
  W=None,
613
- model=None,
614
613
  activations=['linear'],
615
614
  activation_potentiations=[],
616
615
  auto_normalization=False,
@@ -625,11 +624,11 @@ def evaluate(
625
624
 
626
625
  y_test (np.ndarray): Test labels (one-hot encoded).
627
626
 
627
+ model (tuple, optional): Trained model.
628
+
628
629
  model_type: (str, optional): Type of the model. Options: 'PLAN', 'MLP', 'PTNN'.
629
630
 
630
631
  W (array-like, optional): Neural net weight matrix.
631
-
632
- model (tuple, optional): Trained model.
633
632
 
634
633
  activations (list, optional): Activation list for PLAN or MLP models (MLP layers activations if it PTNN model). Default = ['linear'].
635
634
 
@@ -684,6 +683,6 @@ def evaluate(
684
683
  softmax_preds = array_type.exp(result - max_vals) / array_type.sum(array_type.exp(result - max_vals), axis=1, keepdims=True)
685
684
  accuracy = (array_type.argmax(softmax_preds, axis=1) == array_type.argmax(y_test, axis=1)).mean()
686
685
 
687
- if show_report: plot_evaluate(x_test, y_test, result, model=model, cuda=cuda)
686
+ if show_report: plot_evaluate(x_test, y_test, result, acc=accuracy, model=model, cuda=cuda)
688
687
 
689
688
  return W, result, accuracy, None, None, softmax_preds
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 5.45b0
3
+ Version: 5.47
4
4
  Summary: PyereualJetwork is a GPU-accelerated machine learning library in Python for professionals and researchers. It features PLAN, MLP, Deep Learning training, and ENE (Eugenic NeuroEvolution) for genetic optimization, applicable to genetic algorithms or Reinforcement Learning (RL). The library includes data pre-processing, visualizations, model saving/loading, prediction, evaluation, training, and detailed or simplified memory management.
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -1,11 +1,11 @@
1
- pyerualjetwork/__init__.py,sha256=b88nZfYEZm1CNhB0eU2cfkuO8uTFvhRrDZYhAmpTNx4,3022
1
+ pyerualjetwork/__init__.py,sha256=QUa5yI_HBHXe3fDWR7rT8k2BjlFxgwT_qFEwGPBYzzk,3020
2
2
  pyerualjetwork/ene.py,sha256=8g2XEPRm3NLqSaN7xihIj1xXdIjSrl8Q69zqWTIXPI4,42142
3
3
  pyerualjetwork/fitness_functions.py,sha256=D9JVCr9DFid_xXgBD4uCKxdW2k10MVDE5HZRSOK4Igg,1237
4
4
  pyerualjetwork/help.py,sha256=sn9jBzXkQsTZvdgsUXUpSs_BbYYIgY3whofg6dj8peI,848
5
5
  pyerualjetwork/issue_solver.py,sha256=uay_9XK6xWnLmK2P_BeyDQlyNXzg_zYffnXYd228wZk,4102
6
6
  pyerualjetwork/memory_ops.py,sha256=TUFh9SYWCKL6N-vNdWId_EwU313TuZomQCHOrltrD-4,14280
7
7
  pyerualjetwork/model_ops.py,sha256=39eUKrj0VKYiEYWKcq1U8O0TV_QMrxkuy8IhCHQsEcw,25101
8
- pyerualjetwork/nn.py,sha256=I80lIgs2Hzf3dC8J5SeHlra04xfx96wuhMi_dMiF71c,36656
8
+ pyerualjetwork/nn.py,sha256=tSbzFk1MPb0ojwNiOUqM5JO56hiarB7eyKn3xqAibAA,36652
9
9
  pyerualjetwork/old_cpu_model_ops.py,sha256=1KNgjUeYCO_TsA5RtbNiuIiBJzq8-rL2dE6jxKqCBU0,21481
10
10
  pyerualjetwork/old_cuda_model_ops.py,sha256=KAscAd8e_I8Vqdd9BJaHd6-IG6fhxFglAFxys0sqmEo,23079
11
11
  pyerualjetwork/ui.py,sha256=JBTFYz5R24XwNKhA3GSW-oYAoiIBxAE3kFGXkvm5gqw,656
@@ -14,14 +14,14 @@ pyerualjetwork/cpu/activation_functions.py,sha256=zZSoOQ452Ykp_RsHVxklxesJmmFguf
14
14
  pyerualjetwork/cpu/data_ops.py,sha256=SPsIcjU0JPHfsnEmGjD8q-yTlpgYk-KPOPJ44dfp-nU,16143
15
15
  pyerualjetwork/cpu/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
16
16
  pyerualjetwork/cpu/metrics.py,sha256=NF8FARAqtuGlf4omVkQT4pOQZy7uePqzuHZGX9Y_Pn4,6076
17
- pyerualjetwork/cpu/visualizations.py,sha256=fzpzRDuAVKAoT4fQuxAYGQe-0kd7XvhGUjs8-m6J3lI,26946
17
+ pyerualjetwork/cpu/visualizations.py,sha256=RcEZXX-U3BStOna1-C_a7z2VpXHuLAigeg1pD4u8I9I,26923
18
18
  pyerualjetwork/cuda/__init__.py,sha256=Kja6OmNaJ0giOhRNYw9hgGkh5N4F1EUS2v94E_rmp2k,839
19
19
  pyerualjetwork/cuda/activation_functions.py,sha256=Gj-qalU0GoAWoZzbFFHsD-R0c0KzHwOK1wwUQneBE44,6872
20
20
  pyerualjetwork/cuda/data_ops.py,sha256=k7NX-ckZ6-NwvioigACUHrekG7L5lO4bzTtQbBwH1Fc,18508
21
21
  pyerualjetwork/cuda/loss_functions.py,sha256=C93IZJcrOpT6HMK9x1O4AHJWXYTkN5WZiqdssPbvAPk,617
22
22
  pyerualjetwork/cuda/metrics.py,sha256=PjDBoRvr6va8vRvDIJJGBO4-I4uumrk3NCM1Vz4NJTo,5054
23
23
  pyerualjetwork/cuda/visualizations.py,sha256=2mHE7iqqsN3K6xtCnemS4o_YWGS0bIV2IxF4cG6Ur9k,20090
24
- pyerualjetwork-5.45b0.dist-info/METADATA,sha256=wiRmD_VqNVubkmWxwoEsem7NRL8Ar5eWFjVMXsgnZYg,7990
25
- pyerualjetwork-5.45b0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
26
- pyerualjetwork-5.45b0.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
27
- pyerualjetwork-5.45b0.dist-info/RECORD,,
24
+ pyerualjetwork-5.47.dist-info/METADATA,sha256=xLHthdh9VXUGHS5O7AJBqI6-SI9UYonCdq_deuiOiOs,7988
25
+ pyerualjetwork-5.47.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
26
+ pyerualjetwork-5.47.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
27
+ pyerualjetwork-5.47.dist-info/RECORD,,