pyerualjetwork 5.50.dev0__py3-none-any.whl → 5.51__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.50dev0"
45
+ __version__ = "5.51"
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
@@ -617,8 +617,6 @@ def predict_from_memory(Input, model, cuda=False):
617
617
 
618
618
  layer = Input @ cp.array(W[0]).T if cuda else Input @ W[0].T
619
619
  for i in range(1, len(W)):
620
- print(activations[i-1])
621
- input()
622
620
  layer = apply_activation(layer, activations[i-1])
623
621
  layer = layer @ cp.array(W[i]).T if cuda else layer @ W[i].T
624
622
 
pyerualjetwork/nn.py CHANGED
@@ -121,7 +121,7 @@ def plan_fit(
121
121
  return normalization(weight.get() if cuda else weight,dtype=dtype)
122
122
 
123
123
 
124
- def learn(x_train, y_train, optimizer, template_model, gen, pop_size, fit_start=True, batch_size=1,
124
+ def learn(x_train, y_train, optimizer, gen, pop_size, fit_start=True, batch_size=1,
125
125
  weight_evolve=True, neural_web_history=False, show_current_activations=False, auto_normalization=False,
126
126
  neurons_history=False, early_stop=False, show_history=False, target_loss=None,
127
127
  interval=33.33, target_acc=None, loss='categorical_crossentropy', acc_impact=0.9, loss_impact=0.1,
@@ -168,7 +168,6 @@ def learn(x_train, y_train, optimizer, template_model, gen, pop_size, fit_start=
168
168
  batch_size=0.05,
169
169
  interval=16.67)
170
170
  ```
171
- :param template_model: (tuple): Use --> get_model_template() function in the model_ops module.
172
171
  :param fit_start: (bool, optional): If the fit_start parameter is set to True, the initial generation population undergoes a simple short training process using the PLAN algorithm. This allows for a very robust starting point, especially for large and complex datasets. However, for small or relatively simple datasets, it may result in unnecessary computational overhead. When fit_start is True, completing the first generation may take slightly longer (this increase in computational cost applies only to the first generation and does not affect subsequent generations). If fit_start is set to False, the initial population will be entirely random. Additonaly if you want to train PTNN model you must be give True. Options: True or False. Default: True
173
172
  :param gen: (int or list): The generation count for genetic optimization. If you want to train PTNN model you must give a list of two number. First number for PLAN model training second number for MLP.
174
173
  :param batch_size: (float, optional): Batch size is used in the prediction process to receive train feedback by dividing the train data into chunks and selecting activations based on randomly chosen partitions. This process reduces computational cost and time while still covering the entire train set due to random selection, so it doesn't significantly impact accuracy. For example, a batch size of 0.08 means each train batch represents %8 of the train set. Default is 1. (%100 of train)
@@ -200,8 +199,9 @@ def learn(x_train, y_train, optimizer, template_model, gen, pop_size, fit_start=
200
199
 
201
200
  from .ene import define_genomes
202
201
  from .cpu.visualizations import display_decision_boundary_history, create_decision_boundary_hist, plot_decision_boundary
202
+ from .model_ops import get_model_template
203
203
 
204
- if cuda is False:
204
+ if cuda is False:
205
205
  from .cpu.data_ops import batcher
206
206
  from .cpu.loss_functions import categorical_crossentropy, binary_crossentropy
207
207
  from .cpu.visualizations import (
@@ -223,10 +223,18 @@ def learn(x_train, y_train, optimizer, template_model, gen, pop_size, fit_start=
223
223
 
224
224
  data = 'Train'
225
225
 
226
+ template_model = get_model_template()
227
+
226
228
  except_this = ['spiral', 'circular']
227
229
  activations = [item for item in all_activations() if item not in except_this]
228
230
  activations_len = len(activations)
229
231
 
232
+ def format_number(val):
233
+ if abs(val) >= 1e4 or (abs(val) < 1e-2 and val != 0):
234
+ return f"{val:.4e}"
235
+ else:
236
+ return f"{val:.4f}"
237
+
230
238
  # Pre-checks
231
239
 
232
240
  if cuda:
@@ -400,8 +408,8 @@ def learn(x_train, y_train, optimizer, template_model, gen, pop_size, fit_start=
400
408
  if model_type == 'PLAN': final_activations = [final_activations[0]] if len(set(final_activations)) == 1 else final_activations # removing if all same
401
409
 
402
410
  if batch_size == 1:
403
- postfix_dict[f"{data} Accuracy"] = np.round(best_acc, 4)
404
- postfix_dict[f"{data} Loss"] = np.round(train_loss, 4)
411
+ postfix_dict[f"{data} Accuracy"] = format_number(best_acc)
412
+ postfix_dict[f"{data} Loss"] = format_number(train_loss)
405
413
  progress.set_postfix(postfix_dict)
406
414
 
407
415
  if show_current_activations:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 5.50.dev0
3
+ Version: 5.51
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=Y_qdG3TL_xRN5XwJ0TgYXOwQveQy9PtfSnY8prmceFM,3024
1
+ pyerualjetwork/__init__.py,sha256=Oj7otqqA12kanGnzl9aUwrgTCX9ocUj_WSCInTEnOpc,3020
2
2
  pyerualjetwork/ene.py,sha256=luTvspHRTose6s3uRas40pNXyKoxU9siaHiMBNI5yoc,42136
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
- pyerualjetwork/model_ops.py,sha256=44apKiu5yPxzIbQhCMlcq_2ju2m37Z30iXHErOteJI0,25217
8
- pyerualjetwork/nn.py,sha256=t1Jf99F6PqfEfCH6erPcwN6q-tF3DPYgHUlQ7OMtnv8,36656
7
+ pyerualjetwork/model_ops.py,sha256=WaP1XwKqXMfZl4Yop8a1Bg0xtmLYgap9JFOWHaLr7S4,25143
8
+ pyerualjetwork/nn.py,sha256=jrP6xOBTOS2zH6wd3_OZAKw5FxdqSV_p5FdIOyE-Mgs,36810
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
@@ -21,7 +21,7 @@ pyerualjetwork/cuda/data_ops.py,sha256=BEXh4M7BWXaTpYlVS9D2i3CGgOmL5131vy7FZyuTQ
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.50.dev0.dist-info/METADATA,sha256=3BB3HGslclB4BoW6w_H7wwqj-bh2X-z9RhGYzTLmoJM,7993
25
- pyerualjetwork-5.50.dev0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
26
- pyerualjetwork-5.50.dev0.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
27
- pyerualjetwork-5.50.dev0.dist-info/RECORD,,
24
+ pyerualjetwork-5.51.dist-info/METADATA,sha256=MZ9ZIn3ZLZ1o_8Tq72-lQTrzfilmH57kv_I8n2A9J44,7988
25
+ pyerualjetwork-5.51.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
26
+ pyerualjetwork-5.51.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
27
+ pyerualjetwork-5.51.dist-info/RECORD,,