pyerualjetwork 4.3.7.dev1__py3-none-any.whl → 4.3.8.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.7dev1"
1
+ __version__ = "4.3.8dev2"
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.7.dev1
3
+ Version: 4.3.8.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,4 +1,4 @@
1
- pyerualjetwork/__init__.py,sha256=AVEMj3I45lWmAMQ1V_eVyHBmC5xBctmCIOfbyVe_GlE,643
1
+ pyerualjetwork/__init__.py,sha256=nPGiyGq2Pp77XLq58hQyssV6MEsR5WtX5KBsNdDFTmU,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=2-MH8ePacnBtkhyjK1iy8Swio4xROO7vnq4tDzCuXUU,655
21
+ pyerualjetwork_afterburner/__init__.py,sha256=YgqMdpZsYdj7bifflS1AR8FcDgWyMOVui_y2ZZzAFj4,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
@@ -32,13 +32,13 @@ pyerualjetwork_afterburner/metrics_cuda.py,sha256=73h9GC7XwmnFCVzFEEiPQfF8CwHIz2
32
32
  pyerualjetwork_afterburner/model_operations.py,sha256=MCSCNYiiICRVZITobtS3ZIWmH5Q9gjyELuH32sAdgg4,12649
33
33
  pyerualjetwork_afterburner/model_operations_cuda.py,sha256=NT01BK5nrDYE7H1x3KnSI8gmx0QTGGB0mP_LqEb1uuU,13157
34
34
  pyerualjetwork_afterburner/plan.py,sha256=Gxv8ii4brTYMzzFZBP-X6kkwc6w6vtTPiMmqVOAqoq8,21972
35
- pyerualjetwork_afterburner/plan_cuda.py,sha256=bNHjFniZdu7Y_R6sCA6fdmMyfyxSAvkgPtHkybg3O2Q,22904
35
+ pyerualjetwork_afterburner/plan_cuda.py,sha256=gbVxPsPNB3VpicatudoauwWFI0HWKD58iiQexZMhG7s,23381
36
36
  pyerualjetwork_afterburner/planeat.py,sha256=Lq5R0aMS4UIdZdbUKsKDv5g0WLwYryomR3IQYb8vAa4,37573
37
- pyerualjetwork_afterburner/planeat_cuda.py,sha256=KnU54osvwrMVvdO4fww7BqFBoq0I8c2YcZOVHD8l69g,37494
37
+ pyerualjetwork_afterburner/planeat_cuda.py,sha256=SG7Oq1F2m3lJBbG9cgmu7q_ApmwSn2SvTpcbtEVAoDE,37630
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.7.dev1.dist-info/METADATA,sha256=aGfbCh4dI0QGesiAYyHJDBiV70hw52ENOdOhgS39_JI,8384
42
- pyerualjetwork-4.3.7.dev1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
43
- pyerualjetwork-4.3.7.dev1.dist-info/top_level.txt,sha256=uK64ge08QQoPuXM3aiRVPgiQQtl8Fxm2-HieIut5Lwo,42
44
- pyerualjetwork-4.3.7.dev1.dist-info/RECORD,,
41
+ pyerualjetwork-4.3.8.dev2.dist-info/METADATA,sha256=5uQDMY7y7MpscA3WUJhgDey45sF8DqxxM4ilwtLZxwI,8384
42
+ pyerualjetwork-4.3.8.dev2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
43
+ pyerualjetwork-4.3.8.dev2.dist-info/top_level.txt,sha256=uK64ge08QQoPuXM3aiRVPgiQQtl8Fxm2-HieIut5Lwo,42
44
+ pyerualjetwork-4.3.8.dev2.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
- __version__ = "4.3.7dev1-afterburner"
1
+ __version__ = "4.3.8dev2-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__):
@@ -76,7 +76,7 @@ def fit(
76
76
  return normalization(LTPW, dtype=dtype)
77
77
 
78
78
 
79
- def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=None, batch_size=1,
79
+ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=None, batch_size=1, pop_size=None,
80
80
  neural_web_history=False, show_current_activations=False,
81
81
  neurons_history=False, early_stop=False, loss='categorical_crossentropy', show_history=False,
82
82
  interval=33.33, target_acc=None, target_loss=None,
@@ -120,6 +120,8 @@ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=Non
120
120
 
121
121
  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 test 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)
122
122
 
123
+ pop_size (int, optional): Population size of each generation. Default: count of activation functions
124
+
123
125
  early_stop (bool, optional): If True, implements early stopping during training.(If train accuracy not improves in two gen stops learning.) Default is False.
124
126
 
125
127
  show_current_activations (bool, optional): Should it display the activations selected according to the current strategies during learning, or not? (True or False) This can be very useful if you want to cancel the learning process and resume from where you left off later. After canceling, you will need to view the live training activations in order to choose the activations to be given to the 'start_this' parameter. Default is False
@@ -129,7 +131,7 @@ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=Non
129
131
  loss (str, optional): For visualizing and monitoring. PLAN neural networks doesn't need any loss function in training. options: ('categorical_crossentropy' or 'binary_crossentropy') Default is 'categorical_crossentropy'.
130
132
 
131
133
  interval (int, optional): The interval at which evaluations are conducted during training. (33.33 = 30 FPS, 16.67 = 60 FPS) Default is 100.
132
-
134
+
133
135
  target_acc (int, optional): The target accuracy to stop training early when achieved. Default is None.
134
136
 
135
137
  target_loss (float, optional): The target loss to stop training early when achieved. Default is None.
@@ -155,12 +157,15 @@ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=Non
155
157
 
156
158
  data = 'Train'
157
159
 
158
- activation_potentiation = all_activations()
159
-
160
+ except_this = ['spiral', 'circular']
161
+ activation_potentiation = [item for item in all_activations() if item not in except_this]
160
162
  activation_potentiation_len = len(activation_potentiation)
161
163
 
164
+ if pop_size is None: pop_size = activation_potentiation_len
162
165
  y_train = optimize_labels(y_train, cuda=True)
163
166
 
167
+ if pop_size < activation_potentiation_len: raise ValueError(f"pop_size must be higher or equal to {activation_potentiation_len}")
168
+
164
169
  if memory == 'gpu':
165
170
  x_train = transfer_to_gpu(x_train, dtype=dtype)
166
171
  y_train = transfer_to_gpu(y_train, dtype=y_train.dtype)
@@ -201,16 +206,16 @@ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=Non
201
206
 
202
207
  progress = initialize_loading_bar(total=activation_potentiation_len, desc="", ncols=ncols, bar_format=bar_format_learner)
203
208
 
204
- if fit_start is False:
205
- weight_pop, act_pop = define_genomes(input_shape=len(x_train[0]), output_shape=len(y_train[0]), population_size=activation_potentiation_len, dtype=dtype)
209
+ if fit_start is False or pop_size > activation_potentiation_len:
210
+ weight_pop, act_pop = define_genomes(input_shape=len(x_train[0]), output_shape=len(y_train[0]), population_size=pop_size, dtype=dtype)
206
211
 
207
212
  if start_this_act is not None and start_this_W is not None:
208
213
  weight_pop[0] = start_this_W
209
214
  act_pop[0] = start_this_act
210
215
 
211
216
  else:
212
- weight_pop = []
213
- act_pop = []
217
+ weight_pop = [0] * pop_size
218
+ act_pop = [0] * pop_size
214
219
 
215
220
  for i in range(gen):
216
221
  postfix_dict["Gen"] = str(i+1) + '/' + str(gen)
@@ -220,17 +225,17 @@ def learner(x_train, y_train, optimizer, fit_start, strategy='accuracy', gen=Non
220
225
  progress.last_print_n = 0
221
226
  progress.update(0)
222
227
 
223
- for j in range(activation_potentiation_len):
228
+ for j in range(pop_size):
224
229
 
225
230
  x_train_batch, y_train_batch = batcher(x_train, y_train, batch_size=batch_size)
226
231
 
227
232
  x_train_batch = cp.array(x_train_batch, dtype=dtype, copy=False)
228
233
  y_train_batch = cp.array(y_train_batch, dtype=dtype, copy=False)
229
234
 
230
- if fit_start is True and i == 0:
231
- act_pop.append(activation_potentiation[j])
235
+ if fit_start is True and i == 0 and j <= activation_potentiation_len:
236
+ act_pop[j] = activation_potentiation[j]
232
237
  W = fit(x_train_batch, y_train_batch, activation_potentiation=act_pop[-1], dtype=dtype)
233
- weight_pop.append(W)
238
+ weight_pop[j] = W
234
239
 
235
240
  model = evaluate(x_train_batch, y_train_batch, W=weight_pop[j], activation_potentiation=act_pop[j])
236
241
  acc = model[get_acc()]
@@ -722,7 +722,8 @@ def mutation(weight,
722
722
 
723
723
  new_threshold = threshold
724
724
 
725
- all_acts = all_activations()
725
+ except_this = ['spiral', 'circular']
726
+ all_acts = [item for item in all_activations() if item not in except_this] # SPIRAL AND CIRCULAR ACTIVATION DISCARDED
726
727
 
727
728
  activation_add_prob = 1 - activation_add_prob
728
729
  activation_delete_prob = 1 - activation_delete_prob